From de0889419ae563b289eff54c93a964699ae91d68 Mon Sep 17 00:00:00 2001 From: Bill Buchanan Date: Thu, 15 Jan 2026 18:39:33 +0000 Subject: [PATCH] Update print statements to Python 3 syntax --- unit05_key_exchange/src/e_01.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unit05_key_exchange/src/e_01.py b/unit05_key_exchange/src/e_01.py index 65afc9d..c9e2d5d 100644 --- a/unit05_key_exchange/src/e_01.py +++ b/unit05_key_exchange/src/e_01.py @@ -34,8 +34,8 @@ rnd = random.randint(1,2**128) keyB= hashlib.md5(str(rnd)).digest() -print 'Long-term Key Alice=',binascii.hexlify(keyA) -print 'Long-term Key Bob=',binascii.hexlify(keyB) +print ('Long-term Key Alice=',binascii.hexlify(keyA)) +print ('Long-term Key Bob=',binascii.hexlify(keyB)) rnd = random.randint(1,2**128) keySession= hashlib.md5(str(rnd)).hexdigest() @@ -43,11 +43,11 @@ keySession= hashlib.md5(str(rnd)).hexdigest() ya = encrypt(keySession,keyA,AES.MODE_ECB) yb = encrypt(keySession,keyB,AES.MODE_ECB) -print "Encrypted key sent to Alice:",binascii.hexlify(ya) -print "Encrypted key sent to Bob:",binascii.hexlify(yb) +print ("Encrypted key sent to Alice:",binascii.hexlify(ya)) +print ("Encrypted key sent to Bob:",binascii.hexlify(yb)) decipherA = decrypt(ya,keyA,AES.MODE_ECB) decipherB = decrypt(yb,keyB,AES.MODE_ECB) -print "Session key:",decipherA -print "Session key:",decipherB +print ("Session key:",decipherA) +print ("Session key:",decipherB)