Examples

23 views
Skip to first unread message

Dave Pawson

unread,
Jan 29, 2017, 3:28:35 AM1/29/17
to PyCryptodome
http://pycryptodome.readthedocs.io/en/latest/src/examples.html shows examples.

Although I can get the SelfTest to run / pass, the examples as shown fail.

s/Crypto/Cryptodome/   accepted. 

E.g.

from Cryptodome.Cipher import AES

file_in = open("encrypted.bin", "rb")
nonce, tag, ciphertext = [ file_in.read(x) for x in (16, 16, -1) ]

# let's assume that the key is somehow available again
cipher = AES.new(key, AES.MODE_EAX, nonce)
data = cipher.decrypt_and_verify(ciphertext, tag)

Where's the nonce created?
Reply all
Reply to author
Forward
0 new messages