Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.