Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created March 20, 2019 12:19
Show Gist options
  • Save AndyNovo/a6cc0ea09c08e1e26a934d199326eedb to your computer and use it in GitHub Desktop.
Save AndyNovo/a6cc0ea09c08e1e26a934d199326eedb to your computer and use it in GitHub Desktop.
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