-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionaryAttack.py
More file actions
71 lines (66 loc) · 1.48 KB
/
Copy pathdictionaryAttack.py
File metadata and controls
71 lines (66 loc) · 1.48 KB
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
#open dictionary into var
dopen = open("dictAttack.txt", "r")
dictList = dopen.readlines()
dopen.close()
#store pw input as var
bday=input("What's your birth year? ")
year=input("What year is it? ")
pw = input("Let's test your password! Type it in: ")
#strip pw, lower case it
pwClean = pw.strip().lower()
print(pwClean)
#for loop
x=0
weak=0
length=len(dictList)
word=0
yrList=[]
yearfind=0
year1=int(year)
bday1=int(bday)
for bday1 in range(bday1, year1+1):
yrList.append(bday1)
bday1+=1
#finds if identifiable
for i in dictList:
n=0
iClean=dictList[n].strip().lower()
if iClean in pwClean:
weak+=1
word+=1
print(n)
print(weak)
print(word)
iNew=iClean+yrList[n]
if iNew in pwClean:
weak+=1
yearfind+=1
print(weak)
print(yearfind)
else:
iNew=iClean+str(yrList[n])
print(iNew)
if iNew in pwClean:
weak+=1
yearfind+=1
print(weak)
print(yearfind)
else:
x+=1
print(x)
print(n)
print(x)
print(weak)
print(word)
print(yearfind)
if yearfind>0:
print("We found this year in your password")
#if bdayfind>0:
#print("We found your birth year in your password")
if word>0:
print("We found ",word," words in your password.")
if weak > 0:
print("Weak password! :( ")
if x >= length:
print('Fantastic password! :)')
#if loop to compare to dictionary(stripped, lower)