1.0.8 • Published 2 months ago

encryptdecryptwithkey v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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,