A secure password management system built with Java, featuring client-server architecture and robust encryption.
- Project Structure
- Architecture
- Database
- Logging
- Security
- Session Management
- Data Formatting
- Features
The client logic is located in the client package and the server logic in the server package.
For executing different commands, a functional interface Command with a single execute method was implemented. All implementations of this interface are located in the console package.
- Command Validation: All commands use methods from the
validationpackage, also found inconsole. - CommandExecutor: Used for selecting the correct command from the client (in the same package as the commands).
Due to the frequent reuse of responses, command names, and error messages, enums are used to maintain consistency across the codebase and in tests, keeping the code cleaner.
Responsible for:
- Creating personal user files where passwords for different sites are stored
- Querying these files for password retrieval
Handles:
- Database operations
- Registering new users
- Checking for existing users
Responsible for logging serious errors during execution. To avoid burdening clients with technical details, they only receive error messages while the actual details are logged.
- Uses an enum for exception types (user and system exceptions)
- Custom RuntimeExceptions created for more detailed error descriptions and to catch them in specially designated blocks
Contains the class for making requests to the Enzoic API for checking password validity against known breaches.
Contains the class used for encrypting user passwords for different sites.
Key Features:
- Uses a special encryption algorithm (PBKDF2) that utilizes the user's password and username
- No need to store encryption keys for all users
- If a user forgets their master password, their data cannot be accessed (security by design)
Contains the class that generates secure passwords.
Implementation:
- Uses
SecureRandom(non-deterministic) instead of regularRandom - More reliable and cryptographically secure
- Generated passwords are validated using the password validation class
Contains a class for SHA-256 hashing, used for hashing master user passwords.
Used primarily to track which users are currently logged in to the system.
Contains a class used for converting to/from JSON format. All data written to files is stored in JSON format for easy parsing and readability.
Special records are used throughout the project for data transfer:
ErrorLog- for ErrorLoggerLogin- for DatabaseManagerProfile- for FilesManager
- Secure password storage with military-grade encryption
- Password generation using cryptographically secure random
- Master password hashing with SHA-2560
- Password validation via Enzoic API
- User session management
- Comprehensive error logging
- JSON-based data storage
- Client-server architecture that allows 10 parallel clients
- User-friendly command-line interface
- Unit tests with Junit 6 and Mockito