Skip to content
karimwael45Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

24 Commits

Folders and files

Repository files navigation

Secure Password Manager

Project Summary

A command-line password manager Stores credentials encrypted with AES-256-GCM, verifies vault integrity with ElGamal digital signatures, and supports secure vault transfer between users via Diffie-Hellman key exchange.


Setup

Requirements: Python 3.8+

python -m venv venv

venv\Scripts\activate        # for Windows
**or**
source venv/bin/activate     # for Mac and Linux

pip install -r requirements.txt

How to Run

All commands are run from the project root:

python src/main.py <command> <arguments>

Full Workflow Example

1. Set up a user

python src/main.py setup alice

Generates Alice's ElGamal key pair and saves it to the keys/ folder.

2. Create a vault

python src/main.py create-vault alice mypassword123

Creates an encrypted vault for Alice, locked with her master password, and signs it.

3. Add credentials

python src/main.py add alice mypassword123 github.com alice_user p@ssword1
python src/main.py add alice mypassword123 google.com alice@gmail.com abc123

4. List all credentials

python src/main.py list alice mypassword123

5. Get a specific credential

python src/main.py get alice mypassword123 github.com

6. Update a password

python src/main.py update alice mypassword123 github.com newpassword99

7. Delete a credential

python src/main.py delete alice mypassword123 github.com

8. Verify vault integrity

python src/main.py verify alice

Checks the ElGamal signature on Alice's vault. If the vault file was tampered with, access is denied.

9. Export vault to another user

First set up the recipient:

python src/main.py setup bob
python src/main.py create-vault bob bobpassword

Then export:

python src/main.py export alice mypassword123 bob bobpassword

This runs the full Diffie-Hellman key exchange, encrypts Alice's vault with the session key, signs it, and imports it into Bob's vault re-encrypted under his master password.


Running Tests

pytest tests/

Project Structure

project/
├── src/
│   ├── modules/
│   │   ├── elgamal.py          # Module 1 — key generation
│   │   ├── vault.py            # Module 2 — AES encryption + CRUD
│   │   ├── integrity.py        # Module 3 — ElGamal signatures
│   │   └── diffie_hellman.py   # Module 4 — DH key exchange + export
│   ├── utils/
│   │   └── crypto_utils.py     # AES-GCM + SHA-256 helpers
│   └── main.py                 # CLI entry point
├── tests/
│   ├── test_elgamal.py
│   ├── test_vault.py
│   ├── test_integrity.py
│   └── test_dh.py
├── keys/                       # Generated key files (private keys git-ignored)
├── vaults/                     # Encrypted vault files
├── config.json                 # Shared DH/ElGamal parameters (p, alpha)
├── requirements.txt
└── README.md

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages