A cybersecurity-based Password Strength Analyzer developed using Python. This project analyzes password strength using multiple security parameters such as password length, uppercase letters, lowercase letters, numbers, and special characters. It also implements SHA-256 hashing, password reuse prevention, common password detection, crack-time estimation, and strong password generation.
I made this project/tool available in two versions:
- MySQL Database Version
- File-Based Version (stores password hashes in a text file)
This project was built to understand real-world authentication systems, password security policies, secure password storage, and cybersecurity best practices.
The main objective of this project is to:
- Detect weak passwords
- Encourage strong password creation
- Prevent password reuse
- Improve authentication security
- Demonstrate secure coding practices
- Understand cybersecurity concepts practically
Checks password based on:
- Length
- Uppercase letters
- Lowercase letters
- Numbers
- Special characters
Passwords are converted into SHA-256 hashes before storage for better security.
The system prevents users from reusing previously used passwords.
Detects weak/common passwords such as:
- 123456
- password
- admin
- qwerty
- admin@123
- 111111
- 1234567890
using common_passwords.txt.
Provides estimated password cracking time:
- Few seconds
- Few days
- Hundreds of years
If the password is weak or medium, the system generates a strong random password suggestion.
| Technology | Purpose |
|---|---|
| Python | Main Programming Language |
| MySQL | Database Storage |
| Regex | Password Validation |
| SHA-256 | Password Hashing |
| mysql-connector-python | MySQL Connectivity |
PasswordStrengthAnalyzer/
│
├── Outcomes/
├── PSA_with_db.py
├── PSA_without_db.py
├── common_passwords.txt
├── password_hashes.txt
└── README.mdThe user enters a password.
The program checks:
- Password length
- Uppercase letters
- Lowercase letters
- Numbers
- Special characters
Rule Score
- Length ≥ 8 +1
- Uppercase Letter +1
- Lowercase Letter +1
- Number +1
- Special Character +1
Checks whether the password exists in: common_passwords.txt
The password is hashed using SHA-256 algorithm.
-
MySQL Version Stores password hashes inside MySQL database.
-
File-Based Version Stores password hashes inside: password_hashes.txt
The system checks whether the password hash already exists.
Displays:
- Weak Password
- Medium Password
- Strong Password
along with estimated crack time.
| Concept | Description |
|---|---|
| Authentication Security | Password-based authentication |
| SHA-256 Hashing | Secure password hashing |
| Password Policies | Strong password enforcement |
| Secure Storage | Store hashes instead of passwords |
| Regex Validation | Input validation |
| Password Reuse Prevention | Prevent old password reuse |
| Secure Coding | Defensive coding practices |
SHA-256 is used because:
- Passwords are not stored in plain text
- Improves security
- Prevents direct password exposure
- Commonly used hashing algorithm
I never upload:
- Real passwords
- API keys
- Personal credentials
- Sensitive information
Manjeet Kumar
Cyber Security Student