A secure, command-line Password Manager written in Java. It allows you to safely store, generate, and manage your credentials with strong encryption and modern security features.
- Features
- Security Notes
- Prerequisites
- Technologies Used
- TOTP QR Code Generation
- Installation
- Usage
- Running Tests
- File Structure
- Contributing
- License
- Disclaimer
- Password Generation: Option to automatically generate strong passwords with customizable length and character sets.
- Password Breach Verification: Generated passwords are checked against breach databases (like HaveIBeenPwned) to ensure they haven't been compromised.
- Password Security:
- Encryption of stored passwords using industry-standard algorithms (AES-256).
- Integration with HaveIBeenPwned API to check for compromised passwords.
- Secure clipboard operations for password copying (clipboard is cleared after a short period).
- User-Friendly Interface: Command-line interface with clear menu options for adding, retrieving, updating, and deleting credentials.
- Two-Factor Authentication (2FA): Support for TOTP (Time-based One-Time Password) for enhanced account security.
- Master Password: Protects access to all stored credentials.
- Audit and Breach Check: Easily check if your passwords have been exposed in known data breaches.
- Advanced Encryption: All stored credentials are secured using AES-GCM for authenticated encryption.
- Input Sanitization: User-provided input is rigorously validated to prevent injection attacks or unsafe inputs.
- Sensitive Data Cleanup: Mechanisms are in place to clear encryption keys and sensitive data from memory when the application shuts down.
- The master password is never stored; only a hash is kept using BCrypt.
- Clipboard operations are cleared after a short timeout to prevent leaks.
- Passwords are never logged or displayed in plain text.
- Java Development Kit (JDK) 22 or higher
- Maven 3.6.0 or higher
- Git (optional, for version control)
- Java 22: Core programming language
- Maven: Project management and build tool
- Dependencies:
- jBCrypt: For password hashing
- Gson: For JSON serialization
- Apache Commons Codec: For encoding/decoding utilities
- JUnit 5: For unit testing
To easily set up Two-Factor Authentication (2FA) with authenticator apps (like Google Authenticator, Microsoft Authenticator, or Authy), you can convert your TOTP URL into a QR code using one of the following free online tools:
- https://www.qr-code-generator.com/
- https://www.the-qrcode-generator.com/
- https://www.qrstuff.com/
- https://www.unitag.io/qrcode
- https://www.google.com/chart?cht=qr&chs=300x300&chl=YOUR_TOTP_URL (replace
YOUR_TOTP_URLwith your actual TOTP URL)
Instructions:
- Copy your TOTP URL (e.g.,
otpauth://totp/YourApp:username?secret=BASE32SECRET&issuer=YourApp). - Paste it into one of the QR code generator websites above.
- Scan the generated QR code with your authenticator app.
-
Clone the repository:
git clone https://github.com/tatilimongi/Secure_Password_Manager.git cd Secure_Password_Manager -
Build the project with Maven:
mvn clean package
The executable JAR will be generated in the
target/directory.
-
Run the application:
java -jar target/secure-password-manager-1.0-SNAPSHOT-jar-with-dependencies.jar
-
First-time setup:
- You will be prompted to create a master password. This password is required to access your credentials.
-
Two-Factor Authentication (2FA):
- Set up TOTP for an extra layer of security. Store your TOTP secret securely.
-
Main menu options:
- List all credentials
- Add new credential
- Delete a credential
- Copy password to clipboard
- Check if any password has been compromised
- Exit
-
Password Generation:
- Choose password length and character types (uppercase, lowercase, digits, symbols).
-
Password Breach Check:
- Choose a credential to check if the password has been exposed in known data breaches using the HaveIBeenPwned API.
To run all unit tests:
mvn testsrc/main/java/- Application source codesrc/test/java/- Unit teststarget/- Compiled binaries and packaged JARs
Contributions are welcome! Please fork the repository and submit a pull request. For major changes, open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
This project is for educational purposes. Use at your own risk. Always back up your credentials and never share your master password.