Skip to content

Instantly share code, notes, and snippets.

@quandqn
Last active May 27, 2016 07:49
Show Gist options
  • Save quandqn/b42c15deb3b67772bd05e985c820f7e7 to your computer and use it in GitHub Desktop.
Save quandqn/b42c15deb3b67772bd05e985c820f7e7 to your computer and use it in GitHub Desktop.
def mitm():
A = {}
k1 = '13abcf8a0d6cbb61fd3f7bc3a4ee'.decode("hex")
for i in range(0xff):
for j in range(0xff):
key1 = k1 + chr(i) + chr(j)
A.update({enc(key1, "Somehow I lost 2 bytes of each key"): key1})
k2 = 'a6d43c9d371f67a984acf3c94a91'.decode('hex')
for i in range(0xff):
for j in range(0xff):
key2 = k2 + chr(i) + chr(j)
cip = dec(key2, '8lmWpP4K1zlNDVIre6htrld9Omh+Mc61CJpP/ajgdNf0gg=='.decode("base64"))
if A.has_key(cip):
print key2.encode("hex")
print A[cip].encode("hex")
break
mitm()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment