https://github.com/mogeko/aes-gcm
AES-GCM library for TypeScript/JavaScript
https://github.com/mogeko/aes-gcm
Last synced: over 1 year ago
JSON representation
AES-GCM library for TypeScript/JavaScript
- Host: GitHub
- URL: https://github.com/mogeko/aes-gcm
- Owner: mogeko
- License: mit
- Created: 2024-10-13T04:32:30.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-27T02:42:42.000Z (over 1 year ago)
- Last Synced: 2025-02-10T20:20:55.051Z (over 1 year ago)
- Language: TypeScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @mogeko/aes-gcm
[](https://github.com/mogeko/aes-gcm/actions/workflows/test.yaml)
[](https://codecov.io/gh/mogeko/aes-gcm)
[](https://jsr.io/@mogeko/aes-gcm)
A library that implements AES-GCM algorithm encryption and decryption for
TypeScript/JavaScript.
Galois/Counter Mode (GCM) uses a block cipher with block size 128 bits (commonly
AES-128) operated in counter mode for encryption, and uses arithmetic in the
Galois field GF(2128) to compute the authentication tag; hence the name.
## Installation
```sh
deno add @mogeko/aes-gcm
```
For Node.js users:
```sh
npx jsr add @mogeko/aes-gcm
```
## Usage
```ts
import { decrypt, encrypt } from "jsr:@mogeko/aes-gcm";
import { assertEquals } from "jsr:@std/assert/equals";
const cipher = await encrypt("Hello, world!", "pa$$w0rd");
assertEquals(await decrypt(cipher, "pa$$w0rd"), "Hello, world!");
```
## LICENSE
The code in this project is released under the [MIT License](./LICENSE).