Skip to content

RSA KEM

RSA-KEM

- Used to Encrypt a Symmetric Key

Implementation

import secrets

alice_public_key, alice_private_key = generate_rsa_keypair()

#Generate AES Key
random_aes_key = secrets.randbits(256)

encrypted_aes_key = bob_public_key.encrypt(random_aes_key)