Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save msm-code/57b87f34adb13c5726229c8839e1602f to your computer and use it in GitHub Desktop.
Save msm-code/57b87f34adb13c5726229c8839e1602f to your computer and use it in GitHub Desktop.
paper.python.fd38e71c7996d21488ca07737dd4dc15
def inner_decrypt(raw, rsa_key):
encrypted_header, encrypted_data = raw[-0x40:], raw[:-0x40]
decrypted_data = rsa_decrypt(encrypted_header, rsa_key)
md5 = decrypted_data[0:16]
blob = decrypted_data[16:32]
length = from_uint32(decrypted_data[32:36])
serpent_decrypted = crypto.s_decrypt(encrypted_data, blob)[:length]
assert md5 == hashlib.md5(serpent_decrypted).digest()
return serpent_decrypted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment