A simple password management tool written in C that uses SQLite for data storage. Developed for Linux systems as a learning project.
- User registration and login system with credential validation
- Password generation with customizable options:
- Configurable password length
- Character type selection
- Account management:
- Save new accounts
- Edit existing accounts
- Delete accounts
- List all stored accounts
- Option to use generated passwords or custom ones
- Memory leak detection through Valgrind integration
The application includes the following files:
| Source Files | Header Files | Description |
|---|---|---|
| main.c | - | Main program entry point, handles database connection and option selection |
| application.c | application.h | Functions for handling user-selected options |
| database.c | database.h | Database manipulation functions |
| helper.c | helper.h | Utility functions for user input, memory management, and password hashing |
| user.c | user.h | User information data structure and operations |
| account.c | account.h | Account information data structure and operations |
Additional files:
database.sql: SQL schema for database creationMakefile: Builds the project
- Provides clear notifications for login errors, specifying which credential is incorrect
- Attempting to use an ungenerated password will notify the user and cancel changes
- Trying to edit a non-existent account will show a warning
- Deleting a non-existent account fails silently
- Memory is managed properly in all edge cases
-
Install required dependencies:
gcc,makeopenssl(check foropenssl/evp.h)sqlite3,libsqlite3-dev
-
Initialize the database:
sqlite3 pwdmngr.db < database.sqlAlternatively:
sqlite3 pwdmngr.db .read database.sql .exit
-
Build and run the application:
make ./main
-
(Optional) Run with Valgrind for memory leak detection:
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind.txt ./main -lsqlite3
Results will be available in
valgrind.txtafter exiting the application.