【密码破解】随便做一个密码破解!!!(无解说警告)

import random
import time
import sys
start = time.time()
for i in range(10):
    p_w = [str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9))]
    p_w1 = p_w[0] 
    p_w2 = p_w[1]
    p_w3 = p_w[2]
    p_w4 = p_w[3]
    p_w5 = p_w[4]
    p_w6 = p_w[5]
    p_w = p_w1 + p_w2 + p_w3 + p_w4 + p_w5 + p_w6
    f = open("F:/python code/随机密码生成器/data.txt",'a')
    f.write(p_w+' ')
    print("=============\n==密码已生成=\n==已开始破解=\n=============\r")
    time.sleep(0.5)
    while True:
        for i in range(10):
            wp = [str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9))]
            wp1 = wp[0] 
            wp2 = wp[1]
            wp3 = wp[2]
            wp4 = wp[3]
            wp5 = wp[4]
            wp6 = wp[5]
            wp = wp1 + wp2 + wp3 + wp4 + wp5 + wp6
        if p_w == wp:
            print("破解成功!密码是"+str(p_w))
            f.close()
            end = time.time()
            print("耗时:"+str(end - start))
            sys.exit()
        else:
            print("暂未成功"+'\b'+"请稍等")

  

猜你喜欢

转载自www.cnblogs.com/scpgo/p/12439054.html