CRC32爆破
CRC它的全称是循环冗余校验(Cyclic Redundancy Check, CRC),用来校验文件是否出错但并不能用于自动纠错。对于字节数小的文件完全可以对CRC进行爆破获得其内容。
crc32
python crc32.py reverse 0x你的crc32密文
python crc32.py reverse 0x308e1d5b
python crc32.py reverse 0x5194c2d0
python crc32.py reverse 0x5c48f6ca
{0x36, 0x34, 0x70, 0x32,0x40, 0x73, 0x77, 0x6f, 0x72, 0x44, 0x32, 0x30} == 64p2@sworD20
爆破脚本:
import binascii
def str2num(s):
return int(s, 16)
dic = '''abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~'''
crc1 = str2num("308E1D58")
crc2 = str2num("5194C2D0")
crc3 = str2num("5C48F6CA")
for x in dic:
for a in dic:
for b in dic:
for c in dic:
str = x + a + b + c
str_crc = binascii.crc32(str) & 0xffffffff
if (str_crc == crc1):
pass1 = str
if (str_crc == crc2):
pass2 = str
if (str_crc == crc3):
pass3 = str
print("pass:",pass1+pass2+pass3)