# crypto-aes-gcm

> Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode)

Latest version **2.1.0** (published 2026-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install crypto-aes-gcm
pnpm add crypto-aes-gcm
yarn add crypto-aes-gcm
bun add crypto-aes-gcm
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2026-01-11 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 12 |
| Maintainers | korywka |

## Links

- npm: https://www.npmjs.com/package/crypto-aes-gcm
- Repository: https://github.com/korywka/crypto-aes-gcm
- Homepage: https://github.com/korywka/crypto-aes-gcm#readme
- Issues: https://github.com/korywka/crypto-aes-gcm/issues
- npm.io page: https://npm.io/package/crypto-aes-gcm

## Recent versions

- 2.1.0 (latest) — 2026-01-11
- 2.0.4 — 2026-01-10
- 2.0.3 — 2023-02-06
- 2.0.2 — 2023-02-05
- 2.0.1 — 2023-02-05
- 1.1.0 — 2022-01-14

## README

# crypto-aes-gcm

Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).

This module uses the native WebCrypto API in [node.js](https://nodejs.org/api/webcrypto.html), Deno and the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).

Node and browser: [crypto-aes-gcm](https://www.npmjs.com/package/crypto-aes-gcm)

Deno package: [https://deno.land/x/crypto_aes_gcm](https://deno.land/x/crypto_aes_gcm)

```js
import { aes_gcm_encrypt, aes_gcm_decrypt } from 'crypto-aes-gcm';
const password = '123456';
const message = 'i will never let you go';

const encrypted = await aes_gcm_encrypt(message, password);
console.log(encrypted);

const decrypted = await aes_gcm_decrypt(encrypted, password);
console.log(decrypted);

console.log(message === decrypted);
```

## Original implementation

The code was originally written by [Chris Veness](https://gist.github.com/chrisveness/43bcda93af9f646d083fad678071b90a).

---
_Source: https://npm.io/package/crypto-aes-gcm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
