This is a straightforward Python script designed to assess the strength of a password based on several common security criteria. It provides a score and helpful feedback to guide users in creating stronger passwords.
- ✅ Length Check: Evaluates password length and suggests improvements.
- ✅ Character Type Check: Verifies the presence of:
- Uppercase letters (A-Z)
- Lowercase letters (a-z)
- Numbers (0-9)
- Special characters (e.g., !, @, #)
- ✅ Weak Pattern Detection: Warns against simple, repetitive patterns like three or more consecutive identical characters (e.g., 'aaa', '111').
- ✅ Scoring System: Assigns a numerical score to the password, indicating its overall strength.
- ✅ User Feedback: Provides clear and actionable advice on how to make a password stronger.
- 📖 Features easy-to-understand Python code with simple English comments, making it great for beginners.
To run this tool, open your terminal or command prompt and navigate to the project directory.
🔧 Run from terminal:
python3 password_checker.py
Once the program starts, simply follow the on-screen prompts:
Enter a password to check.
Type q to quit the program.
Example Usage:
--- Password Strength Checker ---
Enter a password to check (or 'q' to quit): mypass
Password Strength: Very Weak (Score: 0)
Feedback:
- Password is too short. Aim for at least 8 characters, preferably 12+.
- Consider adding uppercase letters.
- Consider adding lowercase letters.
- Consider adding numbers.
- Consider adding special characters (e.g., !@#$%^&*).
------------------------------
Enter a password to check (or 'q' to quit): Password123
Password Strength: Strong (Score: 4)
Feedback:
- Password is a good length (12+ characters).
- Contains uppercase letters.
- Contains lowercase letters.
- Contains numbers.
- Consider adding special characters (e.g., !@#$%^&*).
------------------------------
Enter a password to check (or 'q' to quit): MyP@ssw0rd!
Password Strength: Very Strong (Score: 6)
Feedback:
- Password is a good length (12+ characters).
- Contains uppercase letters.
- Contains lowercase letters.
- Contains numbers.
- Contains special characters.
------------------------------
Enter a password to check (or 'q' to quit): q
Exiting Password Checker. Goodbye!
Requirements:
🐍 Python 3.x installed on your system.
🖥️ Basic familiarity with using a terminal/command line.
📚 What You'll Learn
Working with this project is an excellent way to grasp fundamental programming concepts and features:
🐍 Basic Python Programming: Understand functions, conditional statements (if/elif/else), and loops (while).
🧩 Regular Expressions (re module): Learn how to use simple regex patterns to validate string content (e.g., finding specific character types).
💡 Conditional Logic: Practice building logic to evaluate conditions and assign scores based on rules.
⌨️ User Input & Output: Learn how to take input from users and display structured output.
🚀 Future Enhancements (Ideas)
Consider these ideas to make this project more advanced:
📊 Entropy Calculation: Implement a function to calculate password entropy (unpredictability in bits) for a more scientific measure of strength.
🚫 Dictionary Attack Prevention: Add a feature to check if the password is a common word or part of a dictionary of leaked passwords.
🎨 Graphical User Interface (GUI): Create a visual interface using libraries like tkinter or PyQt for a more interactive experience.
📈 Visual Strength Meter: If you build a GUI, add a progress bar or color-coded indicator to visually represent strength.
🛠️👣 How to Try This Project (Step-by-Step)
If you'd like to run and experiment with this project on your own system, here's a simple guide:
Go to this project’s GitHub page.
Click the green “Code” button and then choose “Download ZIP”.
Extract the downloaded ZIP file to a folder on your computer.
Open your terminal (Command Prompt, PowerShell on Windows, or Terminal on Linux/macOS).
Navigate into the project folder using the cd command. For example:
cd path/to/your/password_strength_checker_project
(Remember to replace path/to/your/password_strength_checker_project with the actual path to the folder where you extracted the project.)
Verify Python installation by typing:
python3 --version
Run the script with the following command:
python3 password_checker.py
Note for Windows users: If python3 doesn't work, try running the script with just python: python password_checker.py.
⚠️ Disclaimer
This tool is created for educational purposes only.
It provides feedback on password characteristics but does not guarantee real-world security against all types of attacks.
True password security involves more complex measures like multi-factor authentication (MFA) and robust storage practices.