![]() crypt(str(RSAkey.encrypt(key, '')))įile "/usr/lib/python2.7/dist-packages/Crypto/PublicKey/RSA.py", line 174, in decrypt The problem however, is that in another script, meant for decrypting enc_key to get the original AES key used to encrypt the files, trying to decrypt the enc_key which has been converted to a string produces an error: I am converting the enc_key to a string so that I can write it to a text file, otherwise enc_key.txt will contain rubbish. RSAkey = '-BEGIN PUBLIC KEY-\nSome RSA Key here\n-END PUBLIC KEY-'Ĭustom_writefile_function('enc_key.txt', enc_key) The code is as follows: from Crypto.PublicKey import RSA The encrypted AES key will be shared with authorized persons in possession of the private key to decrypt it. ![]() I am trying to implement a script that will encrypt a file using a randomly generated AES key then encrypt said AES key with an RSA public key.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |