|
1 | | -# PWDMNGR - A password manager |
2 | | - |
3 | | -## Description |
4 | | - |
5 | | -A simple password management tool written in the C programming language. Stores data in an SQLite database. Runs on Linux. |
6 | | -Written for learning purposes. |
7 | | - |
8 | | -Requires user registration and login. If the user provides incorrect credentials for login it'll be notified which one is incorrect. |
9 | | - |
10 | | -Provides options for: |
11 | | - |
12 | | - * Password generation |
13 | | - * Save, edit, delete accounts |
14 | | - * List of all user accounts |
15 | | - |
16 | | -User can choose whether he wants to use a generated password for creating and editing an account or to provide one. |
17 | | -If the user tries to use a generated password that hasn't been generated yet, it will be notified and the changes won't be saved. |
18 | | -Memory management is also handled in this situation. |
19 | | - |
20 | | -To generate a password, the user can choose several options: |
21 | | - |
22 | | - * Password length |
23 | | - * Type of characters (uppercase and lowercase letters, numbers, and/or special characters) |
24 | | - - at least one character type must be included |
25 | | - |
26 | | -If the user tries to edit an unexisting account it will be notified. |
27 | | -If the user tries to delete an unexisting account it will fail silently. |
28 | | - |
29 | | -An account is used to store information about user accounts across the web. Contains: |
30 | | - |
31 | | - * Site name |
32 | | - * Username |
33 | | - * Password |
34 | | - |
35 | | -After the application is started, valgrind-out.txt will be created, and after closing the application the memory information will be available. |
36 | | - |
37 | | -## Files |
38 | | - |
39 | | -The application includes the following source files and their corresponding header files: |
40 | | - |
41 | | - * main.c - contains the main function that handles database connection, |
42 | | - and provides option selection for register/login and account manipulation. |
43 | | - * application.c and application.h - contain functions for handling selected options |
44 | | - * database.c and database.h - contain functions for the database manipulation |
45 | | - * helper.c and helper.h - contain helper functions for getting user input, freeing memory, and hashing a password |
46 | | - * user.c and user.h - contains user information data |
47 | | - * account.c and account.c - account information |
48 | | - |
49 | | -It also includes the database.sql file for creating the database and the Makefile for compilation. |
50 | | - |
51 | | -## Requirements and installation |
52 | | - |
53 | | - * Install gcc and GNU Make if not already installed |
54 | | - * Make sure openssl/evp.h is present on the system |
55 | | - * Install sqlite3 and libsqlite3-dev and compile sqlite3.h |
56 | | - * Run 'sqlite3 pwdmngr.db' -> run '.read database.sql' |
57 | | - * For checking memory leaks and errors run: |
58 | | - valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt ./main -lsqlite3 |
| 1 | +# pwdmngr |
| 2 | + |
| 3 | +A simple password management tool written in **C** that uses **SQLite** for data storage. Developed for **Linux** systems as a learning project. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- User registration and login system with credential validation |
| 8 | +- Password generation with customizable options: |
| 9 | + - Configurable password length |
| 10 | + - Character type selection |
| 11 | +- Account management: |
| 12 | + - Save new accounts |
| 13 | + - Edit existing accounts |
| 14 | + - Delete accounts |
| 15 | + - List all stored accounts |
| 16 | +- Option to use generated passwords or custom ones |
| 17 | +- Memory leak detection through Valgrind integration |
| 18 | + |
| 19 | +## Project Structure |
| 20 | + |
| 21 | +The application includes the following files: |
| 22 | + |
| 23 | +| Source Files | Header Files | Description | |
| 24 | +|--------------|--------------|-------------| |
| 25 | +| main.c | - | Main program entry point, handles database connection and option selection | |
| 26 | +| application.c | application.h | Functions for handling user-selected options | |
| 27 | +| database.c | database.h | Database manipulation functions | |
| 28 | +| helper.c | helper.h | Utility functions for user input, memory management, and password hashing | |
| 29 | +| user.c | user.h | User information data structure and operations | |
| 30 | +| account.c | account.h | Account information data structure and operations | |
| 31 | + |
| 32 | +Additional files: |
| 33 | +- `database.sql`: SQL schema for database creation |
| 34 | +- `Makefile`: Builds the project |
| 35 | + |
| 36 | +## Error Handling |
| 37 | + |
| 38 | +- Provides clear notifications for login errors, specifying which credential is incorrect |
| 39 | +- Attempting to use an ungenerated password will notify the user and cancel changes |
| 40 | +- Trying to edit a non-existent account will show a warning |
| 41 | +- Deleting a non-existent account fails silently |
| 42 | +- Memory is managed properly in all edge cases |
| 43 | + |
| 44 | +## Requirements & Installation |
| 45 | + |
| 46 | +1. Install required dependencies: |
| 47 | + - `gcc`, `make` |
| 48 | + - `openssl` (check for `openssl/evp.h`) |
| 49 | + - `sqlite3`, `libsqlite3-dev` |
| 50 | + |
| 51 | +2. Initialize the database: |
| 52 | + |
| 53 | + ```bash |
| 54 | + sqlite3 pwdmngr.db < database.sql |
| 55 | + ``` |
| 56 | + |
| 57 | + Alternatively: |
| 58 | + ```bash |
| 59 | + sqlite3 pwdmngr.db |
| 60 | + .read database.sql |
| 61 | + .exit |
| 62 | + ``` |
| 63 | + |
| 64 | +3. Build and run the application: |
| 65 | + |
| 66 | + ```bash |
| 67 | + make |
| 68 | + ./main |
| 69 | + ``` |
| 70 | + |
| 71 | +4. (Optional) Run with Valgrind for memory leak detection: |
| 72 | + ```bash |
| 73 | + valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind.txt ./main -lsqlite3 |
| 74 | + ``` |
| 75 | + |
| 76 | + Results will be available in `valgrind.txt` after exiting the application. |
0 commit comments