2020-11-25 10:33:02 +00:00
|
|
|
from itertools import combinations
|
|
|
|
|
|
|
|
def clean_input(txt):
|
2020-11-25 10:47:06 +00:00
|
|
|
txt = str(txt).replace(" ","").lower()
|
2020-11-25 10:33:02 +00:00
|
|
|
return txt
|
|
|
|
|
|
|
|
def extract_date(txt):
|
|
|
|
dd = txt[0:2]
|
|
|
|
mm = txt[2:4]
|
|
|
|
yyyy = txt[4:]
|
|
|
|
yy = yyyy[-2:]
|
|
|
|
return dd,mm,yyyy,yy
|
|
|
|
|
|
|
|
def capi(x):
|
|
|
|
x2 = x.capitalize()
|
|
|
|
if x==x2:
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
return x2
|
|
|
|
|
|
|
|
def allcaps(x):
|
|
|
|
x2 = x.upper()
|
|
|
|
if x==x2:
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
return x2
|
|
|
|
|
|
|
|
firstName = clean_input(input("First Name: "))
|
|
|
|
lastName = clean_input(input("Last Name: "))
|
2020-11-25 10:48:48 +00:00
|
|
|
middleName = clean_input(input("Middle Name (or second last name): "))
|
2020-11-25 10:47:06 +00:00
|
|
|
nickName = clean_input(input("Nick Name: "))
|
2020-11-25 10:33:02 +00:00
|
|
|
birthDate = clean_input(input("Birth Date (DDMMYYYY): "))
|
|
|
|
day,month,year_long,year_short = extract_date(birthDate)
|
|
|
|
birthDate = day+month+year_short
|
|
|
|
long_birthDate = day+month+year_long
|
|
|
|
petName = clean_input(input("Pet's Name: "))
|
|
|
|
otherKeywords = clean_input(input("Enter other keywords separated by commas: ")).split(",")
|
|
|
|
|
|
|
|
data = [firstName, lastName, nickName, middleName, day, month, year_short, year_long, birthDate, long_birthDate, petName]
|
|
|
|
data = data+otherKeywords
|
|
|
|
|
|
|
|
for x in data:
|
|
|
|
if capi(x):
|
|
|
|
data = data+[capi(x)]
|
|
|
|
|
|
|
|
for x in data:
|
|
|
|
if allcaps(x) and allcaps(x) not in data:
|
|
|
|
data = data+[allcaps(x)]
|
|
|
|
|
|
|
|
comb = combinations(data, 3)
|
|
|
|
|
|
|
|
passwords = [x[0]+x[1]+x[2] for x in comb]
|
|
|
|
total_pass = len(passwords)
|
|
|
|
|
|
|
|
fname = firstName + ".txt"
|
|
|
|
out = open(fname, "w")
|
|
|
|
for x in passwords:
|
|
|
|
out.write(x+'\n')
|
|
|
|
out.close()
|
|
|
|
|
|
|
|
print(f"Total generated passwords: {total_pass}")
|