Comprehensive password auditing tool for assessing strength through entropy analysis, pattern detection, and crack time estimation.
python3 cli.py # Interactive mode (secure, masked input)
python3 cli.py -p "MyPassword123!" # Analyze password via argument
python3 cli.py -p "MyPassword123!" -w Wordlists/100k-most-used-passwords-NCSC.txt # Custom wordlist
python3 cli.py -f passwords.txt # Batch analysis
python3 cli.py -p "Pass123!" --json # JSON output
python3 cli.py -p "Pass123" -g 1e12 # GPU simulationThe tool now supports two ways to provide passwords for analysis:
Simply run the tool without the -p flag:
python3 cli.pyYou'll be securely prompted to enter your password. The input is:
- β Masked (hidden on screen for privacy)
- β
Bypasses shell interpretation (no issues with special characters like
!,$,&,*) - β No quoting needed - enter passwords exactly as they are
Provide password directly via the -p flag:
python3 cli.py -p 'MyP@ss$123!'Note: You must quote passwords with special characters to prevent shell interpretation errors.
Problem: Shell special characters (!, $, &, etc.) cause issues when passed as arguments.
Examples of issues:
python3 cli.py -p MyPass!123 # β Shell interprets ! as history expansion
python3 cli.py -p Pass$word # β Shell interprets $ as variable
python3 cli.py -p "Pass!123" # β
Works but requires quoting
python3 cli.py # β
β
Best: Interactive mode (no shell issues)Solution: Interactive mode using getpass library reads input directly, completely bypassing shell interpretation.
The tool now detects keyboard layout patterns - common weak password patterns where users type adjacent keys.
QWERTY Keyboard Patterns:
- Number row:
1234567890 - Symbol row:
!@#$%^&*() - Letter rows:
qwerty,asdfgh,zxcvbn - Both forward (
qwe) and reverse (ewq) sequences
Numeric Keypad Patterns:
- Rows:
789,456,123 - Columns:
741,852,963 - Diagonals:
753,159
# Passwords WITH spatial patterns (weak):
qwerty # QWERTY top row
asdfgh # QWERTY home row
!@#$ # Shifted number row
789456 # Numpad rows
ewq # Reverse of 'qwe'
# Passwords WITHOUT spatial patterns (better):
MyP@ssword! # Random arrangement
SecureR@nd0m # No keyboard sequence- Case-insensitive: Detects both
QWERTYandqwerty - Minimum length: 3+ consecutive keyboard characters
- Bidirectional: Catches forward and reverse patterns
- Comprehensive: Checks all QWERTY rows and numpad layouts
| Level | Range | Status |
|---|---|---|
| CRITICAL | 0-30 bits | π΄ Instantly crackable |
| WEAK | 30-50 bits | π Hours to crack |
| FAIR | 50-70 bits | π‘ Days to crack |
| GOOD | 70-90 bits | π’ Years to crack |
| EXCELLENT | 90-120 bits | π’ Centuries |
| MASTER | 120+ bits | π Millions of years |
python3 cli.py [OPTIONS]
OPTIONS:
-p, --password TEXT Single password
-f, --file TEXT File with passwords (one per line)
-g, --guesses FLOAT Guesses per second (default: 1e9)
-w, --wordlist TEXT Path to password wordlist (default: Wordlists/100k-most-used-passwords-NCSC.txt)
--json JSON output
-h, --help Help messageInput security limit:
- Maximum password length is 512 characters.
- If exceeded, the program exits gracefully with:
Error: Input exceeds the maximum allowed length of 512 characters. - Leading and trailing whitespace is automatically stripped from input (spaces, tabs, newlines), while internal spaces are preserved for passphrases.
- Input is also blocked if it contains illegal control characters (e.g., null byte, escape/control sequences).
- If detected, the program exits with:
Error: Illegal control characters detected in input. - After strip + validation, input is normalized with Unicode NFKC (
unicodedata.normalize("NFKC", password)) before analysis. - This standardizes visually similar Unicode forms (e.g., full-width forms/ligatures) while preserving valid printable special characters.
The tool now loads common passwords dynamically from a wordlist file.
Default file:
Wordlists/100k-most-used-passwords-NCSC.txt
What happens at runtime:
- The wordlist is read line by line
- Each entry is lowercased and stored in a Python
setfor fast$O(1)$ lookups - In
audit.pymodule mode, a short status message prints the file path and count
Custom wordlist:
python3 cli.py -p "MyPassword123!" -w Wordlists/your-list.txtTests:
- A lightweight test wordlist is stored at:
Wordlists/wordlist_for_test_audit.txt - It contains the first 10 lines of the main list to verify loading works
# Run all tests
./venv/bin/python -m pytest test_audit.py -q
# Run with verbose output
./venv/bin/python -m pytest test_audit.py -v
# Run only input validation tests (length + control characters)
./venv/bin/python -m pytest test_audit.py::TestInputValidation -q- Open Testing panel in VS Code (beaker icon).
- Click Configure Python Tests (choose pytest).
- Select
test_audit.pyor a specific test class. - Click Run from the Testing panel.
Entropy (bits) = logβ(pool_size) Γ length
Pool sizes:
- Lowercase (a-z): 26
- Uppercase (A-Z): 26
- Digits (0-9): 10
- Symbols: 32
- Unicode: 128
- Spaces: 1
- Common Password - Dictionary match against known breached passwords
- Low Variation - β€2 unique characters (weak entropy)
- Repeated Chars - 3+ identical characters in a row
- Sequential - Ascending/descending sequences (abc, 123, xyz)
- Spatial Pattern - Keyboard layouts (qwerty, asdf, 789, !@#) β NEW
- Year-like - Year patterns (1900-2025 or 00-99)
- Missing Uppercase - Has letters but no uppercase (e.g., "password!") β IMPROVED
- Missing Lowercase - Has letters but no lowercase (e.g., "PASSWORD123") β IMPROVED
- All Digits - Only numeric digits
Note: The case detection logic was improved to be more accurate. Passwords with symbols like abc!@# will now correctly show missing-uppercase instead of the misleading single-case flag.
| Scenario | Speed |
|---|---|
| CPU Single | 1M/sec |
| CPU Multi | 1B/sec |
| GPU Single | 1T/sec |
| GPU Farm | 10T/sec |
| Botnet | 1000T/sec |
| Function | Penalty |
|---|---|
| Plaintext | 1x |
| MD5/SHA256 | 1x |
| bcrypt | 200x |
| Argon2 | 1000x |
| scrypt | 1000x |
- 12+ characters (16+ better)
- Mix: Uppercase, Lowercase, Digits, Symbols
- Random characters (no patterns)
- Unique per account
- Passphrases: "Correct-Horse-Battery-Staple"
- Dictionary words
- Sequential patterns (abc, 123, qwerty)
- Repeated characters (aaa, 111)
- Personal info (birthdate, names)
- Same password everywhere
pip install termcolor # Optional for colorsfrom audit import analyze_password
result = analyze_password("MyPassword123!")
print(result["security_level"]["level"]) # FAIR
print(result["estimated_crack_human"]) # 70.55 hours
print(result["issues"]) # List of issuesfrom audit import analyze_password, entropy_bits, shannon_entropy, _check_spatial_patterns
pw = "MyPassword123!"
print(f"Pool Entropy: {entropy_bits(pw):.2f} bits")
print(f"Shannon Entropy: {shannon_entropy(pw):.2f} bits")
# Check for spatial patterns
has_spatial = _check_spatial_patterns(pw)
print(f"Has spatial pattern: {has_spatial}") # False
# GPU simulation
result = analyze_password(pw, guesses_per_second=1e12)
print(result["estimated_crack_human"])
# Check spatial patterns in different passwords
print(_check_spatial_patterns("qwerty")) # True
print(_check_spatial_patterns("asdfgh")) # True
print(_check_spatial_patterns("SecureKey!")) # Falsepython3 cli.py -p "qwerty123"ββββββββββββββββββββββββββββββββββββββββββ
β π Password Analysis - WEAK β
ββββββββββββββββββββββββββββββββββββββββββ
Basic Information:
Password: qwerty123
Length: 9
Entropy Analysis:
Pool Entropy: 46.53 bits
Shannon Entropy: 28.52 bits
Security Level:
π WEAK - Add length, mix character types
Crack Time (Brute Force):
Standard CPU: 235.53 days (max)
Single GPU: 2.06 minutes (max)
Large Botnet: 7.43 seconds (max)
With Hash Protection:
bcrypt: 47.11 days
Argon2: 235.53 days
β οΈ Issues Found:
β’ common-password
β’ sequential-chars
β’ missing-uppercase
β’ spatial-pattern β NEW
β’ year-like
python3 cli.py -p "MySecureP@ss!"ββββββββββββββββββββββββββββββββββββββββββ
β π’ Password Analysis - GOOD β
ββββββββββββββββββββββββββββββββββββββββββ
Basic Information:
Password: MySecureP@ss!
Length: 13
Entropy Analysis:
Pool Entropy: 83.10 bits
Shannon Entropy: 45.26 bits
Security Level:
π’ GOOD - Strong password - well done!
Crack Time (Brute Force):
Standard CPU: >= 1.32 years (max)
Single GPU: 4.83 days (max)
Large Botnet: 2.12 hours (max)
With Hash Protection:
bcrypt: >= 262.94 years
Argon2: >= 1314.70 years
β
No issues detected!
python3 cli.py -p "Test123!"python3 cli.py -p "Test123!" --json- Estimates entropy based on character analysis
- Detects weak patterns
- Simulates brute-force scenarios
- Provides recommendations
- Replace authentication systems
- Account for phishing/social engineering
- Guarantee actual security
- Test specific hash implementations
- Proper hash implementation (bcrypt, Argon2)
- Strong salt usage
- Account lockout policies
- Multi-factor authentication
- Regular security updates
- zxcvbn - JavaScript password estimator
- hashcat - Password cracking
- John the Ripper - Auditing tool
- Keyboard Pattern Detection - Detect QWERTY, DVORAK patterns β (v1.1)
- Levenshtein Distance - Find similarity to known passwords
- Contextual Analysis - Check against user's personal info
- Dictionary Expansion - Support custom word lists
- Multi-language Support - Turkish, German, French wordlists
- REST API - HTTP endpoint for password analysis
- Docker Container - Containerized deployment
- Python Package - PyPI distribution
- Web Dashboard - Interactive web interface
- Database Logging - Track analysis history
- Compromised Password Check - HaveIBeenPwned API integration
- Machine Learning Model - Neural network for pattern recognition
- Batch Processing Queue - Large file processing optimization
- Real-time Monitoring - Password change detection
- Custom Rules Engine - User-defined validation rules
- LDAP Integration - Active Directory support
- Audit Logging - Compliance reporting (GDPR, SOC2)
- Team Management - Multi-user accounts
- API Rate Limiting - Enterprise tier support
- Security Alerts - Real-time breach notifications
- GPU acceleration via CUDA/OpenCL
- Distributed processing support
- Caching mechanism for common passwords
- Parallel batch analysis
- Increase test coverage to 95%+
- Add integration tests
- Performance benchmarks
- Video tutorials
- API documentation (Swagger/OpenAPI)
Made with β€οΈ for password security education
- β
Added whitespace stripping at entry points (
.strip()) to remove leading/trailing spaces, tabs, and newlines while preserving internal spaces - β
Added Unicode normalization with
unicodedata.normalize("NFKC", password)after strip + validation and before analysis - β
Expanded
TestInputValidationwith NFKC normalization tests for bothaudit.pyandcli.py
- β
Added second defensive input-validation layer for illegal control characters (
\x00, escape/control sequences) - β
Validation is executed before analysis/regex operations and exits with code
1on violation - β
Expanded
TestInputValidationcoverage for bothcli.pyandaudit.pyentry points
- β Added defensive input-length validation (max 512 chars) to prevent ReDoS risk at entry points
- β
Validation runs before analysis/regex processing and exits with code
1on violation - β
Added tests in
test_audit.pyfor bothcli.pyandaudit.pymain entry points - β Added README instructions for running tests (terminal + VS Code Testing panel)
- β Replaced hardcoded common-password set with dynamic wordlist loading
- β
Added
-w/--wordlistoption for custom lists - β Added test wordlist file for reliable loading verification
- β
Improved Case Detection Logic - Replaced generic
single-casewith granularmissing-uppercaseandmissing-lowercaseflags - β
Fixed misleading case detection for passwords with symbols (e.g.,
abc!@#now correctly showsmissing-uppercase) - β Case checks now only apply when password contains letters
- β Enhanced pattern detection from 8 to 9 patterns
- β Added 2 new comprehensive test cases for case detection
- β Added Spatial Keyboard Pattern Detection - Detects QWERTY and numpad patterns
- β
Added Hybrid Input Approach - Interactive mode with
getpassfor secure password entry - β Enhanced pattern detection from 7 to 8 patterns
- β Added comprehensive test suite for spatial patterns (16 new tests)
- β Improved security by bypassing shell interpretation issues
- Initial comprehensive release
Last Updated: March 4, 2026 | Version 1.1.5