Fortress Password Generator Development by Hatim El HassakFortress Password Generator Development by Hatim El Hassak

Fortress Password Generator Development

Hatim El Hassak

Hatim El Hassak

๐Ÿฐ Fortress

A cryptographically secure password generator with entropy estimation.
Fortress uses Python's secrets module to generate passwords that are suitable for security-sensitive applications. It includes entropy calculation, strength estimation, and a beautiful CLI.

โœจ Features

Feature Description ๐Ÿ” Cryptographically Secure Uses secrets module, not random ๐Ÿ“Š Entropy Calculation Know exactly how strong your password is โฑ๏ธ Crack Time Estimation See how long it would take to crack ๐ŸŽจ Beautiful CLI Rich terminal output with colors and progress ๐Ÿ“ฆ Zero Dependencies Core library has no dependencies ๐Ÿ”ง Configurable Customize character sets, length, and more ๐Ÿงช Well Tested 80%+ test coverage with pytest

๐Ÿš€ Installation

# Install core library only
pip install fortress

# Install with CLI support (recommended)
pip install "fortress[cli]"

# Install for development
pip install -e ".[dev]"

๐Ÿ“– Usage

Command Line

# Generate a 16-character password (default)
fortress generate

# Generate a 32-character password
fortress generate -l 32

# Generate without symbols (for sites that don't allow them)
fortress generate --no-symbols

# Generate multiple passwords
fortress generate -c 5

# Generate a memorable passphrase
fortress passphrase

# Check strength of an existing password
fortress check "MyP@ssw0rd123"

# Quiet mode (just the password, for scripting)
fortress generate -q

Python Library

from fortress import generate_password, PasswordConfig, calculate_entropy

# Generate with defaults (16 chars, all character types)
password = generate_password()

# Generate with custom length
password = generate_password(length=32)

# Generate with custom configuration
config = PasswordConfig(
length=24,
use_symbols=False,
exclude_ambiguous=True, # No 0/O, 1/l/I confusion
)
password = generate_password(config=config)

# Check entropy
entropy = calculate_entropy(password)
print(f"Entropy: {entropy:.1f} bits")

๐Ÿ“ Project Structure

fortress/
โ”œโ”€โ”€ __init__.py # Public API
โ”œโ”€โ”€ core/
โ”‚ โ”œโ”€โ”€ generator.py # Password generation logic
โ”‚ โ””โ”€โ”€ entropy.py # Strength calculation
โ”œโ”€โ”€ cli/
โ”‚ โ””โ”€โ”€ __init__.py # Typer CLI application
โ””โ”€โ”€ utils/
โ””โ”€โ”€ display.py # Terminal display utilities

๐Ÿ—๏ธ Architecture

Core Module: Pure Python, no dependencies, cryptographically secure
CLI Module: Optional, uses Typer and Rich for beautiful output
Utils Module: Display helpers with graceful fallback

๐Ÿ”’ Security

Fortress uses secrets.choice() instead of random.choice(). The secrets module is specifically designed for generating cryptographically strong random numbers suitable for managing secrets such as passwords.
From the Python docs:
The secrets module is used for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, security tokens, and related secrets.

๐Ÿงช Development

# Clone and install
git clone https://github.com/hatimhtm/Fortress.git
cd Fortress
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=fortress --cov-report=html

# Lint
ruff check .

# Type check
mypy fortress

๐Ÿ“Š Password Strength Guide

Entropy (bits) Strength Crack Time* < 28 Very Weak Instantly 28-35 Weak Minutes 36-59 Fair Hours to days 60-127 Strong Years โ‰ฅ 128 Very Strong Centuries
*Assuming 10 billion attempts/second

๐Ÿ“„ License

๐Ÿ‘ค Author

Hatim El Hassak โ€” Full-Stack Engineer
Like this project

Posted Feb 13, 2026

Developed a secure password generator using Python's secrets module.