- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassword_Checker.py
More file actions
Latest commit
49 lines (42 loc) · 1.54 KB
/
Copy pathPassword_Checker.py
File metadata and controls
49 lines (42 loc) · 1.54 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
# Program to check the strength of passwords
# Requested by: Teacher
#Author: Student
#Date written: 25/8/2023
#Date tested and approved: 25/8/2023
# Revision History:
importgetpass
fromcoloramaimportFore
counter_upper=0#Upper
counter_lower=0#Lower
counter_digit=0#digits
counter_length=0#length
print(Fore.MAGENTA+'''$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n
\tWelcome to The Shadow Wizard Password Checker\n
\t\t\t -We love checking passwords-⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n''')
#user input will be obscured for privacy reasons + whitespace stripped
entered_password=getpass.getpass(Fore.WHITE+"What password you'd like to check?\n")
test_password=entered_password.rstrip()
#print(entered_password)
#Password length checker
counter_length=(len(test_password))
#Counting each required metric
foreintest_password:
if(e.isupper()) isTrue:
counter_upper+=1
elif(e.islower()) isTrue:
counter_lower+=1
elif (e.isdigit()) isTrue:
counter_digit+=1
#Print out password statistics, can be commented out to hide this info
print("Your password contains: ")
print("Uppercase -", counter_upper)
print("Lowercase -", counter_lower)
print("Digits -", counter_digit)
print("Length -", counter_length)
#Final results
ifcounter_upper<2orcounter_lower<2orcounter_digit<2orcounter_length<14orcounter_length>25:
print(Fore.RED+"\nPassword is not strong enough - please revise")
else:
print(Fore.GREEN+"\nPassword is strong enough.")