Modern, secure, and feature-rich password and passphrase generator with CLI and Web interfaces.
- Cryptographically secure random generation using Python's
secretsmodule - Guaranteed character type inclusion (no weak passwords)
- Entropy calculation and password strength analysis
- Common password detection
- Customizable length (6-128 characters)
- Character type selection (uppercase, lowercase, digits, special)
- Custom character sets
- Multiple password generation
- PIN codes and hex keys
- Memorable word-based passphrases
- Customizable word count and separators
- EFF wordlist support
- Optional number inclusion
- Beautiful colored terminal output
- Password strength visualization
- Copy to clipboard
- QR code generation
- Export to JSON/CSV/TXT
- Configuration file support
- Password templates (web, wifi, pin, etc.)
- Modern, responsive design
- Dark mode support
- Real-time password generation
- Strength meter with visual feedback
- RESTful API
git clone https://github.com/ismailtsdln/KeyForge.git
cd KeyForge
pip install -e .# Install with all features (CLI + Web)
pip install -e .[all]
# Or install specific features
pip install -e .[cli] # CLI features only
pip install -e .[web] # Web interface onlypip install -e .[dev]# Generate a 16-character password (default)
rpg
# Generate password with specific length
rpg --length 20
# Generate multiple passwords
rpg --count 5
# Generate without special characters
rpg --no-special# Generate a 4-word passphrase
rpg --passphrase
# Generate 6-word passphrase
rpg --passphrase --words 6
# Custom separator
rpg --passphrase --separator "_"
# Add number to passphrase
rpg --passphrase --add-number# Copy to clipboard
rpg --copy
# Generate QR code
rpg --qrcode
# Export to file
rpg --output passwords.json
rpg --output passwords.csv
rpg --output passwords.txt
# Show password strength
rpg --strength# Use predefined templates
rpg --template wifi # 24 chars, no special
rpg --template pin # 6-digit PIN
rpg --template maximum # 32 chars, max security
# List available templates
rpg --list-templates# Generate PIN code
rpg --pin 6
# Generate hex key (for API tokens)
rpg --hex 32# Create example config
rpg --create-config
# Use custom config
rpg --config my-config.yamlStart the web server:
python web/app.pyThen open your browser to: http://localhost:5000
- π Dark/Light mode toggle
- π Real-time password generation
- π Password strength visualization
- π One-click copy to clipboard
- π± Fully responsive design
from source import rpg
# Generate password
password = rpg.generate_password(length=16)
# Generate passphrase
passphrase = rpg.generate_passphrase(word_count=4)
# Generate multiple unique passwords
passwords = rpg.generate_multiple_passwords(count=5, length=20)
# Special functions
pin = rpg.generate_pin(length=6)
hex_key = rpg.generate_hex_key(length=32)
# Password strength analysis
from source.strength import analyze_password_strength
analysis = analyze_password_strength(password)
print(f"Strength: {analysis['strength']}")
print(f"Score: {analysis['score']}/100")
print(f"Entropy: {analysis['entropy']} bits")The web application exposes RESTful API endpoints:
curl -X POST http://localhost:5000/api/generate \
-H "Content-Type: application/json" \
-d '{
"length": 16,
"count": 1,
"use_uppercase": true,
"use_lowercase": true,
"use_digits": true,
"use_special": true
}'curl -X POST http://localhost:5000/api/passphrase \
-H "Content-Type: application/json" \
-d '{
"word_count": 4,
"separator": "-",
"capitalize": true,
"include_number": false
}'curl -X POST http://localhost:5000/api/analyze \
-H "Content-Type: application/json" \
-d '{"password": "MyP@ssw0rd123"}'Create a config.yaml file:
defaults:
length: 16
use_uppercase: true
use_lowercase: true
use_digits: true
use_special: true
passphrase_words: 4
templates:
web:
length: 16
use_special: true
wifi:
length: 24
use_special: false
output:
show_strength: true
use_colors: trueRun tests:
# Run all tests
pytest tests/
# Run with coverage
pytest --cov=source tests/
# Run specific test file
pytest tests/rpg_test.py -vPython-Random-Password-Generator/
βββ source/
β βββ rpg.py # Core password generation
β βββ cli.py # Command-line interface
β βββ strength.py # Password strength analyzer
β βββ utils.py # Utility functions
β βββ wordlist.py # EFF wordlist for passphrases
β βββ config.py # Configuration management
βββ web/
β βββ app.py # Flask application
β βββ templates/
β β βββ index.html # Web interface
β βββ static/
β βββ css/
β β βββ styles.css
β βββ js/
β βββ app.js
βββ tests/
β βββ rpg_test.py # Unit tests
βββ run.py # Legacy runner
βββ setup.py # Package setup
βββ requirements.txt # Dependencies
βββ README.md # This file
- β¨ New: Cryptographically secure password generation using
secrets - β¨ New: Modern CLI interface with argparse
- β¨ New: Passphrase generation with EFF wordlist
- β¨ New: Password strength analyzer
- β¨ New: QR code generation
- β¨ New: Clipboard support
- β¨ New: File export (JSON/CSV/TXT)
- β¨ New: Configuration file support
- β¨ New: Password templates
- β¨ New: Web interface with Flask
- β¨ New: RESTful API
- β¨ New: Dark mode support
- π Fixed: Password length bug (was generating random length 8-20)
- π Security: Replaced
randomwithsecretsmodule - β Tests: Comprehensive test suite
- π Docs: Complete documentation with examples
- Basic password generation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Δ°smail TaΕdelen
- π§ Email: pentestdatabase@gmail.com
- π LinkedIn: ismailtasdelen
- π GitHub: @ismailtasdelen
- EFF Wordlist for memorable passphrases
- Python
secretsmodule for cryptographically secure random generation - All contributors and users of this project
This tool generates passwords using Python's secrets module, which is designed for generating cryptographically strong random numbers suitable for managing secrets such as passwords. However, the security of generated passwords also depends on:
- Using sufficient password length (16+ characters recommended)
- Enabling multiple character types
- Not sharing passwords
- Using unique passwords for each service
- Storing passwords securely (password manager)
Made with β€οΈ by Δ°smail TaΕdelen