Created
May 22, 2017 00:27
-
-
Save ymgve/6d85f7dce51263beab995244d2d42257 to your computer and use it in GitHub Desktop.
This file contains 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
# 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