Skip to content

akaruilabs-india/nacl-encrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Encrypt/Decrypt your data with zero headache

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages