python 穷举
import random
def getpwd(ab,num): if num==1: for x in ab: yield x else: for x in ab: for y in getpwd(ab,num-1): yield x+y
from itertools import product from time import sleep from tqdm import tqdm #密码生成器 def psgen(x=1): iter = ['1234567890e'] #ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz for r in iter: for repeat in range(x,x+1): for ps in product(r,repeat=repeat): yield ''.join(ps) print(ps) sum=0 s="123123e" #要破解的口令 print("wait...") for ps in tqdm(psgen(len(s))): #多少位 sum+=1 if(ps==s): print("破解成功!密码为:"+ps) break print("计算了"+str(sum)+"次") print("完成!")