Machine learning classifier that grades passwords as weak, medium or strong. A random forest is trained on a deterministic synthetic dataset of 5000 passwords whose labels come from an explicit feature rule (length, character class counts and ratios, Shannon entropy, repeated-character runs and common pattern penalties).
- 15 engineered features per password, all computed offline
- Seeded, reproducible training set; no external data or network
- Predictions come with a bounded 0-100 score derived from classifier confidence
scoreCLI prints strength and score in one call
pip install -r requirements.txt
python -m password_strength score "password123"
python -m password_strength score "Xk9#mQ2!pVz@4Rt7w"
python -m pytest -qExample output:
strength: weak
score: 15/100
password-strength/
password_strength/
features.py feature extraction (length, classes, entropy, runs, penalties)
dataset.py deterministic synthetic generator + labelling rule
model.py random forest training and scoring
__main__.py argparse CLI
tests/test_smoke.py offline smoke tests
MIT