Prepare features
Collect password-labelled examples or construct features such as length, character classes, estimated entropy and breach-list membership; avoid storing raw passwords in clear text.
Predict password strength. Flag risky inputs.
Password strength prediction assigns a strength score or risk label to candidate passwords using features such as length, character variety, entropy estimates and breach-history lookups. Important failure modes include leaked passwords, culturally common patterns, password reuse across accounts and adversarially crafted inputs. Privacy, logging and user experience must be considered when scoring or blocking passwords.
Learning concept · Not a validated service
Password strength prediction assigns a strength score or risk label to candidate passwords using features such as length, character variety, entropy estimates and breach-history lookups. Important failure modes include leaked passwords, culturally common patterns, password reuse across accounts and adversarially crafted inputs. Privacy, logging and user experience must be considered when scoring or blocking passwords.
A proposed extension: provide a scoring API for sign-up and password-change flows that highlights weak choices and suggests safer alternatives. Human review and appeal should be available; this starter does not implement an audit-ready service.
Collect password-labelled examples or construct features such as length, character classes, estimated entropy and breach-list membership; avoid storing raw passwords in clear text.
Train a regression or multiclass classifier to predict strength scores using only derived features and appropriate privacy protections.
Measure calibration, recall on weak-passwords, false positive rate on valid passwords and test on out-of-distribution patterns like common phrases.
Expose scores via an API with logging, thresholds that trigger human review, and rate-limiting to reduce attacker feedback.
The supplied starter creates synthetic numeric "log" records (events_per_minute, failed_attempts, bytes_out_mb), fits an IsolationForest anomaly detector to those records, labels anomalies with fit_predict, and prints the detected alerts. It does not process password strings, compute entropy, or train a password-strength classifier.
logs = pd.concat([normal, suspicious], ignore_index=True)
detector = IsolationForest(contamination=0.05, random_state=42)
logs["anomaly_score"] = detector.fit_predict(logs)
alerts = logs[logs["anomaly_score"] == -1]
The starter generates synthetic network-style metrics and runs an unsupervised anomaly detector; it contains no password features, no breach-list checks and no supervised strength labels. Therefore it cannot validate or claim password-strength prediction performance.
A proposed extension: assemble a labelled corpus or use heuristic labels to train a model that predicts a numeric strength score from derived features (length, character classes, entropy estimate, breach-list membership). Add explainability that returns the top reasons a password was scored weak and integrate an appeal or override workflow for users.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its Cybersecurity Course, with placement support and hands-on labs.