Python简单的CTF题目hash碰撞小脚本

Python简单的CTF题目hash碰撞小脚本


import hashlib

for num in range(10000,9999999999):
    res = hashlib.sha1(str(num).encode()).hexdigest() #sha1改为题目需要的算法
    if res[0:5] == "903ed":   #对hash的前五位为"903ed"的数字进行碰撞
        print(str(num)) #等待执行结束 输出结果
        break

 

posted @ 2019-09-06 21:16  我超怕的  阅读(2228)  评论(0编辑  收藏  举报