Password Generator Software

The Password Generator is a versatile, lightweight utility designed to create strong, random passwords quickly and efficiently. Available as both a command-line interface (CLI) and graphical user interface (GUI), this tool makes password generation accessible to both technical and non-technical users. In an era where password security is paramount, having a reliable, offline tool to generate cryptographically secure passwords is essential for protecting your accounts and data.
What is Password Generator?
Password Generator is a Python-based utility that creates random, secure passwords using cryptographically strong randomization algorithms. Unlike relying on web-based password generators that may log your passwords, this tool runs entirely offline on your machine, giving you complete control and privacy.
Key Advantages
- Offline Generation - No internet connection required
- Cross-Platform - Works on Windows, macOS, and Linux
- Dual Interface - GUI for casual users, CLI for power users
- Customizable - Adjust length, character types, and prefixes
- Fast - Generate passwords instantly
- Secure - Uses Python's
secretsmodule for cryptographic randomness - No Logging - Passwords are never stored or transmitted
- Open Source - Full transparency and community auditable code
Features
Password Customization
Character Set Options
- Uppercase Letters (A-Z) - Optional inclusion
- Lowercase Letters (a-z) - Optional inclusion
- Numbers (0-9) - Optional inclusion
- Special Characters (!@#$%^&*) - Optional inclusion
- Custom Characters - Add your own character set
- Exclude Ambiguous - Remove l, 1, O, 0, etc. for clarity
Length Control
- Minimum Length - 8 characters (security minimum)
- Maximum Length - 128 characters
- Custom Length - Any value between min and max
- Batch Generation - Create multiple passwords at once
Prefix/Suffix Options
- Add Prefix - Prepend custom text to password
- Add Suffix - Append custom text to password
- Length Calculation - Total length includes prefix/suffix
- Custom Separator - Use delimiter between prefix and password
User Interfaces
Graphical User Interface (GUI)
- Clean, intuitive tkinter-based interface
- Real-time preview of generated password
- Checkboxes for character type selection
- Slider or input field for password length
- Copy-to-clipboard functionality
- Batch generation window
- Password strength indicator
- Customizable theme and layout
Command-Line Interface (CLI)
- Scriptable for automation
- Batch processing capabilities
- Pipe output to other commands
- Configuration file support
- Verbose output options
- JSON output format option
Technical Details
Technology Stack
Programming Language
- Python 3.6+ - Modern Python version
- No External Dependencies - Standard library only (for CLI)
- tkinter - Built-in GUI toolkit for graphical version
Security Implementation
secretsModule - Cryptographically secure random generation- OS Random - Uses /dev/urandom on Unix, CryptGenRandom on Windows
- No Weak Randomness - Never uses
random.Random()
Performance
- Instant Generation - Password generated in <10ms
- Memory Efficient - Minimal RAM usage (<20MB)
- CPU Efficient - Fast password generation without lag
Password Strength
Generated Passwords Are:
- Truly Random - Using cryptographic algorithms
- Hard to Guess - Entropy from 52-94 character sets
- Collision-Free - Highly improbable duplicates
- Unbiased - Each character equally likely
Strength Calculator:
Length: 8 chars, Set: 94 → Entropy: ~52 bits (Weak)
Length: 12 chars, Set: 94 → Entropy: ~78 bits (Good)
Length: 16 chars, Set: 94 → Entropy: ~104 bits (Strong)
Length: 20 chars, Set: 94 → Entropy: ~130 bits (Very Strong)
Installation Guide
Prerequisites
- Python 3.6 or higher
- pip (Python package manager)
- Git (optional, for cloning)
- tkinter (for GUI - usually included with Python)
Step-by-Step Installation
Step 1: Install System Dependencies
For Ubuntu/Debian:
sudo apt update
sudo apt install -y python3 python3-pip python3-tk
For RHEL/CentOS/Fedora:
sudo dnf install -y python3 python3-pip python3-tkinter
For macOS (with Homebrew):
brew install python3
# tkinter is included with Python on macOS
For Windows:
- Download Python from python.org
- Check "Install tcl/tk and IDLE" during installation
- Verify:
python --version
Step 2: Clone Repository
git clone https://github.com/KaushalBhatol/RandomPasswordGenrator.git
cd RandomPasswordGenrator
Alternatively, download as ZIP from GitHub and extract.
Step 3: Set Executable Permissions (Linux/macOS)
chmod u+x main.py
chmod u+x cli.py
chmod u+x gui.py
Step 4: Verify Installation
# Test CLI
python3 cli.py --help
# Test GUI (if available)
python3 gui.py
Usage Guide
Graphical User Interface (GUI)
Starting the GUI:
python3 gui.py
# or
./gui.py
GUI Usage:
Launch Application
- Double-click
gui.pyor run command above - Window opens with generator interface
- Double-click
Configure Password
Length Slider/Input
- Drag slider or type number
- Default: 16 characters
- Range: 8-128 characters
Character Type Checkboxes
- ☑ Uppercase (A-Z)
- ☑ Lowercase (a-z)
- ☑ Numbers (0-9)
- ☑ Special (!@#$%^&*)
Advanced Options
- Exclude ambiguous characters (l, 1, O, 0)
- Remove similar looking characters
- Add prefix (optional)
- Add suffix (optional)
Generate Password
- Click "Generate Password" button
- Password appears in text field
- Click again for new password
Copy Password
- Click "Copy to Clipboard" button
- Password copied, ready to paste
- Notification confirms copy
Batch Generation
- Enter quantity (1-100)
- Click "Generate Batch"
- View all passwords
- Save to file or copy each
Command-Line Interface (CLI)
Basic Usage:
Generate Single Password (Default 16 chars):
python3 cli.py
# Output: aBcDeFgHiJkLmNoP
Custom Length:
python3 cli.py -l 20
# 20-character password
Include Specific Character Types:
# Only lowercase and numbers
python3 cli.py -l 12 --lowercase --numbers
# Uppercase, numbers, and special characters
python3 cli.py -l 16 --uppercase --numbers --special
With Prefix:
python3 cli.py -l 12 --prefix "APP_"
# Output: APP_aBcDeFgHiJ
Batch Generation:
# Generate 5 passwords
python3 cli.py -n 5
# Output:
# Password 1: aBcDeFgHiJkLmNoP
# Password 2: qRsTuVwXyZaBcDeF
# Password 3: gHiJkLmNoPqRsTuV
# Password 4: wXyZaBcDeFgHiJkL
# Password 5: mNoPqRsTuVwXyZaB
JSON Output:
python3 cli.py -n 3 --json
# Output:
# {
# "passwords": [
# "aBcDeFgHiJkLmNoP",
# "qRsTuVwXyZaBcDeF",
# "gHiJkLmNoPqRsTuV"
# ]
# }
Complete CLI Options:
python3 cli.py --help
Options:
-l, --length LENGTH Password length (8-128) [default: 16]
-n, --number COUNT Generate multiple passwords [default: 1]
--uppercase Include uppercase A-Z
--lowercase Include lowercase a-z
--numbers Include numbers 0-9
--special Include special characters !@#$%^&*
--prefix TEXT Add prefix to password
--suffix TEXT Add suffix to password
--exclude-ambiguous Remove ambiguous chars (l,1,O,0)
--json Output as JSON
--verbose Show detailed information
--help Show help message
Advanced Usage
Script Integration:
# Use in shell script
PASSWORD=$(python3 cli.py -l 16 --uppercase --numbers --special)
echo "New password: $PASSWORD"
# Pipe to other commands
python3 cli.py | xclip -selection clipboard # Linux clipboard
python3 cli.py | pbcopy # macOS clipboard
Batch Processing:
# Generate 100 passwords and save to file
python3 cli.py -n 100 > passwords.txt
# Generate unique passwords for multiple users
for user in alice bob charlie; do
echo "$user: $(python3 cli.py -l 16)"
done
Password Requirements Compliance:
# Minimum requirements for some systems
# At least 1 uppercase, 1 lowercase, 1 number, 1 special, 12+ chars
python3 cli.py -l 16 \
--uppercase \
--lowercase \
--numbers \
--special
Project Structure
RandomPasswordGenrator/
├── main.py # Entry point (chooses GUI or CLI)
├── gui.py # Graphical user interface
├── cli.py # Command-line interface
├── generator.py # Core password generation logic
├── requirements.txt # Python dependencies (empty/minimal)
├── README.md # Documentation
├── LICENSE # MIT License
└── examples/
├── generate_for_users.py # Example script
├── bulk_password_generator.py # Batch processing
└── config_file_example.ini # Configuration template
Configuration
Configuration File (Optional)
Create .pgconfig in home directory:
[defaults]
length = 16
include_uppercase = true
include_lowercase = true
include_numbers = true
include_special = true
exclude_ambiguous = false
[gui]
theme = light
window_size = 500x400
font_size = 10
[cli]
json_output = false
verbose = false
Load configuration:
python3 cli.py --config ~/.pgconfig
Password Strength Guidelines
Minimum Recommendations
For Most Accounts:
- Length: 12+ characters
- Mix: Uppercase + Lowercase + Numbers
- Entropy: 60+ bits
For Sensitive Accounts (Email, Banking):
- Length: 16+ characters
- Mix: Upper + Lower + Numbers + Special
- Entropy: 80+ bits
For Critical Systems (Admin, Root):
- Length: 20+ characters
- Mix: All character types
- Entropy: 100+ bits
- Consider passphrases instead
Password Strength Examples
Weak (Don't use):
- "password123"
- "qwerty"
- "abc123def456"
Good (16 chars, mixed):
- "aBcDeFgHiJkLmNoP"
- "K7mP9xQwRtYuAsJd"
Strong (20 chars, all types):
- "aB7!cD9@eF3#gH5$jK2%"
- "Xk2@Lm8$Np4!QrWs6^Yz"
Security Best Practices
Storing Passwords
DO:
- ✅ Use password manager (1Password, Bitwarden, KeePass)
- ✅ Store in encrypted vault
- ✅ Use different password per account
- ✅ Store generated passwords immediately after creation
DON'T:
- ❌ Write passwords on paper (easily found)
- ❌ Share passwords via email or chat
- ❌ Reuse passwords across accounts
- ❌ Store in plain text files
- ❌ Take screenshots of passwords
Using Generated Passwords
- Generate - Create strong password
- Copy - Use Copy button immediately
- Paste - Paste into password field
- Verify - Confirm password accepted
- Store - Save to password manager
- Test - Log out and log back in with new password
Regular Updates
- Change critical passwords quarterly
- Update after security incidents
- Rotate old passwords that you remember
- Generate new passwords using this tool
- Store in password manager with encryption
Troubleshooting
Issue: "Module tkinter not found" (GUI)
Solution:
# Install tkinter
# Ubuntu/Debian
sudo apt-get install python3-tk
# RHEL/CentOS
sudo dnf install python3-tkinter
# macOS
brew install python3-tk
# Windows: Reinstall Python, check "Install tcl/tk"
Issue: Permission Denied on Linux/macOS
Solution:
chmod u+x *.py
python3 cli.py # Run with python3 explicitly
Issue: Characters Not Generating Correctly
Solution:
# Check Python version
python3 --version # Should be 3.6+
# Verify secrets module
python3 -c "import secrets; print(secrets.token_hex())"
Issue: GUI Window Not Opening
Solution:
# Check for display issues
echo $DISPLAY # On Linux/X11
# Run explicitly with Python
python3 gui.py
# Try headless mode
DISPLAY="" python3 cli.py # Use CLI instead
Deployment Options
Distribution
As Executable:
# Using PyInstaller
pip install pyinstaller
pyinstaller --onefile gui.py
# Distributable executable in dist/ folder
As Python Package:
# Create setup.py
python3 setup.py bdist_wheel
pip install dist/passwordgenerator-*.whl
As Docker Container:
FROM python:3.9-slim
WORKDIR /app
COPY . .
CMD ["python3", "cli.py"]
Performance
- CLI Generation: <5ms per password
- GUI Response: <100ms (user visible)
- Batch 1000 Passwords: <2 seconds
- Memory Usage: <20MB typical
- CPU Usage: Minimal, <1% per operation
Conclusion
The Password Generator is a simple, fast, and secure tool for creating strong passwords locally and privately. Whether you prefer the ease of a GUI or the power of CLI, this tool provides reliable password generation for all your security needs. By keeping this tool offline and self-contained, you maintain complete control over your password generation process.
Additional Resources
- GitHub Repository
- Python secrets Module
- OWASP Password Guidelines
- EFF Passphrase Generator
- Bitwarden Password Manager
License: MIT (Open Source)
Maintained By: BHATOL Community
Latest Version: 1.5.0
Python Required: 3.6+