Private_key = RSA.generate(modulus_lenght, Random.new().read)ĭ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) I've tried to do this: from Crypto import Random I want to do an app where the message is public but it can only be seen if you have the public key. More than secure encryption I'm looking for some kind of obfuscation. Is it possible to encrypt a message with a private key in python using pycryptodome or any other library? I know that you are not supposed to encrypt with the private key and decrypt with the public key, but my purpose is to encrypt with the private one so the receiver could be sure that the message was send by the real author.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |