Skip to content

Instantly share code, notes, and snippets.

@jaxley
Created February 10, 2016 06:21
Show Gist options
  • Save jaxley/1b7f0304d008c88463dc to your computer and use it in GitHub Desktop.
Save jaxley/1b7f0304d008c88463dc to your computer and use it in GitHub Desktop.
Code to decrypt obfuscated Google Smart Lock Passwords
#!/usr/local/bin/python
# Adapted from gist https://gist.github.com/sekondus/4322469
from Crypto.Cipher import AES, blockalgo
import base64
import os
# the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SIZE = 32
# one-liners to encrypt/encode and decrypt/decode a string
# encrypt with AES, encode with hex decoding
#EncodeAES = lambda c, s: base64.b64encode(c.encrypt(s))
DecodeAES = lambda c, e: c.decrypt(base64.b16decode(e))
# obfuscationKey hex value
obfuscationKey = "2BC6A699ED0DA918B4AA8F497440A307F835347BF7B135226548E7258D410090"
# data to decrypt
encryptedPassword = "5E6E7B6195675D7040ED5F9C54CEAD8E"
# create a cipher object using the obfuscationKey converted to binary
cipher = AES.new(base64.b16decode(obfuscationKey), blockalgo.MODE_ECB)
# decrypt
decryptedPassword = DecodeAES(cipher, encryptedPassword)
print 'Password: [', decryptedPassword.strip(), ']'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment