基於python的密碼字典生成器


最近在網上看到一些作品,然后對其進行了一些完善。只是用於學習,不要去干壞事哦。程序來源於網絡,我只是做了一些優化。



#!/usr/bin/python
# -*- coding:utf-8 -*-
# @Time :2019/10/7 10:55
# @Author :maple
# @Emall :1075495040@qq.com
# @File :密碼字典4.py


import itertools as its
words = input("請輸入想要生成的數字、字母、特殊符號:").strip()
word1 = input("請輸入前面的固定字符,若沒有直接enter:").strip()
word2 = input("請輸入后面的固定字符,若沒有直接enter:").strip()
len = int(input("請輸入密碼的長度,不包含前面和后面的固定字符:"))
words = set(words) #去重
words = ''.join(words) #拼接
#print(words)
r = its.product(words,repeat=len)
dic = open("dictionary.txt",'a')
for i in r:
dic.write(word1+''.join(i)+word2+"\n")
dic.close()


免責聲明!

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



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