-
-
Save AndyNovo/a6cc0ea09c08e1e26a934d199326eedb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
291c1a1654081652063145303b0d53192d1b0b333d227e7f26273d5b07060f0e4e4900494e0e0f06075b3d27267f7e223d330b1b2d19530d3b3045310652160854161a1c29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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