Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 20bd563

Browse files
Merge pull request avinashkranjan#2329 from andoriyaprashant/branch1
Password Strength checker script added
2 parents ac38a1f + dfd7bf6 commit 20bd563

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)

AltStyle によって変換されたページ (->オリジナル) /