41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from PySide2.QtCore import *
|
|
def genPassword(j):
|
|
length = 32
|
|
char = 0
|
|
if char == 0:
|
|
charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&*()_-+={}[]|:;<>,.?'
|
|
else:
|
|
if char == 1:
|
|
charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
|
else:
|
|
if char == 2:
|
|
charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'
|
|
else:
|
|
pass
|
|
try:
|
|
|
|
qsrand(j)
|
|
password = ''
|
|
for i in range(length):
|
|
idx = qrand() % len(charset)
|
|
nchar = charset[idx]
|
|
password += str(nchar)
|
|
return password
|
|
except:
|
|
print('error')
|
|
def gen_possible_passes():
|
|
passes = []
|
|
j = -999
|
|
while True:
|
|
ps = genPassword(j)
|
|
if ps not in passes:
|
|
passes.append(ps)
|
|
print(len(passes))
|
|
#print(ps)
|
|
if ps == 'YG7Q7RDzA+q&ke~MJ8!yRzoI^VQxSqSS':
|
|
break
|
|
j += 1
|
|
with open('pass.txt', 'w') as ofile:
|
|
for p in passes:
|
|
ofile.write(p + '\n')
|
|
gen_possible_passes() |