A modular Python library for password analysis built from first principles.
Character Analysis • Pattern Detection • Dictionary Matching • Entropy Estimation • Crack-Time Prediction
A collection of modular, focused analysers that compile comprehensive password telemetry.
Classifies characters into lowercase, uppercase, digits, symbols, whitespace, and unicode. Sets the mathematical pool sizes.
Calculates the traditional L × log₂(pool) entropy representing the theoretical upper bound for random strings.
Flags keyboard walks (qwerty, asdf), sequential runs (1234, abcd), repeated characters, and repeating substrings.
Substitutes patterns such as @→a or 3→e to identify obscured dictionary matches.
Matches candidates against a built-in 100k wordlist or custom corporate lists using set or file loaders.
Combines identified sequences and applies mathematical entropy penalties. Prevents overlapping run double-penalties.
Standard categories based on final effective entropy bits.
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")