Welcome to the Random Password Generator page.
This page contains a brief description and implementation instructions for the project.
Project Description
Generates a strong random password. The user specifies length and character types (letters, digits, punctuation). The program uses Python’s random
module and string
constants (ascii_letters
, digits
, punctuation
) to build a random password.
Project Requirements
Python 3.x (random
and string
modules, both built-in).
How to Run the Project
- Create a script (e.g.
password_gen.py
) that asks for the desired length and character sets to include. - Run it:
python password_gen.py
. Enter options (e.g. include letters/digits/symbols). The program outputs a generated password.
Key Concepts Learned
- Random Choice: Using
random.choice()
orrandom.choices()
to pick random characters. - String Constants: Utilizing
string.ascii_letters
,string.digits
,string.punctuation
to define character pools. - Loops: Building the password character by character.
- User Input: Collecting preferences (length, types).
- Security Considerations: Understanding what makes a password strong (length and variety).
Possible Extensions
- Avoid ambiguous characters (like O/0, l/1).
- Enforce at least one character from each chosen category.
- Provide multiple passwords at once.
- Add a GUI or web interface.