Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@dep/aes 🔐

Simple AES-GCM encryption and decryption utilities powered by the Web Crypto API.

JSR version

Features ✨

  • 🔒 Encrypt text using AES-GCM.
  • 🔓 Decrypt encrypted payloads back into plaintext.
  • ⚡ Uses the native Web Crypto API (no external dependencies).
  • 🌐 Works in Deno, Node.js (18+), and modern browsers.
  • 📦 Small, tree-shakeable, and ESM-first.

Installation 📦

  • Deno:

    deno add jsr:@dep/aes
  • Node.js (18+) or Browsers:

    npx jsr add @dep/aes

    Then import as an ES module:

    import { encrypt, decrypt } from '@dep/aes';

Usage 🎯

API 🧩

Encrypt text:

import { encrypt } from '@dep/aes';

const cipherText = await encrypt('MI4KP4050TD065782', 'dycxov-dYsxir-gykmi7');

console.log(cipherText);
// +vq7dCWJKmBKQN1Z50dzLyDjd5tpwCinAQKt/Mjfvj48g/EKjFZSQX6/2q1V

Decrypt text:

import { decrypt } from '@dep/aes';

const plainText = await decrypt(
  '+vq7dCWJKmBKQN1Z50dzLyDjd5tpwCinAQKt/Mjfvj48g/EKjFZSQX6/2q1V',
  'dycxov-dYsxir-gykmi7',
);

console.log(plainText);
// MI4KP4050TD065782

You can also use the namespace export:

import { aes } from '@dep/aes';

const encrypted = await aes.encrypt(
  'MI4KP4050TD065782',
  'dycxov-dYsxir-gykmi7',
);
const decrypted = await aes.decrypt(
  '+vq7dCWJKmBKQN1Z50dzLyDjd5tpwCinAQKt/Mjfvj48g/EKjFZSQX6/2q1V',
  'dycxov-dYsxir-gykmi7',
);

License 📄

MIT License – see LICENSE for details.

Author: Estarlin R (estarlincito.com)

About

Simple AES-GCM encryption and decryption utilities powered by the Web Crypto API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages