encryption-algorithm-aes
v1.0.2
Published
Strong AES-GCM encryption/decryption with PBKDF2 key derivation in JavaScript (Node.js & browser).
Maintainers
Readme
ENCRYPTION ALGORITHM AES 🔐
- A lightweight and secure AES-256-GCM encryption & decryption library with PBKDF2 key derivation.
- Perfect for protecting sensitive data with password-based encryption.
INSTALLATION
npm install encryption-algorithm-aesUSEAGE
import { encrypt, decrypt } from "secure-encrypt";
const token = await encrypt("hello world", "my-password");
console.log("Encrypted:", token);
console.log(await decrypt(token, "my-password"));FEATURES
🔒 AES-256-GCM for strong encryption
🔑 PBKDF2 key derivation with salt & iterations
📦 Tiny & dependency-free
⚡ Async functions for better performance
API
encrypt(data: string, password: string): Promise<string>```
Encrypts a string with the given password. Returns a Base64-encoded token containing salt, IV, and ciphertext.
decrypt(token: string, password: string): Promise<string>```
Decrypts a token with the given password. Returns the original plaintext string.
LICENCE
MIT © Akram Benaoun
