mirror of
https://github.com/billbuchanan/appliedcrypto.git
synced 2026-02-20 13:50:42 +00:00
Update print statements to Python 3 syntax
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user