├── README.md └── task-03.py /README.md: -------------------------------------------------------------------------------- 1 | **Title** 2 | 3 | *Password Complexity Checker* 4 | 5 | **Description** 6 | 7 | This Python program helps you assess the strength of your passwords based on common security best practices. It considers factors like length, character variety, and special characters to provide informative feedback. 8 | 9 | **Using the Tool** 10 | 11 | 1. **Save the code:** 12 | - Save this code as a Python file (e.g., `password_checker.py`). 13 | 14 | 2. **Run the script:** 15 | - Open your terminal and navigate to the directory where you saved the script. 16 | - Execute the script using the following command: 17 | 18 | ```bash 19 | python password_checker.py 20 | ``` 21 | 22 | 3. **Enter your password:** 23 | - The program will prompt you to enter your password. 24 | - **Important:** The password you enter will be displayed on your screen. Be mindful of running this script in public or around others. 25 | 26 | 4. **Get your feedback:** 27 | - The program will analyze your password and provide feedback on its strength, categorized as "Strong password," "Good password," or "Weak password." 28 | 29 | **Password Strength Guidelines** 30 | 31 | - Strong passwords are generally considered to be at least 12 characters long and include a combination of uppercase and lowercase letters, numbers, and special characters. 32 | - This program serves as a basic guide and may not encompass all security considerations. 33 | 34 | **Remember:** 35 | 36 | - Avoid using personal information or easily guessable words in your passwords. 37 | - Consider using a password manager to generate and store strong, unique passwords for different accounts. 38 | 39 | **Disclaimer** 40 | 41 | This program is for educational purposes only and does not guarantee the absolute security of your passwords. 42 | 43 | **License** 44 | 45 | This project is licensed under the MIT License. 46 | 47 | **Feel free to use this code for learning and experimentation!** -------------------------------------------------------------------------------- /task-03.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | def password_complexity_checker(password): 4 | 5 | # Check length 6 | 7 | length_score = len(password) >= 8 8 | 9 | # Check for uppercase letters 10 | 11 | uppercase_score = bool(re.search(r'[A-Z]', password)) 12 | 13 | # Check for lowercase letters 14 | 15 | lowercase_score = bool(re.search(r'[a-z]', password)) 16 | 17 | # Check for numbers 18 | 19 | number_score = bool(re.search(r'[0-9]', password)) 20 | 21 | # Check for special characters 22 | 23 | special_char_score = bool(re.search(r'[!@#$%^&*(),.?":{}|<>]', password)) 24 | 25 | # Calculate total score 26 | 27 | total_score = length_score + uppercase_score + lowercase_score + number_score + special_char_score 28 | 29 | # Provide feedback based on total score 30 | 31 | if total_score == 5: 32 | return "Strong password" 33 | elif total_score >= 3: 34 | return "Good password" 35 | else: 36 | return "Weak password" 37 | 38 | password = input("Enter your password: ") 39 | strength = password_complexity_checker(password) 40 | print(f"Password strength: {strength}") 41 | --------------------------------------------------------------------------------