Skip to content

Instantly share code, notes, and snippets.

Created Mar 20, 2019
What would you like to do?
from itertools import cycle, izip
def XOR(message, key):
return ''.join(chr(ord(c)^ord(k)) for c,k in izip(message, cycle(key)))
from xorsecret import themessage
reversed_message = themessage[::-1]
assert(themessage.count('ninja') > 0)
print XOR(themessage, reversed_message).encode('hex')
#ipython > thechallenge.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment