https://github.com/dial-once/node-encryptonite
Security library
https://github.com/dial-once/node-encryptonite
Last synced: about 2 months ago
JSON representation
Security library
- Host: GitHub
- URL: https://github.com/dial-once/node-encryptonite
- Owner: dial-once
- License: mit
- Created: 2017-08-14T09:41:13.000Z (almost 8 years ago)
- Default Branch: develop
- Last Pushed: 2018-11-30T08:43:23.000Z (over 6 years ago)
- Last Synced: 2025-03-24T02:19:22.739Z (about 2 months ago)
- Language: JavaScript
- Size: 44.9 KB
- Stars: 2
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# node-encryptonite
[](http://sonar.dialonce.net/dashboard?id=node-encryptonite)
[](http://sonar.dialonce.net/dashboard?id=node-encryptonite)
[](http://sonar.dialonce.net/dashboard?id=node-encryptonite)
[](http://proxy.dialonce.net/sonar/api/badges/measure?key=node-encryptonite&metric=coverage)
[](http://sonar.dialonce.net/dashboard?id=node-encryptonite)
[](http://sonar.dialonce.net/dashboard?id=node-encryptonite)Module for aes-256-gcm encryption.
## features
- encrypt
- decrypt## Installation
```
npm install encryptonite
```## How it works:
#### Encrypt data
```js
const security = require('node-security');const data = 'Hello World !';
const secure = security.encrypt(data, key);
// result
{
content: '1016acd5af5b7b91985fc36d7b',
vector: '73d1b9d375fa33c355b185dd',
tag: 'bdea27df226f54da5bb9ed12e4312e12'
}
```#### Decrypt data
```js
const security = require('node-security');security.decrypt({
content: '1016acd5af5b7b91985fc36d7b',
vector: '73d1b9d375fa33c355b185dd',
tag: 'bdea27df226f54da5bb9ed12e4312e12'
}, key);// result
'Hello World !'
```## Tests
Requirements:
- npm
- makeRun `make deps` once and then `make test` to launch the test suite.
## License
The MIT License [MIT](LICENSE.md)