Python 3.13+ · MIT License · Comprehensive Unit Tests

Password analysis
built from first principles

A modular Python library for password analysis built from first principles.

Character Analysis • Pattern Detection • Dictionary Matching • Entropy Estimation • Crack-Time Prediction

9
Pipeline Stages
100%
Test Coverage
49
Unit Tests
0
Dependencies

Features

A collection of modular, focused analysers that compile comprehensive password telemetry.

Character Analysis

Classifies characters into lowercase, uppercase, digits, symbols, whitespace, and unicode. Sets the mathematical pool sizes.

Theoretical Entropy

Calculates the traditional L × log₂(pool) entropy representing the theoretical upper bound for random strings.

Structural Recognition

Flags keyboard walks (qwerty, asdf), sequential runs (1234, abcd), repeated characters, and repeating substrings.

Leetspeak Normalisation

Substitutes patterns such as @→a or 3→e to identify obscured dictionary matches.

Pluggable Wordlists

Matches candidates against a built-in 100k wordlist or custom corporate lists using set or file loaders.

Effective Entropy

Combines identified sequences and applies mathematical entropy penalties. Prevents overlapping run double-penalties.

Strength Tiers

Standard categories based on final effective entropy bits.

Very Weak
< 20
Cracked in milliseconds
Weak
20 – 40
Cracked in seconds to hours
Moderate
40 – 60
Cracked in days to weeks
Strong
60 – 80
Years to crack via hardware
Very Strong
≥ 80
Centuries even with GPU rigs

Usage

Get started with basic verification or configure custom dictionary providers and hardware specs.

from passguard import PasswordAnalyzer
      
# Initialize analyzer with default built-in wordlists
analyzer = PasswordAnalyzer()
report = analyzer.analyze("Password123!")

print(report.score)                     # Output: 83
print(report.strength)                  # Output: "Strong"
print(report.entropy.effective_bits)    # Output: 66.55

for rec in report.recommendations:
    print(f"[{rec.severity}] {rec.message}")
from passguard import PasswordAnalyzer
from passguard.analysis.dictionary.provider import SetDictionaryProvider

# Create an isolated custom wordlist set provider
provider = SetDictionaryProvider({"acme", "admin", "secret"})
analyzer = PasswordAnalyzer(dictionary_provider=provider)
report = analyzer.analyze("ACME_Corp123!")

for m in report.dictionary_matches:
    print(f"Matched word: {m.word} at [{m.start}:{m.end}]")
from passguard import PasswordAnalyzer
from passguard.analysis.cracktime.models import AttackProfile

# Define custom hardware setups and guess speeds
profiles = [
    AttackProfile("RTX 4090 GPU Array", 25_000_000_000),
    AttackProfile("Attacker Supercomputer", 500_000_000_000),
]
analyzer = PasswordAnalyzer(attack_profiles=profiles)
report = analyzer.analyze("MyS3cur3P@ssw0rd!")

for name, seconds in report.crack_times.items():
    print(f"{name}: {seconds:.2e}s")
Select password type to preview live PassGuard telemetry:
PasswordReport Object Preview
"123456"
score 5 / 100
strength Very Weak
theoretical_entropy 19.93 bits
effective_entropy 4.32 bits
patterns_detected Sequential digits '123456', Keyboard walk '123456'
offline_fast_hash_crack_time 9.99e-10 seconds (< 0.0001 seconds)
recommendations