Skip to content

Commit 3563f46

Browse files
committed
2 parents 0f613be + 5910638 commit 3563f46

2 files changed

Lines changed: 145 additions & 136 deletions

File tree

.github/workflows/build.yml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Release (Windows)
1+
name: Build and Release
22

33
on:
44
push:
@@ -49,19 +49,68 @@ jobs:
4949
name: password-manager-windows
5050
path: release/password-manager-windows.tar.gz
5151

52+
build-and-release-linux:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Rust
59+
uses: actions-rs/toolchain@v1
60+
with:
61+
toolchain: stable
62+
override: true
63+
64+
- name: Cache Cargo registry
65+
uses: actions/cache@v3
66+
with:
67+
path: ~/.cargo/registry
68+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-cargo-registry-
71+
72+
- name: Cache Cargo build
73+
uses: actions/cache@v3
74+
with:
75+
path: target
76+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
77+
restore-keys: |
78+
${{ runner.os }}-cargo-build-
79+
80+
- name: Build
81+
run: cargo build --release
82+
83+
- name: Package binary
84+
run: |
85+
mkdir -p release/linux
86+
cp target/release/Password_Manager release/linux/password-manager
87+
tar -czvf release/password-manager-linux.tar.gz -C release/linux password-manager
88+
89+
- uses: actions/upload-artifact@v4
90+
with:
91+
name: password-manager-linux
92+
path: release/password-manager-linux.tar.gz
93+
5294
create-release:
53-
needs: build-and-release-windows
95+
needs: [build-and-release-windows, build-and-release-linux]
5496
runs-on: ubuntu-latest
5597
steps:
5698
- uses: actions/download-artifact@v4
5799
with:
58100
name: password-manager-windows
59101
path: release/windows
60102

103+
- uses: actions/download-artifact@v4
104+
with:
105+
name: password-manager-linux
106+
path: release/linux
107+
61108
- name: Create release
62109
uses: ncipollo/release-action@v1.14.0
63110
with:
64-
artifacts: "release/windows/password-manager-windows.tar.gz"
111+
artifacts: |
112+
release/windows/password-manager-windows.tar.gz
113+
release/linux/password-manager-linux.tar.gz
65114
token: ${{ secrets.PAT_TOKEN }}
66115
name: Build v${{ github.run_number }}
67116
tag: v${{ github.run_number }}
@@ -73,4 +122,6 @@ jobs:
73122
steps:
74123
- uses: geekyeggo/delete-artifact@v5
75124
with:
76-
name: password-manager-windows
125+
name: |
126+
password-manager-windows
127+
password-manager-linux

README.md

Lines changed: 90 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,72 @@
1-
---
2-
# 🔐 Password Manager
1+
# 🔐 Password Manager
32

4-
A secure password manager with **AES-256-GCM encryption**, **Argon2 hashing**, and a **web API**.
5-
Supports both **CLI** and **Web API** for managing passwords securely.
3+
A secure password manager built with Rust, featuring AES-256-GCM encryption, Argon2 hashing, and both a web API and CLI interface. This project prioritizes security and provides a robust solution for managing your passwords.
64

7-
---
5+
## 🚀 Features
86

9-
## 🚀 Features
10-
**Master Password Protection** (Argon2-based hashing)
11-
**AES-256-GCM Encryption** (Secure password storage)
12-
**SQLite Database** (Encrypted storage for passwords)
13-
**Web API Support** (Actix-Web based API)
14-
**Zeroization** (Sensitive data is securely erased from memory)
15-
**Frontend & CLI Support** (Use via Web UI or CLI)
7+
* **Master Password Protection:** Securely protected using Argon2 hashing.
8+
* **AES-256-GCM Encryption:** Passwords are encrypted using AES-256-GCM for strong confidentiality and integrity.
9+
* **SQLite Database:** Encrypted SQLite database for persistent and secure storage.
10+
* **Web API (Actix-Web):** Manage passwords programmatically via a RESTful API.
11+
* **CLI Support:** Interact with the password manager directly from the command line.
12+
* **Zeroization:** Sensitive data is securely erased from memory after use.
13+
* **Frontend (Next.js):** Modern and user-friendly web interface.
1614

17-
---
15+
## 📦 Installation
1816

19-
## 📦 Installation
17+
This project consists of a frontend (Next.js) and a backend (Rust). Follow the instructions below to set up both.
2018

21-
### **1️⃣ Frontend Setup**
22-
The frontend is built using **Next.js**.
19+
### 1️⃣ Frontend Setup (Next.js)
2320

24-
#### **Requirements:**
25-
- **Node.js** (Download from [nodejs.org](https://nodejs.org/))
26-
- **Git** (Download from [git-scm.com](https://git-scm.com/))
21+
#### Requirements
2722

28-
#### **Install & Run**
29-
```sh
30-
git clone https://github.com/Amitminer/PasswordManager-Rust.git
31-
cd PasswordManager-Rust
32-
cd website
33-
npm install
34-
npm run dev
23+
* [Node.js](https://nodejs.org/)
24+
* [npm](https://www.npmjs.com/) (or yarn)
25+
* [Git](https://git-scm.com/)
26+
27+
#### Installation and Running
28+
29+
```bash
30+
git clone [https://github.com/Amitminer/PasswordManager-Rust.git](https://github.com/Amitminer/PasswordManager-Rust.git)
31+
cd PasswordManager-Rust/website
32+
npm install # or yarn install
33+
npm run dev # or yarn dev
3534
```
36-
---
3735

38-
### **2️⃣ Backend Setup**
39-
The backend is built in **Rust** using Actix-Web.
36+
This will start the development server. The frontend will typically be available at `http://localhost:3000`.
4037

41-
#### **Requirements:**
42-
- **Rust & Cargo** ([Install Rust](https://rustup.rs/))
43-
- **SQLite** (Bundled with `rusqlite`)
38+
### 2️⃣ Backend Setup (Rust)
4439

45-
#### **Install & Run**
46-
```sh
47-
git clone https://github.com/Amitminer/PasswordManager-Rust.git
48-
cd PasswordManager-Rust
49-
cargo build --release
50-
cargo run -- --api # OR run compiled binary:
51-
./passwordmanager --api
52-
``
40+
#### Requirements
41+
42+
* [Rust](https://www.rust-lang.org/tools/install)
43+
* [Cargo](https://doc.rust-lang.org/cargo/index.html)
44+
* SQLite (usually bundled with `rusqlite` crate, no separate installation needed)
5345

54-
This starts the **Web API** at `http://127.0.0.1:8080/api`.
46+
#### Installation and Running
5547

56-
---
48+
```bash
49+
cd PasswordManager-Rust
50+
cargo build --release # Build the release version for optimized performance
51+
cargo run -- --api # Run the backend with the API enabled
5752

58-
## 🌍 Web API Usage
53+
# OR run the compiled binary directly (after building):
54+
./target/release/password-manager --api
55+
```
5956

60-
### **Available Endpoints**
61-
| Method | Endpoint | Description |
62-
|--------|---------|-------------|
63-
| `GET` | `/api/initialize` | Check if the master password is set |
64-
| `POST` | `/api/create-master-password` | Set the master password |
65-
| `POST` | `/api/verify-master-password` | Verify master password |
66-
| `POST` | `/api/add-password` | Add a new password |
67-
| `GET` | `/api/list-passwords` | List stored passwords |
68-
| `GET` | `/api/get-password/{service}` | Retrieve a specific password |
69-
| `DELETE` | `/api/remove-password/{service}` | Remove a password |
70-
| `DELETE` | `/api/clear-all-data` | Delete all stored passwords |
57+
The API will be available at `http://127.0.0.1:8080/api` (or `http://localhost:8080/api`).
7158

72-
---
59+
## 🌍 Web API Usage
7360

74-
## 🐍 API Example (Python Requests)
61+
The backend provides a RESTful API for programmatic access.
7562

76-
### **1️⃣ Install Dependencies**
77-
```sh
78-
pip install requests
79-
```
63+
### 🐍 API Example (Python Requests)
8064

81-
### **2️⃣ Sample Python Client**
8265
```python
8366
import requests
67+
import json
8468

85-
BASE_URL = "http://127.0.0.1:8080/api"
69+
BASE_URL = "[http://127.0.0.1:8080/api](http://127.0.0.1:8080/api)"
8670

8771
def set_master_password(password):
8872
return requests.post(f"{BASE_URL}/create-master-password", json={"password": password}).json()
@@ -107,104 +91,78 @@ def clear_all_data():
10791
return requests.delete(f"{BASE_URL}/clear-all-data").json()
10892

10993
if __name__ == "__main__":
110-
master_password = "my_secure_master_password"
111-
94+
master_password = "my_secure_master_password" # Replace with a strong password
11295
print("🔑 Setting Master Password...")
11396
print(set_master_password(master_password))
114-
11597
print("\n✅ Verifying Master Password...")
11698
print(verify_master_password(master_password))
117-
11899
print("\n🔐 Adding a Password Entry...")
119100
print(add_password("example.com", "admin", "secure123"))
120-
121101
print("\n📜 Listing Stored Passwords...")
122102
print(list_passwords())
123-
124103
print("\n🔎 Retrieving Password for 'example.com'...")
125104
print(get_password("example.com"))
126-
127105
print("\n❌ Removing Password for 'example.com'...")
128106
print(remove_password("example.com"))
129-
130107
print("\n⚠️ Clearing All Data...")
131108
print(clear_all_data())
132-
```
133-
---
134-
135-
## 🔗 CLI Usage
136109

137-
### **1️⃣ Running the CLI**
138-
```sh
139-
cargo run
140-
```
141-
or
142-
```sh
143-
./passwordmanager
144110
```
145111

146-
### **2️⃣ Available CLI Actions**
147-
- **Add a new password**
148-
- **Retrieve stored passwords**
149-
- **List all stored websites and usernames**
150-
- **Remove passwords**
151-
- **Clear all stored data**
112+
**Important:** The Python example assumes the API is running. Make sure you have started the backend as described above. The API endpoints and expected JSON request/response formats should be documented clearly (consider using OpenAPI/Swagger).
152113

153-
### **3️⃣ Security**
154-
- **Use a strong master password**
155-
- **Passwords are encrypted with AES-256-GCM**
156-
- **Data is erased from memory after use (zeroization)**
114+
## 🔗 CLI Usage
157115

158-
---
159-
160-
## 🔒 Security
161-
162-
### **1️⃣ Argon2 Password Hashing**
163-
- **Memory Cost**: 19 MB
164-
- **Time Cost**: 2 iterations
165-
- **Parallelism**: 1 thread
116+
```bash
117+
cargo run # or ./target/release/password-manager
118+
```
166119

167-
### **2️⃣ AES-256-GCM Encryption**
168-
- **AES-GCM** ensures password confidentiality & integrity.
169-
- **Unique nonce per encryption** to prevent attacks.
120+
This will launch the interactive CLI application. You'll be presented with a menu:
170121

171-
---
122+
```
123+
Welcome to Password Manager:
124+
125+
1. Add new password
126+
2. Remove password
127+
3. List passwords
128+
4. Get password info
129+
5. Clear all data
130+
6. Exit
131+
```
172132

173-
## 🏗 Why This Project?
174-
This project was built to learn:
175-
✅ Secure **password storage & encryption**
176-
✅ Cryptographic techniques (**Argon2, AES-256-GCM**)
177-
✅ Database security with **SQLite**
178-
**Web API Development** in Rust with **Actix-Web**
179-
**Frontend & Backend Security Best Practices**
133+
Follow the prompts within the CLI to manage your passwords.
180134

181-
---
135+
## 🔒 Security
182136

183-
## ⚙️ Dependencies
137+
* **Argon2 Password Hashing:** Uses Argon2 for strong master password protection with configurable parameters (memory cost, time cost, parallelism). *Specify the exact parameters used in the implementation.*
138+
* **AES-256-GCM Encryption:** Employs AES-256-GCM for encrypting stored passwords, ensuring confidentiality and integrity. *Mention how the nonce is handled.*
139+
* **Zeroization:** Sensitive data is securely erased from memory using the `zeroize` crate.
184140

185-
### **📦 Rust Crates Used:**
186-
- `actix-web` – Web API framework
187-
- `rusqlite` – SQLite database
188-
- `argon2` – Password hashing
189-
- `aes-gcm` – AES-256-GCM encryption
190-
- `rpassword` – Secure password input
191-
- `zeroize` – Secure memory wiping
141+
## 🏗 Why This Project?
192142

193-
### **🌍 Frontend Dependencies:**
194-
- `Next.js` – React-based web framework
195-
- `Tailwind CSS` – UI styling
196-
- `Axios` – API calls
143+
This project was developed for educational purposes to explore and implement:
197144

198-
---
145+
* Secure password storage and encryption techniques.
146+
* Cryptographic algorithms (Argon2, AES-256-GCM).
147+
* Database security with SQLite.
148+
* Web API development using Actix-Web.
149+
* Frontend development with Next.js.
150+
* Security best practices.
199151

200-
## 📜 License
201-
This project is **open-source** and licensed under the **MIT License**.
152+
## ⚙️ Dependencies
202153

203-
---
154+
* **Backend (Rust Crates):**
155+
* `actix-web`: Web framework.
156+
* `rusqlite`: SQLite database interaction.
157+
* `argon2`: Password hashing.
158+
* `aes-gcm`: AES-256-GCM encryption.
159+
* `rpassword`: Secure password input.
160+
* `zeroize`: Secure memory wiping.
161+
* **Frontend (Next.js):**
162+
* `next`: React framework.
163+
* `tailwindcss`: CSS framework (if used).
164+
* `axios` (or `fetch`): HTTP client.
204165

205-
## 📞 Contact
206-
- **GitHub:** [yourusername/passwordmanager](https://github.com/yourusername/passwordmanager)
207-
- **Email:** your@email.com
208-
```
166+
## 📜 License
209167

210-
---
168+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)