From a7b94eed40925973da5136e8214b4b1588952364 Mon Sep 17 00:00:00 2001 From: SHEEFANIGAR Date: Fri, 10 Oct 2025 21:25:50 +0530 Subject: [PATCH] Added Password Strength Checker project in Python --- Python/PasswordStrengthChecker/README.md | 50 +++++++++++++++++++ .../password_strength_checker.py | 30 +++++++++++ 2 files changed, 80 insertions(+) create mode 100644 Python/PasswordStrengthChecker/README.md create mode 100644 Python/PasswordStrengthChecker/password_strength_checker.py diff --git a/Python/PasswordStrengthChecker/README.md b/Python/PasswordStrengthChecker/README.md new file mode 100644 index 0000000..0c7b64d --- /dev/null +++ b/Python/PasswordStrengthChecker/README.md @@ -0,0 +1,50 @@ +\# 🔐 Password Strength Checker (Python) + + + +A simple Python tool that helps users test the strength of their passwords 💪 + +Perfect for beginners learning string manipulation and regular expressions. + + + +\## 💡 Features + +\- Checks if a password meets essential security standards: + +  - Minimum 8 characters + +  - Contains uppercase and lowercase letters + +  - Includes at least one number + +  - Includes at least one special symbol (`@, $, !, %, \*, ?, \&`) + +\- Provides feedback as: + +  - \*\*Strong 💪\*\* + +  - \*\*Moderate 👍\*\* + +  - \*\*Weak ⚠️\*\* + + + +\## 🧠 Concepts Used + +\- Regular Expressions (`re` module) + +\- Conditional Statements + +\- Loops and User Input + + + +\## ▶️ How to Run + +```bash + +python password\_strength\_checker.py + + + diff --git a/Python/PasswordStrengthChecker/password_strength_checker.py b/Python/PasswordStrengthChecker/password_strength_checker.py new file mode 100644 index 0000000..d57b8c2 --- /dev/null +++ b/Python/PasswordStrengthChecker/password_strength_checker.py @@ -0,0 +1,30 @@ +import re + +def check_password_strength(password): + # Criteria checks + length_error = len(password) < 8 + digit_error = re.search(r"\d", password) is None + uppercase_error = re.search(r"[A-Z]", password) is None + lowercase_error = re.search(r"[a-z]", password) is None + symbol_error = re.search(r"[@$!%*?&]", password) is None + + # Count how many conditions failed + errors = sum([length_error, digit_error, uppercase_error, lowercase_error, symbol_error]) + + if errors == 0: + return "Strong 💪" + elif errors <= 2: + return "Moderate 👍" + else: + return "Weak ⚠️" + +if __name__ == "__main__": + print("🔐 Password Strength Checker") + print("Your password should include uppercase, lowercase, digits, and special symbols.\n") + + while True: + pwd = input("Enter a password (or type 'exit' to quit): ") + if pwd.lower() == 'exit': + print("Goodbye! 👋") + break + print(f"Password strength: {check_password_strength(pwd)}\n")