-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpass.py
86 lines (72 loc) · 2.05 KB
/
pass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
list=[]
names=[]
temp_names=[]
phoneNo=''
dob=input("Date of birth(DDMMYYYY):")
if(len(dob)==8):
day=dob[:2]
month=dob[2:4]
year=dob[4:]
else:
print("Wrong format for DOB, make sure it is 8 numbers in DDMMYYYY")
exit()
phoneNo=input("Enter phone no:")
def ListOfImportantWords():
names.append(input("First name:"))
names.append(input("Surname:"))
names.append(input("Nickname:"))
print("\n")
names.append(input("Partners name:"))
names.append(input("Partners Nickname:"))
print("\n")
names.append(input("Pets name:"))
names.append(input("Company name:"))
print("\n")
names.append(input("Childs name:"))
names.append(input("Childs nickname:"))
print("\n")
names.append(input("City:"))
names.append(input("Country:"))
names.append(input("Favourite colour:"))
print("Enter all other keywords: ")
while True:
inp = input()
if inp == '':
break
names.append(inp)
while('' in names) :
names.remove('')
def permute(inp):
n = len(inp)
mx = 1 << n
inp = inp.lower()
for i in range(mx):
combination = [k for k in inp]
for j in range(n):
if (((i >> j) & 1) == 1):
combination[j] = inp[j].upper()
temp = ""
for i in combination:
temp += i
temp_names.append(temp)
def WordListCreator(list):
for word in names:
for i in range(0,len(word)+1):
list.append(word[:i]+day+word[i:])
list.append(word[:i]+month+word[i:])
list.append(word[:i]+year+word[i:])
if len(year)==4:
list.append(word[:i]+year[2:]+word[i:])
list.append(word[:i]+phoneNo+word[i:])
if not phoneNo=='':
list.append(phoneNo)
def WriteToFile(list):
with open('wordlist.txt', 'w') as f:
for item in list:
f.write("%s\n" % item)
ListOfImportantWords()
for i in names:
permute(i)
names=names+temp_names
WordListCreator(list)
WriteToFile(list)