https://github.com/smallcase/field-level-encryption
https://github.com/smallcase/field-level-encryption
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smallcase/field-level-encryption
- Owner: smallcase
- Created: 2021-08-05T09:45:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-08T14:15:35.000Z (over 4 years ago)
- Last Synced: 2025-04-06T11:02:27.666Z (11 months ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Field Level Encryption
## Running the project
1. Export env file
2. Install MongoDB
3. Install Node Js
4. Run following commands
```
npm install
node index
```
## API
### 1. Get Data
```
curl -XGET 'localhost:8900/?email=sample@example.com'
```
### 2. Add Data
```
curl -XPOST -H "Content-type: application/json" -d '{
"name": "Test User",
"email": "sample@example.com",
"phone": "9999999999"
}' 'localhost:8900/'
```
### 3. Agreegation
```
curl -XGET 'localhost:8900/aggregate?email=sample@example.com'
```
## Benchmarking
### 1. Install autocannon
```
npm i auto autocannon
```
### 2. Command
```
autocannon -c 100 -d 5 http://localhost:8900/?email=sample@example.com
```
## 3. Benchmarking the Get API
### a. Disabling Encryption
- Remove getters and setters from users model to disable encryption
### b. Enabling Encryption
- Add the getters and setters back to enable encryption