npm install @uncrypt/simple-aes # via npm
yarn add @uncrypt/simple-aes # via yarn
pnpm add @uncrypt/simple-aes # via pnpm
import {
AesCbcEncryptor,
DecryptError,
WeakPasswordError,
} from "@uncrypt/simple-aes";
const key = "long-enough-secret-encryption-key";
const data = "something-utf8-é😀";
const aesCrypt = new AesCbcEncryptor(key); // will throw WeakPasswordError if too short
const crypted = aesCrypt.encrypt(data);
aesCrypt.decrypt(crypted); // will throw Decrypt error if iv not valid or wrong key
Don't hesitate and open an issue.
Contributions are warmly appreciated. Have a look to the CONTRIBUTING document.
If my OSS work brightens your day, let's take it to new heights together! Sponsor, coffee, or star – any gesture of support fuels my passion to improve. Thanks for being awesome! 🙏❤️
JetBrains | Embie.be |
MIT © belgattitude and contributors.