utils: use triple DES to decode LTPA key
This commit is contained in:
parent
ae42823860
commit
4343670cea
|
@ -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__':
|
||||
|
|
Reference in New Issue