Skip to content

EYA179/PassGuard-Password-Strength-Classifier

Repository files navigation

PassGuard Password Strength Classifier

PassGuard is a machine learning notebook project for classifying password strength from text patterns. It uses a labeled password dataset, character-level TF-IDF features, and compares Logistic Regression, AdaBoost, and XGBoost models.

Project Contents

Path Description
main.ipynb Data loading, preprocessing, visualization, model training, cross-validation, and evaluation.
data.csv Password dataset with password and strength columns.
verify_project.py Lightweight reproducibility check for the dataset/vectorizer/model pipeline.
notebook-requirements.txt Python dependencies for running the notebook and verification script.
index.html, style.css, script.js Static public showcase page for GitHub/Vercel.

Dataset

The notebook loads data.csv with pd.read_csv("data.csv", on_bad_lines="skip").

  • Loaded rows: 669,640
  • Clean rows after dropping one null password: 669,639
  • Labels: 0 weak, 1 medium, 2 strong
  • Class counts:
    • 0: 89,701
    • 1: 496,801
    • 2: 83,137

Approach

  1. Load and clean the password dataset.
  2. Tokenize each password at the character level.
  3. Convert passwords into TF-IDF feature vectors.
  4. Split the dataset into training and test sets.
  5. Compare Logistic Regression, AdaBoost, and XGBoost.
  6. Evaluate with accuracy, precision, recall, F1 score, cross-validation, and confusion matrices.

Recorded Notebook Results

Model Holdout Accuracy Weighted Precision Weighted Recall Weighted F1
Logistic Regression 0.8197 0.8028 0.8197 0.8026
AdaBoost 0.8320 0.8314 0.8320 0.7911
XGBoost 0.9805 0.9804 0.9805 0.9804

The strongest recorded model in the notebook is XGBoost, with about 98.05% holdout accuracy.

Course Context

This project was completed as part of the Machine Learning course at UNICA, Università degli Studi di Cagliari.

Run Locally

python3 -m venv .venv
source .venv/bin/activate
pip install -r notebook-requirements.txt

Run the quick verification script:

python verify_project.py

Run on the full dataset:

python verify_project.py --full

Open the notebook:

jupyter notebook main.ipynb

Showcase

The static showcase page is served from index.html, so Vercel can use the repository root as the project root.

For local preview:

python3 -m http.server 8000

Then open http://localhost:8000.

About

This repo is a notebook-based password strength classification project. It uses data.csv with password and strength, character-level TF-IDF, and compares Logistic Regression, AdaBoost, and XGBoost. XGBoost is the strongest recorded model at about 98.05% accuracy.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages