标签:
下载安装PyCrypto 2.6 for Python 2.7
http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe
1 from Crypto.Cipher import DES 2 from hashlib import md5 3 4 key = ‘\x47\x8D\xA5\x0B\xF9\xE3\xD2\xCF‘ 5 crypto = DES.new( key, DES.MODE_ECB ) 6 7 data = open(‘config.bin‘, ‘rb‘).read() 8 data_decrypted = crypto.decrypt( data ).rstrip(‘\0‘) 9 assert data_decrypted[:16] == md5(data_decrypted[16:]).digest() 10 open(‘config.bin.txt‘, ‘wb‘).write(data_decrypted[16:])
标签:
原文地址:http://www.cnblogs.com/purelandbb/p/4476891.html