Skip to content

Commit fc6a5b9

Browse files
authored
Merge pull request #13 from offgridmode/Password_Strength_Checker
Added Password Strength Checker
2 parents df60b3e + 467b1d2 commit fc6a5b9

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Password Strength Checker
2+
3+
## Description
4+
This is a simple Python script that checks whether a password is strong or weak based on common password security rules.
5+
6+
## Features
7+
The program checks if the password contains:
8+
9+
- Minimum 8 characters
10+
- At least one uppercase letter
11+
- At least one lowercase letter
12+
- At least one digit
13+
- At least one special character
14+
15+
## Technologies Used
16+
- Python
17+
- String methods
18+
- Conditional statements
19+
- Loops
20+
21+
## How to Run
22+
23+
1. Open terminal in the project folder
24+
2. Run the script in python environment
25+
3. Enter the desired Password to check its strength
26+
4. The script will classify the password as Strong or Weak.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
password = input("Enter your password: ")
2+
3+
has_upper = False
4+
has_lower = False
5+
has_digit = False
6+
has_special = False
7+
8+
for char in password:
9+
10+
if char.isupper():
11+
has_upper = True
12+
13+
elif char.islower():
14+
has_lower = True
15+
16+
elif char.isdigit():
17+
has_digit = True
18+
19+
elif not char.isalnum():
20+
has_special = True
21+
22+
23+
if len(password) >= 8 and has_upper and has_lower and has_digit and has_special:
24+
25+
print("Strong Password")
26+
27+
else:
28+
29+
print("Weak Password")
30+

0 commit comments

Comments
 (0)