utils: use triple DES to decode LTPA key

This commit is contained in:
Benjamin Dauvergne 2014-03-10 16:19:58 +01:00
parent ae42823860
commit 4343670cea
1 changed files with 2 additions and 2 deletions

View File

@ -106,11 +106,11 @@ def main():
print 'Creation timestamp:', from_timestamp(creation)
print 'Expire timestamp:', from_timestamp(expire)
elif args.command == 'decryptkey':
from pyDes import des, ECB, PAD_PKCS5
from pyDes import triple_des, ECB, PAD_PKCS5
content = file(args.file).read()
key = hashlib.sha1(args.password).digest() + '\x00' * 4
k = des(key, ECB, padmode=PAD_PKCS5)
k = triple_des(key, ECB, padmode=PAD_PKCS5)
print 'hex:' + k.decrypt(content).encode('hex')
if __name__ == '__main__':