A simple Python script that generates secure passwords and evaluates their strength.
- Customizable Password Generation: Specify minimum length and character types
- Strength Analysis: Automatically checks password security level
- Color-coded Ratings: Visual feedback with green/yellow/red indicators
- Simple Interface: User-friendly command-line prompts
- Combines letters (uppercase and lowercase)
- Optionally includes numbers and special characters
- Ensures all selected character types are included
- Continues generating until minimum length is met
Passwords are rated out of 5 points:
| Criteria | Points |
|---|---|
| Length ≥ 12 characters | 2 points |
| Length ≥ 8 characters | 1 point |
| Contains both upper & lowercase | 1 point |
| Contains numbers | 1 point |
| Contains special characters | 1 point |
- STRONG (5/5): Excellent security
- MEDIUM (3-4/5): Good, but could be improved
- WEAK (0-2/5): Needs enhancement
-
Run the script:
python password_gen.py
-
Follow the prompts:
Enter the minimum length: 12 Do you want to have numbers (y/n)? y Do you want to have special characters (y/n)? y -
View the results:
Generated password: A9b$kL8@qR2! ================================================== PASSWORD STRENGTH ANALYSIS: ------------------------------ Strength: STRONG (5/5)
- Python 3.6+
- No external dependencies (uses standard library only)
generate_password(): Creates passwords based on user criteriacheck_password_strength(): Analyzes password security- Main section: Handles user input and displays results
Generated password: p7@Gm2#Kn9!
==================================================
PASSWORD STRENGTH ANALYSIS:
------------------------------
Strength: MEDIUM (4/5)
- Passwords are generated using Python's
randommodule - No passwords are stored or transmitted
- Generated passwords meet minimum security criteria