This is a Python-based Random Password Generator application with added functionality to save the generated passwords securely to Firebase Firestore or a local text file. You can also decrypt passwords if the encryption key is provided.
- Generate strong, random passwords with customizable length.
- Save passwords either to Firebase Firestore or a text file.
- Encrypt passwords with a randomly generated key.
- Decrypt passwords securely.
- Track password complexity (Weak, Moderate, Strong).
- Specify the platform for which the password is generated.
Firebase is a platform developed by Google for creating mobile and web applications. It includes services like databases, authentication, analytics, and more. In this project, we use Firebase Firestore to store generated passwords securely.
- Go to the Firebase Console.
- Click on Add Project and follow the steps to create a new project.
- Navigate to the Build menu on the left-hand side and select Firestore Database.
- Click on Create Database and choose Start in production mode.
- Select your preferred Cloud Firestore location and click Enable.
- Go to the Project Settings (gear icon) in the Firebase Console.
- Click on the Service Accounts tab.
- Click Generate new private key to download the JSON key file.
- Save the key file in your project directory (e.g.,
password-generator-firebase-adminsdk.json).
-
Python 3.10 or above installed on your system.
-
Install the required Python libraries:
pip install cryptography firebase-admin
To run the program, follow these steps:
-
Clone the Repository:
git clone https://github.com/methedjangoguy/passwordGenerator.git cd passwordGenerator -
Place your Firebase Service Account Key JSON file in the
./passwordGenerator/creds/directory. -
Update the cred path in the config.json:
{ "credPath": "passwordGenerator/creds/yourkey.json" } -
Run the Program:
python main.py
-
Generate and Save a Password to Firebase Firestore.
Would you like to (1) Generate a new password or (2) Decrypt an existing password? (Enter 1 or 2): 1 Enter the desired length of the password (minimum 4): 6 Enter the platform for which this password is being generated (e.g., Gmail, AWS, etc.): AWS Generated Password: G.. Password Complexity: Strong Encrypted Password: gAAAAABnfMk..... Where would you like to save the password? (1) Firebase or (2) Text File: 1 Password details saved to Firebase in the 'passwords' collection.
-
Generate and Save a Password to local text file.
Would you like to (1) Generate a new password or (2) Decrypt an existing password? (Enter 1 or 2): 1 Enter the desired length of the password (minimum 4): 6 Enter the platform for which this password is being generated (e.g., Gmail, AWS, etc.): AWS Generated Password: G.. Password Complexity: Strong Encrypted Password: gAAAAABnfMk..... Where would you like to save the password? (1) Firebase or (2) Text File: 2 Password details saved to the text file 'passwords.txt'.
-
Decrypt a Password
Would you like to (1) Generate a new password or (2) Decrypt an existing password? (Enter 1 or 2): 2 Enter the encrypted password: gAAAAABk123456... Enter the encryption key: v9c13sOpq... Decrypted Password: @4Tk9x!a%Ykq
-
Exiting the Program
CTRL+C Execution stopped by user: username. Goodbye!
Ensure that your Firebase credentials are not exposed in public repositories. Add them to .gitignore if you plan to share the project. For local storage, all passwords are saved in passwords.txt within the same directory.
Feel free to fork and contribute to this project!
This project is licensed under the MIT License. See the LICENSE file for details.