瀛楀吀鑴氭湰鍜孧D5鐖嗙牬鑴氭湰
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了瀛楀吀鑴氭湰鍜孧D5鐖嗙牬鑴氭湰相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/word' title='word'>word
adl hashlib ISE http key 寰幆鎺у埗 bre mic鏈€杩戝湪寮勭畝鍘嗗姞鍒嗛」锛屾墍浠ユ妸浠ュ墠鍐欒繃鐨勶紝閮藉湪寰€鍗氬鎼€傞毦椤躲€?/p>
杩欎釜鑴氭湰锛屾槸鎴戜互鍓嶅彂鐜板鏍″瘑鐮佹紡娲炵殑鏃跺€欙紝鍐欑殑銆?/p>
瀵嗙爜瀛楀吀锛?/p>
姣斿鎴戣繖涓€绾х殑瀵嗙爜锛屽氨鏄韩浠借瘉鍚庡叓浣嶏紝涓嬩竴绾э紝涓嬩笅涓€绾э紝瀵嗙爜铏界劧鏈夊彉鍖栵紝浣嗘槸涔熻繕鏄彲浠ュ湪杩欏熀纭€涓婃敼銆?/p>
#鐢熸垚0-10000000涔嬮棿鐨勬墍鏈夋暟鎹泦锛屽瓧绗︿覆闀垮害涓?锛岀敤0濉厖 list = [0,1000000,2000000,3000000, 4000000,5000000,6000000, 7000000,8000000,9000000,10000000] for i in range(10): a = "{0:02d}".format(i)#鐢熸垚瀛楃涓?0锛?1锛?..,10 l_str = str(a) + 鈥?/span>000000鈥?/span>#宸﹁竟瀛楃涓蹭负00000000,01000000,...,10000000 r_str = str(a) + 鈥?/span>999999鈥?/span>#鍙宠竟瀛楃涓蹭负00999999,01999999,...,19999999 filename = 鈥?/span>passwords鈥?/span>+鈥?/span>(鈥?/span>+l_str+鈥?/span>-鈥?/span>+r_str+鈥?/span>)鈥?/span>+鈥?/span>.txt鈥?/span>#鏂囦欢鍚峱asswords(00000000-00999999) with open(鈥?/span>E:/瀵嗙爜瀛?sise_passwords/鈥?/span>+filename,鈥?/span>w鈥?/span>) as file_to_read:#鍒涘缓txt鏂囦欢鏀惧湪“E:/瀵嗙爜瀛?sise_passwords/”鐨勭洰褰曚笅 if i <= 9:#鍒楄〃闀垮害鏄?0锛屼笅鏍囦粠0寮€濮嬶紝鍒?缁撴潫 for j in range(list[i],list[i+1]):#寰幆鎺у埗鏁版嵁杈撳叆 a = "{0:08d}".format(j)#瀛楃涓查暱搴︿负8锛屼笉瓒崇殑鐢?濉厖 file_to_read.write(a)#鏁版嵁鍐欏叆txt鏂囨。涓?/span> file_to_read.write(鈥?/span> 鈥?/span>)#姣忚緭鍑轰竴涓暟鎹埌txt涓紝灏辨崲琛屼竴娆?/span> file_to_read.close()#鍏抽棴
MD5鐖嗙牬
import os import hashlib values=input("瀵嗘枃鏄細")#MD5瀵嗘枃 with open(鈥?/span>E:/瀵嗙爜瀛?sise_passwords/passwords(08000000-08999999).txt鈥?/span>, 鈥?/span>r鈥?/span>) as file_to_read:#鎵撳紑瀛楀吀鏂囨湰 while True: line = file_to_read.readline()#璇诲彇鏂囨湰姣忎竴琛屾暟鎹?/span> if not line:#鍒ゆ柇璇诲彇鐨勬瘡琛屾暟鎹槸鍚︿负绌?/span> break passwords = line.strip(鈥?/span> 鈥?/span>)#鍒犻櫎鎹㈣绗?/span> key=hashlib.md5() key.update(passwords.encode(鈥?/span>utf-8鈥?/span>)) md5_test = key.hexdigest() if md5_test == values: print("鏄庢枃鏄細"+line)
澶т竴涓嬪鏈熸湡鏈殑鏃跺€欏啓鐨勶紝澶т浆鍕垮柗銆?/p>
以上是关于瀛楀吀鑴氭湰鍜孧D5鐖嗙牬鑴氭湰的主要内容,如果未能解决你的问题,请参考以下文章