![]() ![]() > signature = pkcs1_15.new(key).sign(h)Īt the other end, the receiver can verify the signature (and therefore the authenticity of the message) using the matching public RSA key: > key = RSA.import_key(open('public_key.der'). > key = RSA.import_key(open('private_key.der').read()) Encryption: It encrypts a secret message (integer in the range 0keylength) using the public key and decrypts it back using the secret key. The following example shows how a private RSA key (loaded from a file) can be used to compute the signature of a message: > from Crypto.Signature import pkcs1_15 ![]() I found a way with a method as efficient and more secure, here is the code (took directly from the PKCS1_v1_5 documentation):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |