Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pycryptodome rsa encrypt

from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes

key = get_random_bytes(16)
cipher = AES.new(key, AES.MODE_EAX)
ciphertext, tag = cipher.encrypt_and_digest(data)

file_out = open("encrypted.bin", "wb")
[ file_out.write(x) for x in (cipher.nonce, tag, ciphertext) ]
file_out.close()
Source by pycryptodome.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #pycryptodome #rsa #encrypt
ADD COMMENT
Topic
Name
2+6 =