Skip to content

Instantly share code, notes, and snippets.

@AndyNovo AndyNovo/challenge.txt Secret
Created Mar 20, 2019

Embed
What would you like to do?
291c1a1654081652063145303b0d53192d1b0b333d227e7f26273d5b07060f0e4e4900494e0e0f06075b3d27267f7e223d330b1b2d19530d3b3045310652160854161a1c29
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 ctf_xor.py > thechallenge.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.