I'm having quite the difficulty understanding what's wrong here, does anyone have the knowledge to decipher what this error message means and potentially how to fix the issue?
'''
from Crypto.Cipher import DES
def DESenc():
key = b'password'
message = b'i like beans'
cipher = DES.new(key, DES.MODE_EAX)
ciphertext, tag = cipher.encrypt_and_digest(message)
file_out = open("encrypted.bin", "wb")
[ file_out.write(x) for x in (cipher.nonce, tag, ciphertext) ]
file_out.close()
def DESdec():
file_in = open("encrypted.bin", "rb")
nonce, tag, ciphertext = [ file_in.read(x) for x in (16, 16, -1) ]
key = b'password'
cipher = DES.new(key, DES.MODE_EAX, nonce=nonce)
data = cipher.decrypt_and_verify(ciphertext, tag)
print(data.decode('ascii'))
DESenc()
DESdec()
'''