How ah74n/saltbae works
Purpose and runtime
SaltBae is a local Flask application for authorized security assessments. It accepts contextual terms, generates targeted password candidates in memory, and returns a deduplicated, length-filtered dictionary. Python 3.10+ and Flask are the primary runtime dependencies; the bundled NCSC password corpus is its local data source.
Core entry point: app.py
Generation engine: logic.py
Dependency declaration: requirements.txt
Web application boundary
app.py hosts the Flask server and forms the boundary between browser requests and password-generation logic. It renders the single-page interface and handles generation requests, passing submitted user context into the engine and returning results to the client.
Relevant paths:
• app.py
• templates/index.html
• logic.py
Browser interface and request flow
The browser UI collects personal/contextual fields such as names, dates, organizations, hobbies, and custom keywords. Client-side behavior submits data to Flask and displays or enables retrieval of the generated dictionary. No separate frontend framework or external API is indicated.
Relevant paths:
• templates/index.html
• static/js/main.js
• static/css/style.css
Input normalization and tokenization
The generation pipeline begins by converting submitted fields into usable base tokens. This stage is responsible for splitting or normalizing contextual input—README identifies camel-case tokenization—and establishing the seed word set for downstream transformations.
Relevant path:
• logic.py
Heuristic mutation engine
The main engine derives candidate variants from each base token: case variants, reversed strings, leetspeak substitutions, numeric prefixes/suffixes, and symbol-bearing forms. This is the principal probability-focused generation stage, intended to favor common human password construction patterns over exhaustive brute force.
Relevant path:
• logic.py
Combination and pattern expansion
The engine combines multiple contextual words and numbers into compound candidates, including joined, underscore-separated, and symbol-separated patterns. Dates and common suffixes are incorporated into word-plus-number and multi-word forms. Candidate production is likely combinatorial, so this is the key scale/performance boundary.
Relevant path:
• logic.py
Corpus merge, filtering, and output
Generated candidates are merged with the bundled top-password dataset, deduplicated, and filtered by password length before response delivery. The corpus remains repository-local; user input and generated output are described as request-lifecycle/in-memory data rather than persisted records.
Relevant paths:
• logic.py
• 100k-most-used-passwords-NCSC.txt
• app.py
Deployment and external dependencies
The system is self-contained aside from Flask and standard browser assets. The README references a PythonAnywhere demo deployment, but the repository exposes no database, queue, authentication provider, cloud storage, or third-party generation service. Operationally, deployment needs access to the application files and the NCSC corpus at runtime.
Relevant paths:
• app.py
• requirements.txt
• 100k-most-used-passwords-NCSC.txt
Main entry points: app.py Flask server · index.html Single-page interface · logic.py Merge, filter & dedupe · main.js Client behavior
Components 11
Browser UI
- Single-page interface · Collects contextual fields and presents generated dictionaries.
templates/index.html - Client behavior · Submits form data and displays or retrieves results.
static/js/main.js - Interface styling
static/css/style.css
Flask application
- Flask server · Renders the UI, accepts generation requests, and returns results.
app.py
Generation pipeline
- Input normalization · Builds base tokens from submitted context, including camel-case splitting.
logic.py - Heuristic mutations · Creates case, reverse, leetspeak, numeric, and symbol variants.
logic.py - Combination expansion · Builds multi-word, separator, date, and suffix patterns.
logic.py - Merge, filter & dedupe · Merges candidates, removes duplicates, and applies password-length filtering.
logic.py - Generation engine · In-memory password candidate generation pipeline.
logic.py
Local data & dependencies
- NCSC password corpus · Bundled top-password source merged into output.
100k-most-used-passwords-NCSC.txt - Runtime dependencies · Declares Flask and Python dependencies.
requirements.txt
Connections 12
- Interface styling → Single-page interface: styles
- Single-page interface → Client behavior: drives
- Client behavior → Flask server: submits context
- Flask server → Single-page interface: renders / returns results
- Flask server → Generation engine: invokes
- Generation engine → Input normalization: starts pipeline
- Input normalization → Heuristic mutations: base tokens
- Heuristic mutations → Combination expansion: variants
- Combination expansion → Merge, filter & dedupe: candidates
- NCSC password corpus → Merge, filter & dedupe: merged with
- Merge, filter & dedupe → Flask server: in-memory dictionary
- Runtime dependencies → Flask server: provides Flask