A comprehensive password security toolkit featuring advanced strength analysis, secure password generation, and educational password management. Perfect for learning about password security and cryptographic best practices.
- Advanced Strength Scoring - Multi-factor analysis (length, complexity, patterns)
- Entropy Calculation - Shannon entropy measurement in bits
- Crack Time Estimation - Realistic brute-force attack timeline
- Pattern Detection - Identifies weak patterns (sequences, keyboard patterns, repetitions)
- Common Password Database - Checks against known weak passwords
- Detailed Feedback - Actionable suggestions for improvement
- Secure Random Generation - Uses Python's
secretsmodule (cryptographically secure) - Customizable Options - Control length, character types, ambiguous characters
- Passphrase Generator - Memorable Diceware-style passphrases
- Auto-Strength Verification - Generated passwords automatically analyzed
- Multiple Hash Algorithms - MD5, SHA-1, SHA-256, SHA-512
- Hash Verification - Compare passwords against hashes
- Salt Support - Optional salt for enhanced security
- Algorithm Detection - Automatically identify hash algorithm
- Secure Storage - Stores only password hashes, never plaintext
- SQLite Backend - Lightweight database storage
- Entry Management - Add, view, and delete entries
- Educational Purpose - Demonstrates secure storage principles
- Python 3.8 or higher
- No external dependencies (uses only Python standard library)
# Clone the repository
git clone https://github.com/vasttiono/password-security-toolkit.git
cd password-security-toolkit
# Run the application
python password_checker.pyRun the program to access the interactive menu:
python password_checker.pyAvailable Options:
- Analyze Password Strength
- Generate Secure Password
- Generate Passphrase
- Hash Password
- Verify Password Hash
- Save Password to Vault
- View Saved Passwords
- Delete Vault Entry
- Exit
Select option: 1
Enter password to analyze: MyP@ssw0rd2024!
============================================================
PASSWORD STRENGTH ANALYSIS
============================================================
π’ Strength: VERY STRONG
Excellent password! Very secure.
π Score: 8/8
π’ Entropy: 84.65 bits
β±οΈ Estimated Crack Time: 584,942 years
π DETAILED FEEDBACK:
β
Excellent length
β
Contains lowercase letters
β
Contains uppercase letters
β
Contains numbers
β
Contains special characters
============================================================
Select option: 2
--- PASSWORD GENERATION OPTIONS ---
Length (default 16): 20
Include special characters? (Y/n): y
Exclude ambiguous characters? (y/N): y
π Generated Password: xK9@mP2$qL5#nR8!wT4%
β
Strength: VERY STRONG
π Score: 8/8
Select option: 3
Number of words (default 4): 5
π Generated Passphrase: Crystal-Phoenix-Mountain-Thunder-Swift-73
β
Strength: VERY STRONG
| Factor | Max Points | Criteria |
|---|---|---|
| Length | 3 | 16+ chars (3), 12-15 chars (2), 8-11 chars (1) |
| Complexity | 5 | Lowercase (1), Uppercase (1), Numbers (1), Special (2) |
| Penalties | -4 | Common password (-3), Patterns (-1 each) |
| Score | Level | Description | Security |
|---|---|---|---|
| 8 | π’ VERY STRONG | Excellent password! | Highly secure |
| 6-7 | π΅ STRONG | Good password | Secure |
| 4-5 | π‘ MODERATE | Acceptable | Moderately secure |
| 2-3 | π WEAK | Vulnerable | Easily cracked |
| 0-1 | π΄ VERY WEAK | Dangerous! | Extremely weak |
Entropy measures password unpredictability in bits. Higher entropy = stronger password.
| Entropy (bits) | Strength | Crack Time* |
|---|---|---|
| < 28 | Very Weak | Instant |
| 28-35 | Weak | Minutes |
| 36-59 | Fair | Days |
| 60-127 | Strong | Years |
| 128+ | Very Strong | Centuries |
*Assuming 1 billion guesses per second
- Uses
secretsmodule (cryptographically secure PRNG) - Guaranteed character diversity
- Shuffle algorithm prevents patterns
- No predictable sequences
- Supports modern algorithms (SHA-256, SHA-512)
- Optional salt support
- Secure comparison methods
- Educational demonstration of hashing
- Never stores plaintext passwords
- Stores only cryptographic hashes
- SQLite database with proper schema
- Timestamps for audit trail
This tool is designed for:
- Learning about password security
- Understanding cryptographic concepts
- Educational demonstrations
- Security awareness training
DO NOT use the vault feature for real passwords because:
- Simplified implementation
- No encryption at rest
- No master password protection
- No secure key management
- Demo-grade security only
password-security-toolkit/
β
βββ password_checker.py # Main application
βββ README.md # This file
βββ LICENSE # MIT License
βββ .gitignore # Git ignore rules
βββ requirements.txt # Python dependencies
βββ password_vault.db # SQLite database (created on first run)
Run built-in tests:
python -m doctest password_checker.py -vOr use pytest:
pip install pytest
pytest test_password_checker.pyThis project demonstrates:
-
Password Security Principles
- Strength vs complexity
- Entropy and randomness
- Attack vectors (brute force, dictionary)
-
Cryptography Basics
- Hash functions
- Salt and pepper
- One-way functions
-
Python Security
secretsmodule for CSPRNGhashlibfor cryptographic hashing- Secure coding practices
-
Database Security
- Never store plaintext passwords
- Hash storage principles
- SQL injection prevention
from password_checker import PasswordStrengthAnalyzer, SecurePasswordGenerator
# Analyze password programmatically
analyzer = PasswordStrengthAnalyzer()
result = analyzer.analyze("MySecureP@ssw0rd!")
print(f"Strength: {result['strength']['level']}")
print(f"Entropy: {result['entropy']} bits")
print(f"Crack time: {result['crack_time']}")
# Generate password programmatically
generator = SecurePasswordGenerator()
password = generator.generate_password(length=20, use_special=True)
print(f"Generated: {password}")
# Generate passphrase
passphrase = generator.generate_passphrase(num_words=5)
print(f"Passphrase: {passphrase}")Web Application Integration:
# Flask API endpoint example
from flask import Flask, request, jsonify
from password_checker import PasswordStrengthAnalyzer
app = Flask(__name__)
@app.route('/check-password', methods=['POST'])
def check_password():
password = request.json.get('password')
analyzer = PasswordStrengthAnalyzer()
result = analyzer.analyze(password)
return jsonify(result)Batch Password Analysis:
# Analyze multiple passwords from file
with open('passwords.txt', 'r') as f:
passwords = f.readlines()
analyzer = PasswordStrengthAnalyzer()
for pwd in passwords:
result = analyzer.analyze(pwd.strip())
print(f"{pwd.strip()}: {result['strength']['level']}")Issue: Database locked error
Solution: Close all other instances of the programIssue: Module not found
Solution: Ensure you're running Python 3.8+
python --versionIssue: Permission denied on database file
Solution: Check file permissions
chmod 644 password_vault.db- Password breach checker (Have I Been Pwned API integration)
- Master password protection for vault
- AES encryption for stored passwords
- Password strength meter visualization
- Export vault to encrypted file
- Two-factor authentication demo
- Password policy generator
- GUI interface with Tkinter
- Web interface with Flask
- Password generator browser extension
- Multi-language support
- Zxcvbn integration for better analysis
Contributions are welcome! Here's how you can help:
- π Report bugs
- π‘ Suggest new features
- π Improve documentation
- π§ Submit pull requests
- β Star the repository
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 guidelines
- Add docstrings to functions
- Include type hints where appropriate
- Write unit tests for new features
- Lines of Code: ~700
- Functions/Methods: 25+
- Classes: 4
- Supported Hash Algorithms: 4
- Password Patterns Detected: 5+
- Common Passwords Database: 24+
This project showcases:
- β Python programming
- β Object-oriented design
- β Cryptography fundamentals
- β Database management (SQLite)
- β Security best practices
- β Algorithm implementation
- β User interface design
- β Error handling
- β Password security analysis
- β Threat modeling
- β Cryptographic hashing
- β Entropy calculation
- β Attack vector understanding
- β Secure storage principles
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PASSWORD SECURITY TOOLKIT v1.0 β
β Advanced Password Analysis & Generation β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
============================================================
MAIN MENU
============================================================
1. Analyze Password Strength
2. Generate Secure Password
3. Generate Passphrase
4. Hash Password
5. Verify Password Hash
6. Save Password to Vault
7. View Saved Passwords
8. Delete Vault Entry
0. Exit
============================================================
============================================================
PASSWORD STRENGTH ANALYSIS
============================================================
π’ Strength: VERY STRONG
Excellent password! Very secure.
π Score: 8/8
π’ Entropy: 84.65 bits
β±οΈ Estimated Crack Time: 584,942 years
π DETAILED FEEDBACK:
β
Excellent length
β
Contains lowercase letters
β
Contains uppercase letters
β
Contains numbers
β
Contains special characters
============================================================
This project is licensed under the MIT License - see the LICENSE file for details.
- β Commercial use allowed
- β Modification allowed
- β Distribution allowed
- β Private use allowed
β οΈ No warranty providedβ οΈ No liability accepted
[Mohammad Andhika Vasttiono Hanggara]
- GitHub: @vasttiono
- LinkedIn: https://www.linkedin.com/in/vasttiono
- Inspired by zxcvbn password strength estimator
- Password patterns based on OWASP guidelines
- Security principles from NIST standards
- Thanks to the open-source security community
- Built with β€οΈ for cybersecurity education
If you found this useful, check out these related projects:
- network-port-scanner - Network security scanner
- sql-injection-demo - SQL injection educational tool
- crypto-toolkit - Encryption/decryption utilities
If you find this project helpful:
- β Star this repository
- π Share with others
- π Report issues
- π¬ Provide feedback
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security Issues: Email directly (do not open public issue)
This software is provided "as is" without warranty of any kind. The authors are not responsible for any damage or loss resulting from the use of this software. Always follow ethical guidelines and legal requirements when working with security tools.
π Security First β’ π Education Focused β’ π» Open Source
Made with β€οΈ for the cybersecurity community