I was curious about your problem and then I started to try to codeĪfter a while I realized that if you run this snippet you will see that it correctly works: #!/usr/bin/env pythonĭef encrypt_private_key(a_message, private_key):Įncrypted_msg = encryptor.encrypt(a_message)Įncoded_encrypted_msg = base64.b64encode(encrypted_msg)ĭef decrypt_public_key(encoded_encrypted_msg, public_key):ĭecoded_encrypted_msg = base64.b64decode(encoded_encrypted_msg)ĭecoded_decrypted_msg = crypt(decoded_encrypted_msg)Įncoded = encrypt_private_key(message, public)īut if you now change two of the final lines into: encoded = encrypt_private_key(message, private)Īnd rerun the program you will get the TypeError: No private key the code that you are using doesn't allow you to do that for security reasons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |