Created
October 21, 2016 09:35
-
-
Save msm-code/57b87f34adb13c5726229c8839e1602f to your computer and use it in GitHub Desktop.
paper.python.fd38e71c7996d21488ca07737dd4dc15
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
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