@ende/crypto/aes-gcm

ende add jsr:@ende/crypto

Version 2026.10.15 on JSR.

High-level AES-GCM authenticated encryption with automatic nonce generation.

With random nonces, do not encrypt more than ~2^32 messages under the same key. Beyond this limit, nonce collision probability becomes non-negligible.

Exports

  • AesGcmOptions — Options for encryptAesGcm and decryptAesGcm.
  • decryptAesGcm — Decrypts data produced by encryptAesGcm.
  • encryptAesGcm — Encrypts plaintext using AES-GCM with a random 96-bit nonce.
  • Uint8Array_ — Proxy type of {@code Uint8Array<ArrayBuffer>} or {@code Uint8Array} in TypeScript 5.7 or below respectively.