A sophisticated, real-time password security analysis tool built with FastAPI and modern web technologies. Provides comprehensive password strength assessment with detailed vulnerability detection and actionable recommendations.
- Real-time Analysis: Instant feedback as you type
- Entropy Calculation: Shannon entropy-based strength measurement
- Pattern Detection: Identifies keyboard patterns, sequential characters, dates, and more
- Crack Time Estimation: Calculates resistance to brute-force attacks (1 trillion guesses/sec)
- Vulnerability Detection: Checks for common passwords, weak patterns, and character variety
- Character Analysis: Detailed breakdown of uppercase, lowercase, digits, and special characters
- Actionable Recommendations: Specific suggestions to improve password strength
- Modern UI: Beautiful dark theme with smooth animations and responsive design
- Privacy-First: All analysis happens locally in the browser—no passwords sent to server
- Python 3.8 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/yourusername/password-analyzer.git
cd password-analyzer- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtStart the server:
python main.pyThe application will be available at http://localhost:8000
POST /api/analyze
Content-Type: application/json
{
"password": "YourPasswordHere!"
}
Response:
{
"password_length": 15,
"strength_score": 85,
"strength_label": "Very Strong",
"entropy": 94.5,
"character_types": {
"has_uppercase": true,
"has_lowercase": true,
"has_digits": true,
"has_special": true,
"uppercase_count": 1,
"lowercase_count": 10,
"digit_count": 2,
"special_count": 2
},
"patterns": {
"sequential_chars": false,
"repeated_chars": false,
"keyboard_pattern": false,
"date_pattern": false,
"email_pattern": false,
"username_pattern": false
},
"vulnerabilities": [],
"time_to_crack": {
"time": "125.3 years",
"guesses_per_second": "1 trillion"
},
"recommendations": [
"Your password is excellent! Keep it secure."
]
}GET /api/health
- Very Strong (80-100): Excellent password, highly resistant to attacks
- Strong (60-79): Good password with solid security
- Moderate (40-59): Acceptable but could be improved
- Weak (20-39): Poor security, needs improvement
- Very Weak (0-19): Insufficient security
Measures password complexity using Shannon entropy. Higher entropy indicates greater randomness and security.
Identifies common security weaknesses:
- Sequential characters (abc, 123)
- Repeated characters
- Keyboard patterns (qwerty, asdfgh)
- Date formats (1990, 12/25)
- Email patterns
- Username-like patterns
- Password length < 8 characters
- Common passwords (top 1000 most used)
- Keyboard patterns
- Excessive repetition
- Sequential characters
- Insufficient character variety
- Framework: FastAPI (async Python web framework)
- Server: Uvicorn (ASGI server)
- Analysis Engine: Custom PasswordAnalyzer class
- HTML5: Semantic markup
- CSS3: Modern styling with CSS Grid, Flexbox, and animations
- JavaScript: Vanilla JS with async/await
- Icons: SVG inline icons
The strength score is calculated based on:
- Length Score: Up to 25 points based on password length
- Character Variety: Up to 60 points for having uppercase, lowercase, digits, and special characters
- Entropy Score: Up to 20 points based on Shannon entropy calculation
- Vulnerability Penalties: -10 points per detected vulnerability
- Passwords are analyzed in the browser before transmission
- No passwords are stored or logged on the server
- All analysis is deterministic and reproducible
- CORS enabled for cross-origin requests
- No external API calls for password checking (entirely self-contained)
password-analyzer/
├── main.py # FastAPI application
├── analyzer.py # Core password analysis engine
├── requirements.txt # Python dependencies
├── static/
│ ├── index.html # Frontend HTML
│ ├── style.css # Styling and animations
│ └── script.js # Client-side logic
└── README.md # This file
- Analysis completes in < 1ms per password
- Handles concurrent requests efficiently with async processing
- Minimal memory footprint
- No external dependencies for core analysis
Contributions are welcome! Feel free to:
- Report bugs
- Suggest improvements
- Add new pattern detection
- Improve UI/UX
MIT License - feel free to use this project for personal or commercial purposes.
This tool provides analysis for educational and informational purposes. While the analysis is based on industry-standard security principles, no password is 100% secure. Always follow best practices:
- Use unique passwords for important accounts
- Enable two-factor authentication
- Use a password manager
- Keep software and systems updated