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3",
b'q\x97M\r\xba\x88\xd1%\xf6{\x0e\xb1*\xc6m@&1\xd8;St\xfa\xc2\xd2\xd6',
b'm\x90HB\xa9\x8a\xce%\xe2gZ\xf7+\xc7}\x05 *\x9d6\x1c7\xfc\xcf\xd2\x86\xfb\xa9t5',
b'n\x90SA\xb9\xcd\xcf%\xf8{\x1f\xe1b\xder\t><\x9d\x0bS`\xed\xc2\xc7',
b'9\xd8_I\xbb\x8c\xd4%\xeer\x16\xf0,\x89j\x0f7y\x9dbS7\xa8\x87\x97\x86\xbf',
]
from string import ascii_lowercase
# set of allowed characters
letters = set(ascii_lowercase + ' ')
# reconstructed messages
plaintext = [''] * len(ciphertext)
# take all the codes at the same position
for messages in zip(*ciphertext):
keys = set()
# find viable keys
for key in range(256):
for m in messages:
if chr(m ^ key) not in letters:
break
else:
keys.add(key)
key = keys.pop() if len(keys) == 1 else None
# reconstruct plaintext
for i, m in enumerate(messages):
if key is not None:
plaintext[i] += chr(m ^ key)
else:
plaintext[i] += '?'
plaintext
['take?this kiss upon?t', 'and ?n parting from?y', 'thus?much let me av?w', 'you ?re not wrong w?o', 'that?my days have b?e', 'yet ?f hope has flo?n', 'in a?night or in a ?a', 'in a?vision or in n?n', 'is i? therefore the?l', 'all ?hat we see or ?e', 'is b?t a dream with?n', 'i st?nd amid the ro?r', 'of a?surf tormented?s', 'and ? hold within m? ', 'grai?s of the golde? ', 'how ?ew yet how the? ', 'thro?gh my fingers ?o', 'whil? i weep while ? ', ' ed?ar allan poe ? ']