encryptdecryptwithkey
v1.0.8
Published
A Node.js package for encrypting and decrypting strings using the AES-128-CTR algorithm with a customizable encryption key
Downloads
19
Maintainers
Readme
encryptdecryptwithkey
A Node.js package for encrypting and decrypting strings using the AES-256-GCM algorithm with a customizable encryption key.
const { encryptString } = require('encryptdecryptwithkey');
const originalString = 'Hello, World!';
const encryptedString = encryptString(originalString);
console.log('Original String:', originalString);
console.log('Encrypted String:', encryptedString);
const { decryptString } = require('encryptdecryptwithkey');
const encryptedString = 'yourEncryptedStringHere';
const decryptedString = decryptString(encryptedString);
console.log('Encrypted String:', encryptedString);
console.log('Decrypted String:', decryptedString);
Make sure to set the ENCRYPT_KEY environment variable in your project. If not set, a default key will be used.
If ENCRYPT_KEY is not set, a default key will be used,