@hungdev23/hung-encrypt
v1.0.2
Published
AES-256-GCM encryption library
Readme
@hungdev23/hung-encrypt
A small AES encryption library for JavaScript/TypeScript.
Features
- AES encryption and decryption
- Browser-friendly implementation using
crypto-js - Simple API with
Encrypt.initialize,Encrypt.AES.encrypt, andEncrypt.AES.decrypt
Install
npm install @hungdev23/hung-encryptUsage
import Encrypt from "@hungdev23/hung-encrypt";
Encrypt.initialize("Hung@2026");
const encrypted = Encrypt.AES.encrypt("Hello world");
const decrypted = Encrypt.AES.decrypt(encrypted);
console.log(encrypted);
console.log(decrypted);Notes
- Always call
Encrypt.initialize(key)before encryption or decryption. - The encrypted output is a Base64 string.
- This package is intended for browser and Node.js usage.
Build
npm run buildLicense
MIT
