图片隐写解密脚本_长宽隐写
import binasciiimport struct
import sys
file = '图片.png'
fr = open(file,'rb').read() #以二进制来读取文件
data = bytearray(fr) #图片的信息,从IHDR到crc前
crc32key = eval('0x'+str(binascii.b2a_hex(fr)))
n = 4095
for w in range(n):
width = bytearray(struct.pack('>i', w))
for h in range(n):
height = bytearray(struct.pack('>i', h))
for x in range(4):
data = width
data = height
crc32result = binascii.crc32(data) & 0xffffffff
if crc32result == crc32key:
print(width,height)
newpic = bytearray(fr)
for x in range(4):
newpic = width
newpic = height
fw = open(file+'.png','wb')
fw.write(newpic)
fw.close
sys.exit()
页:
[1]