Programming Project - Password Manager (UPDATED DOCUMENTATION)
Programming Project - Password Manager (UPDATED DOCUMENTATION)
COMPUTER PROGRAMMING I
CONTENTS
1. INTRODUCTION
3. FEATURES CONTENT
5. HOW AI HELPED
1
Introduction
2
Encryption and Security Features
File Operations
Passwords are saved to and loaded from a binary file (passwords.dat). The
file operations include:
3
● Reading and verifying the metadata and records during the loading
process to check for potential corruption or version mismatches.
User Interface
Error Handling
4
resources like the mutex and backup thread. The atexit function is used to
register the cleanup process, ensuring it's executed even in the event of an
abnormal termination.
5
Features Content
Implemented Topics:
1. Threads
2. Linked Lists
Linked Lists are employed for storing and managing passwords. Each
password record (PasswordNode) is represented as a node in a linked list,
with each node containing service, username, password, notes, checksum,
and a pointer to the next node.
Enums & Typedefs are used for defining custom data types like
StatusCode, which represents various status codes returned by functions.
Additionally, PasswordNode and FileHeader structures are defined using
typedef for cleaner and more maintainable code.
6
4. Preprocessor Directives & Macros
The project handles file operations such as opening files, reading, writing,
and managing file integrity. Password data is saved in and loaded from a
binary file (passwords.dat). The code includes checksum validation to
ensure the integrity of the data stored in the file.
6. Pointers
7. Bit Manipulation
7
8. Error Handling
2. Socket Programming
The project does not include socket programming for communication over
a network. There are no networked connections or client-server
interactions in this code.
The project does not include any formal code quality analysis tools, such as
static code analysis or code style enforcement tools.
8
6. Unit Testing
7. Assertions
Assertions are not used in the project. The code relies on manual error
handling and status codes rather than automatic checks or assertions to
validate assumptions during runtime.
Step 1: Prerequisites
Before starting, make sure you have all the necessary tools. Install VS Code
by downloading it from code.visualstudio.com. Next, install MinGW from
MinGW-w64, and during the installation, select the mingw32-gcc-g++
package. After installation, add the C:\MinGW\bin folder to your PATH
environment variable so you can run gcc commands from the terminal. To
ensure that VS Code supports C/C++ development, open the Extensions
view (Ctrl+Shift+X) in VS Code, search for “C/C++” by Microsoft, and install
the extension. Finally, confirm that MinGW is installed correctly by running
gcc --version in a terminal.
9
Step 2: Open the Project in VS Code
To build the project in VS Code, you first need to configure a build task.
First, open test.c. Then, open the integrated terminal ( Top Menu: View >
Terminal > New Terminal).
10
After, go to Terminal > Configure Default Build Task. Choose C/C++: gcc
build active file from the list. This action will generate a tasks.json file
inside the .vscode folder. The build task will allow VS Code to
automatically compile the project when needed.
Once inside the correct directory, where the project folder is located, type
. /test.exe.
11
The program will start, and you will be prompted to enter the master
password. Enter the default password, admin123, unless you have modified
it in the source code.
Upon launching the program, you are prompted to enter the master
password. If correct, you gain access to the main menu. The coded built in
master password is admin123.
12
● Username.
● Password.
● Optional notes about the service.
3. Automatic Backup
The program runs a background process that saves the entire password
database to a secure file every 5 minutes. This ensures that recent changes
aren't lost in case of a crash or shutdown.
13
3. Select the number of the service, to decrypt its assigned password.
The decrypted value appears temporarily in plain text, then it will
show as [PROTECTED] again.
Notes on Errors
If you encounter compilation errors, ensure that all required libraries (like
windows.h) are included and compatible with your setup. Additionally,
verify that MinGW is properly installed and accessible via the PATH variable.
For runtime errors, ensure necessary files such as passwords.dat are
present in the correct directories. Debugging messages in the terminal or
output logs can provide further insights into any issues.
How AI Helped
AI played a crucial role in various stages of the Password Manager project,
from planning to implementation and troubleshooting. Here's how:
14
suggested optimizations to improve performance, such as reducing
memory usage and minimizing redundant operations.
15
refactoring the code to use more portable libraries wherever possible and
documenting platform-specific dependencies in the user guide.
5.Weak Encryption:
The initial XOR-based encryption was deemed insufficient for strong
security. This was addressed by planning future improvements to replace
XOR encryption with industry-standard encryption methods like AES and
adding a disclaimer in the documentation to highlight this limitation.
16