@entom/node-encrypt-decrypt

1.0.4 • Public • Published

nodejs-encrypt-decrypt

Nodejs app - encrypt and decrypt data

Initiate module

npx @entom/node-encrypt-decrypt init

Example of usage - without static value of iv

require('dotenv').config();
const crypter = require('./crypter');

const value = crypter.encrypt('entom');
console.log('value', value);

const value1 = crypter.encrypt('entom');
console.log('value-1', value1);

Example of usage - with static value of iv

require('dotenv').config();
const crypter = require('./crypter');
const staticIv = crypter.generateRandomKey();

const value = crypter.encrypt('entom', staticIv);
console.log('value', value);

const value1 = crypter.encrypt('entom', staticIv);
console.log('value-1', value1);
console.log('value-1 decrypted', crypter.decrypt(value1, staticIv));

Package Sidebar

Install

npm i @entom/node-encrypt-decrypt

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

4.54 kB

Total Files

7

Last publish

Collaborators

  • entom