Skip to content

Instantly share code, notes, and snippets.

@tobiasvl
Created September 16, 2015 08:23
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 tobiasvl/4512f77b052289ec81a0 to your computer and use it in GitHub Desktop.
Save tobiasvl/4512f77b052289ec81a0 to your computer and use it in GitHub Desktop.
def decrypt(row, cipher):
plain = ""
seed = ((row * 0x1E2F) + 0xFE64) & 0xFFFFFFFF
for byte in bytes.fromhex(cipher):
mask = (seed >> 8) & 0xFF
plain += chr(byte ^ mask)
seed = (((seed + byte) * 0x0E6C9AA0) + 0x196AAA91) & 0xFFFFFFFF
plain = re.sub("[^0-9]", "", plain)
return plain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment