A secure command-line password generator written in Python that uses the secrets module for cryptographically strong password generation.
- Cryptographically secure random generation using Python's
secretsmodule - Customizable password length
- Includes uppercase, lowercase, digits, and special characters
- Input validation with error handling
- Option to generate multiple passwords in one session
- Python 3.x
No external libraries needed β only built-in Python modules are used.
python New.py- Run the script
- Enter the desired password length when prompted
- Your secure password will be generated and displayed
- Choose whether to generate another password or exit
How many characters do you want in your password? 16
g#Km2@Xv!pL9qR4&
Try again? (y/n): n
Thanks for using this!
- Builds a character pool from uppercase letters, lowercase letters, digits, and special characters
- Uses
secrets.choice()to pick each character independently and randomly - Joins the characters into a final password string
secretsis used instead ofrandomfor stronger, cryptographically secure randomness β making it suitable for actual password generation- Passwords are never stored or logged anywhere
This project is licensed under the MIT License. See the LICENSE file for details.
Built as a Python learning project π
(Current Objectives: Enhance user experience by usinh time module through adding time.sleep later)