Skip to content

Instantly share code, notes, and snippets.

@christopherhesse
Created August 27, 2015 23:17
Show Gist options
  • Save christopherhesse/2011f2c63c896e308884 to your computer and use it in GitHub Desktop.
Save christopherhesse/2011f2c63c896e308884 to your computer and use it in GitHub Desktop.
key = "1sW28zp7CWv5TtGjlQpDHHG4Cbr9v36fG5o4f74LsKg=".decode("base64")
tag = "OBA7UU/Rd9j0Zn+9korAyQ==".decode("base64")
initialization_vector = "O2QAL8AYQB+qbre8".decode("base64")
encrypted_message = "7YS1aTE=".decode("base64")
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
decryptor = Cipher(
algorithms.AES(key),
modes.GCM(initialization_vector, tag),
backend=default_backend(),
).decryptor()
message = decryptor.update(encrypted_message) + decryptor.finalize()
print "message:", message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment