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 — patterns that 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.7.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.7-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: passeval-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 f641c8b6b83c12c6c32c24390f16898cd97f2137ad63e070335a5992b4b16fd6
MD5 ade9509c294932dc81ca13c8ac4ed297
BLAKE2b-256 4c0bddbc5508f07e49e8147008ce661dc1fc85e0c79414b20bf60fe6a09efcb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: passeval-0.1.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 60e60f6b7ad960864a7cfded1b55c577e357c31e17f7e73f0a3946a63b2071f5
MD5 25ef7fce2be7c384fafe3e0a62bd5c32
BLAKE2b-256 93ba96cd6b58c4b84c85368e891794e20037f76bc2a6ef3b969415d2fd057eb2

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