python MD5值破解


from hashlib import md5
from string import ascii_letters,digits,punctuation
from itertools import permutations
from time import time
#生成暴力破解口令集 all_letters
=ascii_letters+digits+punctuation+'.,;' def decrypt_md5(md5_value): if len(md5_value)!=32: print('不是有效的md5值') return md5_value=md5_value.lower() for item in permutations(all_letters,5):#全排列 item=''.join(item) # print(item) if md5(item.encode()).hexdigest()==md5_value: return item md5_value ='f7db3262ba19e2c1dcdaeefe69c688a1' start=time() result=decrypt_md5(md5_value) if result: print('\n Success: '+md5_value+'==>'+result) print('Time used:',time()-start)

運行結果:

Success: f7db3262ba19e2c1dcdaeefe69c688a1==>abc6F
Time used: 0.005983591079711914


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM