Skip to content

Instantly share code, notes, and snippets.

@xperylab
Created July 25, 2021 13:19
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 xperylab/a3896ec621a29431d96c41cfbb18815b to your computer and use it in GitHub Desktop.
Save xperylab/a3896ec621a29431d96c41cfbb18815b to your computer and use it in GitHub Desktop.
PM : Decrypting with Main key
mainKey = keychainVal['NoneProtection']
IVsize = 16
def decryptWithMainKey(encrypted):
iv = encrypted[:IVsize]
cipher = AES.new(mainKey, AES.MODE_CTR, initial_value=iv, nonce=b'')
return cipher.decrypt(encrypted[IVsize:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment