https://github.com/telkomdev/mongodb-client-side-level-encryption-example
mongodb-client-side-level-encryption-example
https://github.com/telkomdev/mongodb-client-side-level-encryption-example
Last synced: 4 months ago
JSON representation
mongodb-client-side-level-encryption-example
- Host: GitHub
- URL: https://github.com/telkomdev/mongodb-client-side-level-encryption-example
- Owner: telkomdev
- Created: 2022-08-21T11:41:18.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-21T11:41:48.000Z (almost 3 years ago)
- Last Synced: 2025-01-16T20:19:07.876Z (5 months ago)
- Language: JavaScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### MongoDB manual encryption mechanism of Client-Side Field Level Encryption (CSFLE)
### Reference
- https://www.mongodb.com/docs/manual/core/csfle/fundamentals/manual-encryption/
- https://github.com/mongodb-university/docs-in-use-encryption-examples### Getting started
#### Run MongoDB Server
```shell
$ docker-compose up
```#### Generate Master Key
```shell
$ node master_key_gen.js
```#### Create Key Data
Open `mongo.js`
Run `createKeyVault` function
`mongo.js`
```javascript
...............................
.................................
createKeyVault().catch(e => console.log(e));// insertData().catch(e => console.log(e));
//readData().catch(e => console.log(e));
```Run
```shell
$ node mongo.js
```#### Insert Data
Open `mongo.js`
Run `insertData` function
`mongo.js`
```javascript
...............................
.................................
// createKeyVault().catch(e => console.log(e));insertData().catch(e => console.log(e));
//readData().catch(e => console.log(e));
```Run
```shell
$ node mongo.js
```#### Read Data
Open `mongo.js`
Run `readData` function
`mongo.js`
```javascript
...............................
.................................
// createKeyVault().catch(e => console.log(e));// insertData().catch(e => console.log(e));
readData().catch(e => console.log(e));
```Run
```shell
$ node mongo.js
```