The invention discloses a lightweight public key test
system, and particularly relates to the field of public key test, which comprises a dynamic prime number generation module, a composite modulus construction module, a key pair generation module, a
hybrid encryption module and a decryption
verification module, the method comprises the following steps: generating prime number pairs with specific security strength, collecting initial entropies through a hardware entropy source, and storing the initial entropies into a security entropy
pool; testing different base values, and calculating a power calculation value to judge a prime number; p and q are input into the CRT to generate a composite modulus, an Euler function is calculated through block iteration, and a check code is embedded; using an extended Euclidean
algorithm to generate a public key and a private key, selecting a prime number from a predefined interval as a public key index, and verifying the prime number performance by a
verification formula; performing layered
encryption on the
plaintext, encoding the
plaintext by using an RSA-OAEP filling scheme in the first layer, calculating a
ciphertext by using a Montgomery modular multiplication
algorithm in the second layer, and adding an integrity
label; cRT is used to optimize a decryption process, a
Gaussian merging
algorithm is used to reconstruct a
plaintext, and a
ciphertext label is synchronously verified to detect man-in-the-middle
attack.