![]() Msg_hash = int.from_bytes(sha512(msg_body).digest(), byteorder='big') Hashes clear text message and creates signature"""Īes_cipher = AES.new(session_key, AES.MODE_EAX)Īes_cipher_text, tag = aes_cipher.encrypt_and_digest(msg_body)Įnc_session_key = rsa_cipher.encrypt(session_key) Returns the cipher text, tag, nonce, and the encrypted session key in hex format """Generates the session key, then creates the nonce and cipher. ![]() pem secured with a passphrase"""ĭef encrypt_msg(msg_body, publickey, privatekey): In actual usage private key is exported to. """ Generates the rsa key pair and returns them. Requires the P圜ryptodome module but is imported as Crypto"""įrom Crypto.Random import get_random_bytes """Hybrid AES/RSA encryption, integrity, and repudiation proof of concept. I wondering if anyone could give me feedback on whether or not this is a secure way to implement AES/RSA hybrid encryption and signatures in python 3 with the P圜ryptodome module.Īll of the encoding and to/from hex format is just there because that's the format I intend to transfer it in.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |