Episode 000
Francois Dion
@f_dion
Francois Dion
@f_dion
![]() |
Modern rendering of the original 1947 Memo 10742 |
"Replicate either:
a) the whole memo
or
b) the list of numbers
Whichever assignment you choose, the numbers must be generated programmatically."
Taking 2 strings of hexadecimal characters, converting hex to binary values, then xorsum the 2 values, and convert sum back to hex.
from binascii import hexlify, unhexlify
from Crypto.Cipher import XOR
# you can encounter hex strings with no spaces
encrypted = '556e6e216c606f78217264627364757216'
# or hex strings with spaces
key = '01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01'
#let's get binary representations
b_encrypted = unhexlify(encrypted)
b_key = unhexlify(key.replace(' ','')) # we remove the spaces
#to see a binary string output, use repr: print(repr(b_key))
cosmo = XOR.new(b_key)
bishop = cosmo.encrypt(b_encrypted) # yeah, encrypt to decrypt
print hexlify(bishop)
# the above is what was asked
# the plain ascii decrypted message is print(bishop)