This project was created in fulfilment of course work 1 for the module details listed below:
- Module Code: CS4D768
- Module Title: Object Oriented Programming with Data Structures and Algorithms
- Submission Date: 24th November, 2025
- Module/Leader: Prof Janusz Kulon / Dr Shiny Verghese
- Student Name: Morenikeji Elijah Popoola
This project involves creating an application to securely manage usernames and passwords for multiple users. It would include features such as:
- Multi-user account support with login system (normal users and admin)
- Storing and managing credentials for websites, desktop applications and games.
- Add, edit and delete credentials with audit of date created and last updated.
- Secure password storage with encryption and decryption algorithms.
- Random password generation.
- Ability to search credentials by name and sort them by last updated date.
- Masked display of passwords, with option to reveal in plain text on demand.
This project was setup using CMake, a cross-platform build tool on a Mac computer system. Below are instructions to build and run the project on your local machine.
Use git to clone the repository. Then init and update submodule "SQLiteCpp".
git clone https://github.com/kejiahp/passlock.git
cd passlock
git submodule init
git submodule updateFirst check if CMake is installed on the system.
cmake --versionIf you see a message saying cmake is not recognized or something similar. Follow the steps below to install CMake on your computer.
brew install cmake # MacOSFollow this URL for Windows: https://cmake.org/download/
The project uses OpenSSL for hashing and encryption/decryption of credentials.
Check if OpenSSL is already installed
openssl --version # both MacOS and Windowsbrew install opensslAfter installation, if openssl is still not found, ensure shell configuration file (.zshrc, .bash_profile, etc) is updated.
Follow this link How to install OpenSSL (3.0.1) on Windows 10 (64-bit). Installing versions 3.5.2 and above should be fine.
Follow this steps once CMake and OpenSSL have been installed, do the following:
-
Go to the root directory of the project.
-
Within ./src/db/seed/seed.cpp; line 46, initialize the
adminSeedEmailandadminSeedPasswordvariables with an appropriate email and password. These are required to seed the database with an admin user. The default admin email and password areadmin@gmail.comandpassLockAdmin12345@respectively. -
Execute the build scripts:
sh build.sh #MacOS ./winbuild.bat # Windows Powershell winbuild.bat # Windows Command Prompt (CMD)
-
Windows Powershell and CMD Emoji Configuration (OPTIONAL)
At times windows terminals need needs extra configurations allowing emojis to be displayed properlly the commands below help with that.
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 # Windows Powershell chcp 65001 # Windows Command Prompt (CMD)
-
Run the executable:
./build/src/passlock # MacOS .\build\src\Release\passlock.exe # Windows
In this section we will be going through the assessment description and outlining how we will implement each feature.
Markdown tables were generated using www.tablesgenerator.com
We will be using SQLiteC++ as our sqlite cli. Its essentially a lightweight C++ wrapper around the SQLite (sqlite3) library. Its provides the following features which make it a great choice:
- RAII resource management.
- First class C++ support as opposed to SQLite(sqlite3) which is C-based.
Solution:
-
User database schema collecting minimal information along with user types e.g.
NORMALandADMIN.-
User schema: This represents the schema for storing user details.
id email password type key iv createdAt updatedAt int string string NORMAL or ADMIN string string datetime datetime
-
-
Account creation process, information like email (unique), password (it will be hashed) is collected and saved in a datastore, We will be using SQlite for datastore ensuring data persistence.
-
Login system where the user authenticates with their email and password. The password gets hashed and compared with the already stored hashed password. If they are same they are granted access to their data else an appropriate error message is displayed.
-
An admin will be created on seed of the database, Admins while have the following abilities:
- View all other Users.
- Make an already created User and Admin.
- Make an User with Admin status a Normal User.
- Update Users details.
- View all credentials in short forms.
- Delete Users.
Admins will not be able to update or delete other users credentials.
Solution:
-
Credentail schema: This represents the schema for storing user credentails.
id userId title email username password url createdAt updatedAt int int string string? string? string? string? datetime datetime
Solution:
- Basic CRUD operations on the Credential schema, ensuring this operations can only be performed by the user whom created the account.
Solution:
- Use OpenSSL for Encryption/Decryption and Hashing.
Solution:
- This will be done using the random password generator function provided by the static
utilitieslibrary.
Solution:
- Search: Credentials should be searchable via the
titlefield of theCredentailstable. - Sort: Credential should be sortable using the
updatedAtfield of theCredentialstable. The sorting by default should be in descending order.
Solution:
- This will use a unique key created for each user on sign up to decrypt their passwords, revealing it in a readable plain-text format.