encrypto1 = rsacoreencrypt_inta public_keye public_keynencrypto2 = rsacoreencrypt_intb public_keye public_keyndecrypto =rsacoredecrypt_intencrypto1encrypto2 private_keyd public_keynprintdecrypto逐行解释代码
-
encrypto1 = rsa.core.encrypt_int(a, public_key.e, public_key.n): This line encrypts the integer variableausing the RSA encryption algorithm with the public keypublic_key.eandpublic_key.n. The result is stored in the variableencrypto1. -
encrypto2 = rsa.core.encrypt_int(b, public_key.e, public_key.n): This line encrypts the integer variablebusing the RSA encryption algorithm with the public keypublic_key.eandpublic_key.n. The result is stored in the variableencrypto2. -
decrypto =rsa.core.decrypt_int(encrypto1*encrypto2, private_key.d, public_key.n): This line performs the decryption process by multiplyingencrypto1andencrypto2and then decrypting the result using the RSA decryption algorithm with the private keyprivate_key.dandpublic_key.n. The decrypted value is stored in the variabledecrypto. -
print(decrypto): This line prints the decrypted value stored in the variabledecrypto
原文地址: https://www.cveoy.top/t/topic/hBya 著作权归作者所有。请勿转载和采集!