Skip to content

kejiahp/passlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementation of Password Manager in C++ (Console Application)

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

Assessment Description

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.

Getting Started

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.

Git:

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 update

CMake Installation:

First check if CMake is installed on the system.

cmake --version

If you see a message saying cmake is not recognized or something similar. Follow the steps below to install CMake on your computer.

CMake Installation MacOS and Windows:

Install CMake MacOS

brew install cmake # MacOS

Install CMake Windows

Follow this URL for Windows: https://cmake.org/download/

OpenSSL Installation MacOS and Windows

The project uses OpenSSL for hashing and encryption/decryption of credentials.

Check if OpenSSL is already installed

openssl --version # both MacOS and Windows

Install OpenSSL MacOS

brew install openssl

After installation, if openssl is still not found, ensure shell configuration file (.zshrc, .bash_profile, etc) is updated.

Install OpenSSL Windows

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.

Build Project and Run the executable

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 adminSeedEmail and adminSeedPassword variables with an appropriate email and password. These are required to seed the database with an admin user. The default admin email and password are admin@gmail.com and passLockAdmin12345@ 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

High-Level System Design (My Thought Process on the implementation)

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.

1. Multi-user account support with login system (normal users and admin).

Solution:

  • User database schema collecting minimal information along with user types e.g. NORMAL and ADMIN.

    • 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:

    1. View all other Users.
    2. Make an already created User and Admin.
    3. Make an User with Admin status a Normal User.
    4. Update Users details.
    5. View all credentials in short forms.
    6. Delete Users.

    Admins will not be able to update or delete other users credentials.

2. Storing and managing credentials for websites, desktop applications and games.

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

3. Add, edit and delete credentials with audit of date created and last updated.

Solution:

  • Basic CRUD operations on the Credential schema, ensuring this operations can only be performed by the user whom created the account.

4. Secure password storage with encryption and decryption algorithms.

Solution:

  • Use OpenSSL for Encryption/Decryption and Hashing.

5. Random password generation.

Solution:

  • This will be done using the random password generator function provided by the static utilities library.

6. Ability to search credentials by name and sort them by last updated date.

Solution:

  • Search: Credentials should be searchable via the title field of the Credentails table.
  • Sort: Credential should be sortable using the updatedAt field of the Credentials table. The sorting by default should be in descending order.

7. Masked display of passwords, with option to reveal in plain text on demand.

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.

About

A C++ CLI application to securely manage usernames and passwords for multiple users.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages