@namesmt/aes-gcm is a dead simple cross-platform AES-GCM encryption util package.
Note: The result of encrypt
function is the string of base64 encoded IV and ciphertext, concatenated with a separator.
- TypeScript ready!
# npm
npm install @namesmt/aes-gcm
# yarn
yarn add @namesmt/aes-gcm
# pnpm (recommended)
pnpm install @namesmt/aes-gcm
// ESM
import { decrypt, encrypt } from '@namesmt/aes-gcm'
const plaintext = 'Hello, world!'
const password = 'pw'
const encrypted = await encrypt(plaintext, password)
const decrypted = await decrypt(encrypted, password)
- Become the legendary 10000x developer