Created
October 21, 2016 09:36
-
-
Save msm-code/c768e343ceef4fdb569cef4f02e13847 to your computer and use it in GitHub Desktop.
paper.python.fd38e71c7996d21488ca07737dd4dc15
This file contains hidden or 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