A Python secure password generator that creates unique passwords of length 12, 16, or 20, always including lowercase, uppercase, digits, and special characters, with non-repeating sequences until all combinations are exhausted.
A secure password generator built in Python that creates cryptographically strong passwords with guaranteed character diversity.
- Cryptographically Secure: Uses Python's
secrets
module for true randomness - Character Diversity: Every password contains at least one lowercase, uppercase, digit, and special character
- Multiple Lengths: Supports 12, 16, and 20 character passwords
- Duplicate Prevention: Tracks generated passwords to avoid repeats
- Simple CLI Interface: Easy-to-use command line interface
- Clone this repository:
git clone <your-repo-url>
cd genienigma
- No additional dependencies required - uses only Python standard library
Run the password generator:
python genienigma.py
Follow the prompts to select your desired password length (12, 16, or 20 characters).
Secure Password Generator
Available lengths: 12, 16, 20
Enter password length (or 0 to quit): 16
Generated Password: K7$mP9qX&nE2vL4z
- Lowercase: a-z (26 characters)
- Uppercase: A-Z (26 characters)
- Digits: 0-9 (10 characters)
- Special: !@#$%^&*()_+-=[]{}|;:,.<>? (23 characters)
Total character pool: 85 characters
Uses secrets.choice()
and secrets.SystemRandom().shuffle()
for cryptographically secure random number generation, suitable for security-sensitive applications.
Each password is guaranteed to contain:
- At least 1 lowercase letter
- At least 1 uppercase letter
- At least 1 digit
- At least 1 special character
The generator tracks all previously generated passwords and ensures no duplicates are returned until all possible combinations are exhausted.
__init__()
: Initializes character sets and trackinggenerate_password(length)
: Creates a new unique passwordcalculate_max_combinations(length)
: Estimates total possible passwords
Provides the command-line interface for user interaction.
Password Generation Algorithm:
- Select one character from each required category
- Fill remaining positions with random characters from all sets
- Shuffle the entire password to randomize positions
- Check uniqueness against previously generated passwords
- Return the password if unique, otherwise retry
Supported Lengths: 12, 16, 20 characters Platform: Cross-platform (Windows, macOS, Linux) Python Version: 3.6+
- Uses cryptographically secure random number generation
- No password storage or logging
- Passwords are only displayed once and not saved
- Memory is cleared when the program exits
Feel free to submit issues and enhancement requests. Pull requests are welcome.
GNU General Public License v3.0
This tool generates passwords for legitimate security purposes. Users are responsible for following their organization's password policies and security guidelines.