Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/python
complete = "g1Mm3Th3r3D1"
magic = "Linux version 4.17.0-rc4+ (likvidera@ubuntu) (gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)) #9 Sat May 12 12:57:01 PDT 2018"
# orig = "40369e8c78b46122a4e813228ae8ee6e"
# orig = "e4a75afe114e4483a46aaa20fe4e6ead"
orig = "8c3749214f4a9131ebc67e6c7a86d162"
# begin
d = ""
head = 0
n = 2
orig_pairs = [orig[i:i+n] for i in range(0, len(orig), n)]
for pair in orig_pairs:
p_val = int(pair,16)
p_key = ord(magic[head])
head += 1
d += "%02x" % (p_val ^ p_key)
print d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment