soteriacrypt
v1.1.2
Published
Package for encrypting and decrypting using AES-256-CBC
Readme
SoteriaCrypt
soteriacrypt is an NPM package that provides encryption and decryption functionality using the AES-256-CBC algorithm.
Requirements
- Node.js 19.0.0 or higher
- Jest Testing Framework
Installation
You can install soteriacrypt using:
npm -i soteriacryptor
yarn add soteriacryptUsage
// Import the SoteriaEncryption class
import SoteriaEncryption from "./src/SoteriaEncryption.js";
// Load environment variables from .env file
import dotenv from "dotenv";
dotenv.config();
// Create a new instance of the class
const crypt = new SoteriaEncryption({
// Key, IV, and cipher are now set in the class constructor
key: process.env.CRYPT_KEY,
iv: process.env.CRYPT_IV,
cipher: process.env.CRYPT_CIPHER
});
const run = async () => {
const encrypted = await crypt.encrypt("Hello Soteria!");
console.log("Encrypted:", encrypted);
const decrypted = await crypt.decrypt(encrypted);
console.log("Decrypted:", decrypted);
};
run();
Testing
npm run testLicense
Author
Contributing
Pull requests are welcome. For maj-or changes, please open an issue first to discuss what you would like to change.
Support
If you like this project, please consider giving it a ⭐️ on GitHub
