Skip to content

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.

License

Notifications You must be signed in to change notification settings

ps-xx/Password-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Professional Password Generator

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.

Password Generator

Author: RIFINOO
License: MIT License

✨ Features

Core Functionality

  • Cryptographically Strong: Uses Python's secrets module (not random) 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

Advanced Security Features

  • 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

Interface Options

  • Interactive CLI: Beautiful menu-driven interface with Rich and Questionary (arrow key navigation)
  • CLI Version: Command-line interface using argparse for terminal usage
  • GUI Version: Modern desktop interface using CustomTkinter with dark theme

Professional Features

  • 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

πŸ“‹ Requirements

  • Python 3.7 or higher
  • pip (Python package manager)
  • See requirements.txt for dependencies

πŸš€ Installation

Method 1: Using Virtual Environment (Recommended)

  1. Clone or download this repository:

    git clone https://github.com/ps-xx/Password-generator.git
    cd password-generator
  2. Create a virtual environment:

    # On Windows
    python -m venv .venv
    .venv\Scripts\activate
    
    # On macOS/Linux
    python3 -m venv .venv
    source .venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

Method 2: Direct Installation

  1. Clone or download this repository:

    git clone https://github.com/ps-xx/Password-generator.git
    cd password-generator
  2. Install dependencies:

    pip install -r requirements.txt

Verify Installation

Check that all packages are installed correctly:

pip list

You should see:

  • rich
  • questionary
  • pyfiglet
  • pyperclip
  • customtkinter (for GUI version)

πŸ’» Usage

Quick Start

After installation, you can run any of the three interfaces:

  1. Interactive CLI (Recommended): python main.py
  2. Command-line CLI: python cli.py --length 16
  3. GUI Version: python gui.py

Interactive CLI Version (Recommended)

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.py

Features:

  • 🎨 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:

  1. Run python main.py to start the interactive interface
  2. Use arrow keys (↑↓) or j/k keys to navigate menus
  3. Select "πŸ”‘ Generate Password" to create a new password
  4. Use "βš™οΈ Settings" to customize:
    • Password length (4-128 characters)
    • Toggle character types (Uppercase, Lowercase, Numbers, Special)
    • Enable/disable auto-copy to clipboard
  5. View password strength analysis with visual meter
  6. Copy password to clipboard (automatic or on-demand)

Screenshot:

Interactive CLI Screenshot

Note: Add your screenshot image to the screenshots/ folder and update the filename above.

CLI Version

Basic Usage:

Generate a password with default settings (16 characters, all character types):

python cli.py

Advanced Usage:

Generate a custom password:

python cli.py --length 20

Generate without special characters:

python cli.py --length 16 --no-special

Generate and copy to clipboard:

python cli.py --length 24 --copy

Check password strength:

python cli.py --length 16 --check-strength

Show entropy:

python cli.py --length 16 --entropy

CLI Options

-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

GUI Version

Launch the graphical interface:

python gui.py

Note: 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

πŸ”§ Troubleshooting

Common Issues

Issue: ModuleNotFoundError

# Solution: Make sure all dependencies are installed
pip install -r requirements.txt

Issue: 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 pyperclip

Issue: GUI not opening

# Solution: Make sure customtkinter is installed
pip install customtkinter
# On Linux, you may need: sudo apt-get install python3-tk

πŸ”’ Security Disclaimer

IMPORTANT SECURITY NOTES:

  1. Password Storage: This tool does NOT store, save, or log the generated passwords. Only generation events are logged (without password content).

  2. Cryptographic Security: This tool uses Python's secrets module, which is designed for cryptographically strong random number generation suitable for security-sensitive applications.

  3. 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
  4. 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)
  5. 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

πŸ“Š Password Strength Scoring

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

πŸ“ Project Structure

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)

πŸ› οΈ Development

Code Quality

  • Follows PEP 8 style guidelines
  • Type hints where appropriate
  • Comprehensive docstrings
  • Error handling and logging

Logging

Logs are written to both:

  • Console output
  • password_generator.log file

Note: Passwords are NEVER logged for security reasons.

πŸ“ License

MIT License - See LICENSE file for details

🀝 Contributing

Contributions are welcome! Please ensure:

  • Code follows PEP 8 guidelines
  • Security best practices are maintained
  • Tests are included for new features
  • Documentation is updated

⚠️ Disclaimer

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.

πŸ“§ Contact

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages