Pythonchallenge Level 18 (python 2.7)

本文介绍了一种通过分析两张图片的亮度差异来提取隐藏信息的方法。具体步骤包括下载并解压包含图片亮度差异的数据集,使用Python进行数据处理,通过对比原始数据生成三张图片以展示增加、减少及不变的部分,并从中提取用户名、密码等信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

the difference between these two images are brightness level, hence go to the 'brightness.html'
download 'delta.gz' and unzip the file
look into the dataset, the regular stuff would come out...

>>> import gzip
>>> f=gzip.open('/home/****/Downloads/deltas.gz')
>>> data=f.read()
>>> data=data.splitlines()
>>> import difflib
>>> left=[]
>>> right=[]
>>> for row in data:
left.append(row[0:53])
right.append(row[56:])
>>> diff=list(difflib.ndiff(left,right))
>>> add_data=['']
>>> minus_data=['']
>>> space_data=['']
>>> for temp in diff:
s=temp[0:1]
t=[]
for b in temp[2:].split():
t.append(chr((int(b,16))))
n.append(s)
if s=='+':
add_data[0]+=''.join(t)
elif s=='-':
minus_data[0]+=''.join(t)
else:
space_data[0]+=''.join(t)
>>> open('add.png','wb').write(add_data[0])
>>> open('minus.png','wb').write(minus_data[0])
>>> open('space.png','wb').write(space_data[0])


the username is 'butter' password is 'fly' and the url is '../hex/bin.html'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值