How admiralty01/password-generator works
Purpose and Entry Points
This repository implements a hybrid passphrase security suite: generate Diceware-style word passphrases with randomized symbols, calculate entropy, and estimate resistance to brute-force and dictionary attacks. Primary runtime entry points are the Python CLI in password_generator_v1.py and the web application bootstrap in app.py. HTTP endpoints are defined in api/routes.py; the server-rendered UI resides in templates/index.html.
Application Boundary
app.py is the application composition root, connecting the web runtime to API routing. api/routes.py forms the external request boundary for generation and evaluation operations, translating browser/API inputs into calls on the core domain. templates/index.html is the delivered browser interface; the stitch_hybrid_passphrase_security_suite/ HTML files are design/prototype artifacts rather than the implemented runtime UI.
Passphrase Generation
core/generator.py owns secure hybrid-passphrase construction. It draws semantic tokens from eff_large_wordlist.txt and combines them with symbol patterns, preserving word boundaries for memorability while expanding the attack search space. Both the CLI (password_generator_v1.py) and API layer (api/routes.py) should consume this component rather than independently implementing selection logic.
Entropy Modeling
core/entropy.py provides the security math for the generated structure: word-list selection space plus symbol/pattern choices. This is a domain boundary between raw generation parameters/passphrase composition and user-facing strength metrics. The EFF list at eff_large_wordlist.txt is a material security asset: its cardinality and contents directly determine word-selection entropy.
Evaluation and Attack Simulation
core/evaluator.py converts entropy or passphrase characteristics into security assessments, including brute-force crack-time estimates across hardware profiles and dictionary-resistance grading. core/benchmark.py supports comparative analysis between the hybrid scheme and conventional random-character approaches. These stages feed presentation clients with explanatory security outcomes, rather than acting as password storage or authentication infrastructure.
CLI Flow
password_generator_v1.py accepts generation parameters such as word and symbol counts, invokes generation and evaluation capabilities, then prints ANSI-formatted results. It is a standalone local execution path and does not require web infrastructure. Its control flow is: parse arguments → generate hybrid passphrase → calculate entropy → evaluate crack resistance → render terminal report.
Web/API Flow and Runtime Dependencies
The browser requests generation/evaluation actions through api/routes.py; routes invoke core/generator.py, core/entropy.py, and core/evaluator.py, then return results for templates/index.html to display. Python dependencies are declared in requirements.txt. No database, cloud service, identity provider, or remote entropy service is represented; generation is intended to remain local to the executing process. eff_large_wordlist_raw.txt appears to be a source/raw variant of the curated runtime word list.
Main entry points: routes.py HTTP routes · entropy.py Entropy model · password_generator_v1.py Passphrase CLI · app.py Web bootstrap
Components 11
Web Application
- Web bootstrap · Application composition root.
app.py - HTTP routes · Handles generation and evaluation requests.
api/routes.py - Browser UI · Server-rendered passphrase interface.
templates/index.html
CLI
- Passphrase CLI · Standalone local generation and reporting flow.
password_generator_v1.py
Security Core
- Hybrid generator · Constructs Diceware words with randomized symbol patterns.
core/generator.py - Entropy model · Calculates word-selection and symbol-pattern entropy.
core/entropy.py - Security evaluator · Estimates crack resistance and dictionary strength.
core/evaluator.py - Scheme benchmark · Compares hybrid passphrases with random-character approaches.
core/benchmark.py
Wordlist Assets
- Curated EFF wordlist · Runtime word-selection space for Diceware generation and entropy.
eff_large_wordlist.txt - Raw wordlist source · Raw variant of the curated runtime list.
eff_large_wordlist_raw.txt
Other components
- Python dependencies
requirements.txt
Connections 14
- Web bootstrap → HTTP routes: mounts
- Web bootstrap → Browser UI: serves
- Browser UI → HTTP routes: requests actions
- HTTP routes → Hybrid generator: generates
- HTTP routes → Entropy model: calculates
- HTTP routes → Security evaluator: evaluates
- Passphrase CLI → Hybrid generator: generates
- Passphrase CLI → Entropy model: calculates
- Passphrase CLI → Security evaluator: renders assessment
- Hybrid generator → Curated EFF wordlist: selects words
- Entropy model → Curated EFF wordlist: uses cardinality
- Scheme benchmark → Entropy model: uses security math
- Raw wordlist source → Curated EFF wordlist: source variant
- Python dependencies → Web bootstrap: provides runtime packages