Skip to content

Instantly share code, notes, and snippets.

@ymgve
Created May 22, 2017 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ymgve/6d85f7dce51263beab995244d2d42257 to your computer and use it in GitHub Desktop.
Save ymgve/6d85f7dce51263beab995244d2d42257 to your computer and use it in GitHub Desktop.
# a b c d e f g h
# a^b b^c c^d d^e e^f f^g g^h
# a^c b^d c^e d^f e^g f^h
# a^b^c^d b^c^d^e c^d^e^f d^e^f^g e^f^g^h
# a^e b^f c^g d^h
# a^b^e^f b^c^f^g c^d^g^h
data = open("out.txt", "rb").read().replace("\x0d\x0a", "\x0a")
for offset in xrange(len(data)):
test = list("RCTF{" + data[offset:])
for i in xrange(len(test)-5):
test[i+5] = chr(ord(test[i+0]) ^ ord(test[i+1]) ^ ord(test[i+4]) ^ ord(test[i+5]))
good = True
for i in xrange(127, 256):
if chr(i) in test:
good = False
break
for i in xrange(32):
if i in (9, 10, 13):
continue
if chr(i) in test:
good = False
break
if good:
print repr("".join(test))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment