1.0.2 • Published 6 years ago

nacl-encrypt v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

nacl-encrypt

Encrypt/Decrypt your data with zero headache

Installation

$ npm i nacl-encrypt --save

OR

$ yarn add nacl-encrypt

Usage

const { encrypt, decrypt } = require('nacl-encrypt');

const encryptedMessage = encrypt('My Message', secret);
console.log(encryptedMessage);

const decryptedMessage = decrypt(encryptedMessage, secret);
console.log(decryptedMessage); //=> 'My Message'

To generate a new secret token:

const { generateKey } = require('nacl-encrypt');

const secret = generateKey();
console.log(secret); //=> 8vFzw/vcRY6w8w6QQFKXTIoN3mjwazwO48sYwWhCRc0=

Test

$ npm test
1.0.2

6 years ago

1.0.0

6 years ago