Skip to main content

Offline ML-powered password strength evaluation using a trained Random Forest model.

Project description

passeval

Offline ML-powered password strength evaluation for Python developers.

Built on a Random Forest classifier trained on 220,000 passwords. Runs fully locally, no API, no server.

Installation

pip install passeval

Quick Start

from passeval import evaluate_password

result = evaluate_password("Monkey2024!")
print(result)
{
  "score": 0,
  "label": "Weak",
  "confidence": 1.0,
  "features": {
    "length": 11,
    "entropy": 3.2776,
    "num_upper": 1,
    "num_digits": 4,
    "num_special": 1
  },
  "feedback": [
    "Longer passwords are significantly harder to crack",
    "Avoid predictable patterns like years or repeated digits"
  ]
}

Examples

from passeval import evaluate_password

evaluate_password("hunter2")["label"]                      # Weak
evaluate_password("Password1")["label"]                    # Medium
evaluate_password("blitz8-concrete2-eloquence3")["label"]  # Strong
evaluate_password("xK9#mP2$vL8@")["label"]                # Strong

Key Features

  • 3-class scoring - Weak (0), Medium (1), Strong (2)
  • Confidence score - model probability for the predicted class
  • Actionable feedback - specific suggestions to improve weak passwords
  • Detects breach-derived patterns - catches passwords like Monkey2024! that pass surface-level complexity checks
  • Fully offline - model ships inside the package, no internet required
  • Fast after warmup - model cached in memory, sub-millisecond from second call onward

How It Works

passeval extracts 10 statistical features from each password (length, entropy, character type counts, boolean flags) then runs them through a trained Random Forest classifier. No raw characters are inspected; the model learns structural patterns, not specific passwords.

from passeval import extract_features

extract_features("Monkey2024!")
# {
#   'length': 11, 'num_upper': 1, 'num_lower': 6, 'num_digits': 4,
#   'num_special': 1, 'entropy': 3.2776, 'unique_chars': 10,
#   'has_upper': 1, 'has_digit': 1, 'has_special': 1
# }

vs zxcvbn

Unlike zxcvbn (rule-based, 55.37% accuracy), passeval correctly flags passwords like Monkey2024!, Dragon!, and Football!2024 as Weak. These patterns satisfy complexity rules but originate from breached credentials. On realistic weak password detection, the ML model achieves 99.93% vs zxcvbn's 32.34%.

License

MIT - see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passeval-0.1.8.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passeval-0.1.8-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

Details for the file passeval-0.1.8.tar.gz.

File metadata

  • Download URL: passeval-0.1.8.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for passeval-0.1.8.tar.gz
Algorithm Hash digest
SHA256 03da85c2bc931677743971b9fcc4d2e13a949c9ba68ac20a100ffc0c813bbdf0
MD5 8c3a5245ace4b65f53aacb8c2ccc117a
BLAKE2b-256 b104592b3d2c4e865898f8d1514ad9d15a7adfb74bf385d8b071a03ce6aef32c

See more details on using hashes here.

File details

Details for the file passeval-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: passeval-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for passeval-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 42a658ced1ff9fe545e371659110ed185bee04f81fa24e9c91dceb59b6c723cb
MD5 504789aac9a90aca261028e3562a740e
BLAKE2b-256 518578852d583a9b4018d42ab41626d9f8960e0dbc6b8cd11e1ae4e11903123f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page