2020
10-10
10-10
python rsa-oaep加密的示例代码
代码:fromCrypto.PublicKeyimportRSAfromCrypto.CipherimportPKCS1_OAEPimportbase64rsa_key_pair=RSA.generate(1024)pubkey=rsa_key_pair.publickey().export_key()privkey=rsa_key_pair.export_key()print(pubkey.decode())print(privkey.decode())#公钥加密text="helloworld"rsa_pubkey=RSA.import_key(pubkey)cipher_pub=PKCS1_OAEP.new(rsa_pubkey)ciphervalue_enc=base64.b64encode(cipher_pub.encr...
继续阅读 >