Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save msm-code/c6cff838c24eba7f2692124b41551b09 to your computer and use it in GitHub Desktop.

Select an option

Save msm-code/c6cff838c24eba7f2692124b41551b09 to your computer and use it in GitHub Desktop.
paper.python.aff86e72b5462bf8d858196af5f88ea2
def nymaim_decrypt(key, raw_bytes):
nibble0 = raw_bytes[0] & 0xF
nibble1 = raw_bytes[1] & 0xF
salt = raw_bytes[2:2+nibble0]
password = key + salt
data = raw_bytes[2+nibble0:len(raw_bytes)-nibble1]
decrypted = rc4_decrypt(password, body)
decrypted_len = struct.unpack('<I', decrypted[:4])[0]
assert decrypted_len == len(decrypted - 4)
return decrypted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment