Skip to content

entom/nodejs-encrypt-decrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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));

About

Nodejs app - encrypt and decrypt data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published