A Node.js package for encrypting and decrypting strings using the AES-256-GCM algorithm with a customizable encryption key.
To install encryptdecryptwithkey, use the following command:npm install encryptdecryptwithkey
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.
export ENCRYPT_KEY=yourSecretKey
If ENCRYPT_KEY is not set, a default key will be used,
If you encounter any issues or have questions, please open an issue on the GitHub Issues page. This project is licensed under the MIT License - see the LICENSE file for details.