A professional, secure password generator tool built with Python, featuring both CLI and GUI interfaces. This tool uses cryptographically strong random number generation to create secure passwords for your applications and accounts.
Author: RIFINOO
License: MIT License
- Cryptographically Strong: Uses Python's
secretsmodule (notrandom) for secure password generation - Customizable: Control password length and character types (uppercase, lowercase, numbers, special characters)
- Guaranteed Character Types: Ensures at least one character from each selected type is included
- Password Strength Checker: Comprehensive analysis of password strength with detailed feedback
- Entropy Calculation: Shows password entropy in bits for security assessment
- Strength Scoring: 6-point scoring system with detailed feedback
- Interactive CLI: Beautiful menu-driven interface with Rich and Questionary (arrow key navigation)
- CLI Version: Command-line interface using
argparsefor terminal usage - GUI Version: Modern desktop interface using CustomTkinter with dark theme
- Clipboard Integration: One-click copy to clipboard (requires
pyperclip) - Logging: Event logging without storing passwords (security-first approach)
- PEP 8 Compliant: Clean, professional code following Python style guidelines
- Python 3.7 or higher
- pip (Python package manager)
- See
requirements.txtfor dependencies
-
Clone or download this repository:
git clone https://github.com/ps-xx/Password-generator.git cd password-generator -
Create a virtual environment:
# On Windows python -m venv .venv .venv\Scripts\activate # On macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Clone or download this repository:
git clone https://github.com/ps-xx/Password-generator.git cd password-generator -
Install dependencies:
pip install -r requirements.txt
Check that all packages are installed correctly:
pip listYou should see:
richquestionarypyfigletpyperclipcustomtkinter(for GUI version)
After installation, you can run any of the three interfaces:
- Interactive CLI (Recommended):
python main.py - Command-line CLI:
python cli.py --length 16 - GUI Version:
python gui.py
Launch the beautiful interactive menu-driven interface:
# If using virtual environment, make sure it's activated first
python main.py
# Or on some systems
python3 main.pyFeatures:
- π¨ Beautiful terminal UI with Rich library (colors, panels, tables)
- β¨οΈ Arrow key navigation using Questionary
- π Generate passwords with visual strength meter
- βοΈ Interactive settings menu
- π Automatic clipboard copying option
- π Real-time entropy and strength analysis
How to Use:
- Run
python main.pyto start the interactive interface - Use arrow keys (ββ) or
j/kkeys to navigate menus - Select "π Generate Password" to create a new password
- Use "βοΈ Settings" to customize:
- Password length (4-128 characters)
- Toggle character types (Uppercase, Lowercase, Numbers, Special)
- Enable/disable auto-copy to clipboard
- View password strength analysis with visual meter
- Copy password to clipboard (automatic or on-demand)
Screenshot:
Note: Add your screenshot image to the screenshots/ folder and update the filename above.
Basic Usage:
Generate a password with default settings (16 characters, all character types):
python cli.pyAdvanced Usage:
Generate a custom password:
python cli.py --length 20Generate without special characters:
python cli.py --length 16 --no-specialGenerate and copy to clipboard:
python cli.py --length 24 --copyCheck password strength:
python cli.py --length 16 --check-strengthShow entropy:
python cli.py --length 16 --entropy-l, --length Password length (default: 16, minimum: 4)
--no-uppercase Exclude uppercase letters
--no-lowercase Exclude lowercase letters
--no-numbers Exclude numbers
--no-special Exclude special characters
-c, --copy Copy password to clipboard
--check-strength Display password strength analysis
--entropy Display password entropy
Launch the graphical interface:
python gui.pyNote: Make sure you have a display/GUI environment available (not suitable for headless servers).
The GUI provides:
- Slider for password length (4-64 characters)
- Checkboxes for character type selection
- Real-time password strength analysis
- One-click copy to clipboard
- Modern dark theme interface
Issue: ModuleNotFoundError
# Solution: Make sure all dependencies are installed
pip install -r requirements.txtIssue: pyfiglet font not found
# Solution: pyfiglet will use fallback fonts automatically
# Or install additional fonts: pip install pyfiglet[fonts]Issue: Clipboard not working (Windows)
# Solution: Make sure pyperclip is installed correctly
pip install --upgrade pyperclipIssue: GUI not opening
# Solution: Make sure customtkinter is installed
pip install customtkinter
# On Linux, you may need: sudo apt-get install python3-tkIMPORTANT SECURITY NOTES:
-
Password Storage: This tool does NOT store, save, or log the generated passwords. Only generation events are logged (without password content).
-
Cryptographic Security: This tool uses Python's
secretsmodule, which is designed for cryptographically strong random number generation suitable for security-sensitive applications. -
Best Practices:
- Use passwords of at least 12-16 characters for general use
- Use passwords of 20+ characters for high-security applications
- Enable all character types for maximum security
- Never share your passwords
- Use a password manager to store generated passwords securely
- Change passwords regularly
-
Entropy Guidelines:
- 40-60 bits: Weak (not recommended)
- 60-80 bits: Moderate (acceptable for low-security)
- 80+ bits: Strong (recommended for most uses)
- 100+ bits: Very Strong (recommended for high-security)
-
Limitations: While this tool generates cryptographically strong passwords, the security of your accounts also depends on:
- Secure storage of passwords
- Protection against phishing attacks
- Using unique passwords for each account
- Enabling two-factor authentication when available
The strength checker evaluates passwords on a 6-point scale:
- 6 points: Very Strong
- 4-5 points: Strong
- 2-3 points: Moderate
- 1 point: Weak
- 0 points: Very Weak
Factors considered:
- Password length
- Character variety (uppercase, lowercase, numbers, special)
- Entropy calculation
password-generator/
βββ generator.py # Core password generation module (used by all interfaces)
βββ main.py # Interactive CLI entry point (run: python main.py)
βββ cli.py # Command-line CLI entry point (run: python cli.py)
βββ gui.py # GUI entry point (run: python gui.py)
βββ password_generator.py # Legacy core module (deprecated - use generator.py)
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # MIT License
βββ .gitignore # Git ignore rules
βββ password_generator.log # Log file (generated at runtime, ignored by git)
- Follows PEP 8 style guidelines
- Type hints where appropriate
- Comprehensive docstrings
- Error handling and logging
Logs are written to both:
- Console output
password_generator.logfile
Note: Passwords are NEVER logged for security reasons.
MIT License - See LICENSE file for details
Contributions are welcome! Please ensure:
- Code follows PEP 8 guidelines
- Security best practices are maintained
- Tests are included for new features
- Documentation is updated
This software is provided "as is" without warranty of any kind. The authors are not responsible for any security breaches or data loss resulting from the use of this tool. Always follow security best practices and use this tool responsibly.
For questions or issues, please open an issue on the repository.
Remember: A strong password is only one part of good security hygiene. Always use unique passwords, enable 2FA when available, and stay vigilant against phishing and social engineering attacks.
