A simple and secure password generator with the option to send the generated password via email. This project demonstrates the use of Python's tkinter
for a graphical user interface and smtplib
for sending emails.
-
Password Generation:
- Generate random passwords with customizable length and character sets (uppercase letters, digits, special characters).
- Copy the generated password to the clipboard.
-
Email Integration:
- Send the generated password to a specified email address.
- Python 3.12 or higher
- Tkinter (included with standard Python installation)
python-dotenv
(for environment variable management)
-
Clone the repository:
git clone https://github.com/yourusername/password-generator.git cd password-generator
-
Install the required Python packages:
pip install python-dotenv
-
Create a
.env
file in the root directory of the project to store your email credentials. The file should contain:[email protected] EMAIL_PASSWORD=your_app_password
Replace
[email protected]
with your email address andyour_app_password
with your application-specific password or API key. For Gmail users, you may need to generate an App Password if you have 2FA enabled. -
Run the application:
python src/gui.py
- Length: Enter the desired length of the password.
- Character Sets:
- Uppercase Letters: Include uppercase letters in the password.
- Digits: Include digits in the password.
- Special Characters: Include special characters in the password.
- Click "Generate" to create a password.
- Click "Copy" to copy the generated password to the clipboard.
- Enter the recipient's email address in the "Email" field.
- Click "Send to Email" to send the generated password to the specified email address.
src/gui.py
: The Python script for the graphical user interface.src/main.py
: Contains the password generation logic and email sending function..env
: Environment file containing email credentials (not included in version control).README.md
: This README file.requirements.txt
: Lists all the dependencies required by the project (optional).
This project is licensed under the MIT License.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
For any inquiries, please contact [email protected].