A web application that analyzes password strength and checks if passwords have been compromised in data breaches using the Have I Been Pwned API.
- Password Strength Analysis: Evaluates passwords based on length, character variety, and complexity
- Breach Detection: Checks if passwords have been found in known data breaches using the Have I Been Pwned API
- Real-time Feedback: Provides instant visual feedback on password strength and security status
- Clean UI: Simple, responsive web interface for easy password analysis
The application uses a multi-layered approach to password analysis:
-
Strength Evaluation: Analyzes password characteristics including:
- Length (minimum 8 characters recommended)
- Presence of uppercase letters
- Presence of lowercase letters
- Presence of numbers
- Presence of special characters
-
Breach Checking: Uses the Have I Been Pwned API to check if the password has been compromised in known data breaches
-
Visual Feedback: Provides color-coded strength indicators and breach warnings
- Python 3.7 or higher
- pip (Python package installer)
- Clone the repository:
git clone <repository-url>
cd pw_strength_analyzer
- Install required dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- Open your web browser and navigate to
http://localhost:5000
- Enter a password in the input field
- Click the "Analyze" button
- View the results:
- Strength Meter: Shows password strength (Weak/Moderate/Strong) with color coding
- Breach Warning: Indicates if the password has been found in data breaches
- Strong (Green): 12+ characters with uppercase, lowercase, numbers, and special characters
- Moderate (Orange): 8+ characters with basic character variety
- Weak (Red): Less than 8 characters or missing character variety
GET /
: Main application pagePOST /analyze
: Analyzes password strength and checks for breaches- Request body:
{"password": "your_password"}
- Response:
{"breached": boolean, "breach_count": number, "strength": string, "strengthColor": string}
- Request body:
- Privacy-Focused: Passwords are processed securely using SHA-1 hashing for breach checking
- No Storage: Passwords are not stored or logged
- API Integration: Uses the secure Have I Been Pwned API for breach detection
The application is configured for deployment on platforms like Heroku with the included Procfile
:
web: python app.py
- Flask 3.0.3 - Web framework
- requests 2.32.3 - HTTP library for API calls
- Standard Python libraries (hashlib, os, re)
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.
This tool is for educational and personal use. Always follow best practices for password security and consider using a password manager for generating and storing strong, unique passwords.