Skip to content

belgattitude/uncrypt

Repository files navigation

@uncrypt/simple-aes

npm node bundles codecov techdebt maintainability npm license

Install

npm install @uncrypt/simple-aes  # via npm
yarn add @uncrypt/simple-aes     # via yarn
pnpm add @uncrypt/simple-aes     # via pnpm

Usage

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

Support

Don't hesitate and open an issue.

Contributors

Contributions are warmly appreciated. Have a look to the CONTRIBUTING document.

Sponsors

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! 🙏❤️

Special thanks to

Jetbrains logo Jetbrains logo
JetBrains Embie.be

License

MIT © belgattitude and contributors.