Skip to content

Commit dfd7bf6

Browse files
Password Strength checker script added
1 parent 08b7bdd commit dfd7bf6

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

Password_Strength_checker/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Password Strength Checker
2+
3+
This is a simple Python script that evaluates the strength of a password based on complexity and security. It checks for various criteria like length, presence of uppercase letters, lowercase letters, digits, and special characters.
4+
5+
## How to Use
6+
7+
1. Run the `password_strength_checker.py` script in your Python environment.
8+
2. You will be prompted to enter a password for evaluation.
9+
3. The script will check the password against the following criteria:
10+
- At least 8 characters in length.
11+
- Contains at least one uppercase letter.
12+
- Contains at least one lowercase letter.
13+
- Contains at least one digit.
14+
- Contains at least one special character (e.g., '@', '_', '!', '#', '$', '%', '^', '&', '*', '(', ')', '<', '>', '?', '/', '|', '}', '{', '~', ':').
15+
4. Based on the criteria, the script will provide feedback on whether the password is strong or weak.
16+
17+
## Criteria for a Strong Password
18+
19+
To be considered a strong password, the password must meet all of the following conditions:
20+
1. Be at least 8 characters in length.
21+
2. Contain at least one uppercase letter.
22+
3. Contain at least one lowercase letter.
23+
4. Contain at least one digit.
24+
5. Contain at least one special character.
25+
26+
## How to Run
27+
28+
To use the Password Strength Checker, simply execute the `password_strength_checker.py` file using your Python environment.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import re
2+
3+
def is_strong_password(password):
4+
# Check length (at least 8 characters)
5+
if len(password) < 8:
6+
return False
7+
8+
# Check for uppercase letters
9+
if not any(char.isupper() for char in password):
10+
return False
11+
12+
# Check for lowercase letters
13+
if not any(char.islower() for char in password):
14+
return False
15+
16+
# Check for digits
17+
if not any(char.isdigit() for char in password):
18+
return False
19+
20+
# Check for special characters
21+
special_chars = re.compile('[@_!#$%^&*()<>?/\|}{~:]')
22+
if not special_chars.search(password):
23+
return False
24+
25+
return True
26+
27+
def main():
28+
password = input("Enter your password: ")
29+
30+
if is_strong_password(password):
31+
print("Strong password! Good job.")
32+
else:
33+
print("Weak password. Please make it stronger.")
34+
35+
if __name__ == "__main__":
36+
main()

0 commit comments

Comments
 (0)