v1.0.0 ยท zero dependencies ยท AEAD by default

Encryption that's hard to misuse.

A zero-dependency crypto toolkit for Node.js, browsers & edge. AES-256-GCM, ChaCha20, RSA, ECDH/ECDSA, AES-SIV, TOTP, envelope encryption, streaming & signed tokens โ€” all purpose-scoped and authenticated.

$ npm install @ppabari/encryptix
vault.ts
import { EncryptixClient, generateMasterKey } from '@ppabari/encryptix';

// Generate once, store as ENCRYPTIX_KEY
const key = generateMasterKey();        // 64-char hex = 32 bytes
const enc = new EncryptixClient();     // reads ENCRYPTIX_KEY from env

// Purpose-scoped, authenticated encryption
const payload = await enc.encrypt('user@example.com', 'user:email');
const email   = await enc.decrypt(payload, 'user:email');

// Wrong purpose fails โ€” even with the correct key
await enc.decrypt(payload, 'payment:card'); // โœ— throws
0
runtime dependencies
AEAD
authenticated by default
4
runtimes: Node ยท browser ยท Deno ยท edge
100%
TypeScript typed
Why encryptix

Safe defaults, serious primitives

A batteries-included crypto layer that's ergonomic enough for app code and rigorous enough for the sensitive stuff.

๐Ÿ”’

Authenticated by default

Every symmetric cipher is AEAD โ€” tampering is always detected. There is no unauthenticated mode to misuse.

๐ŸŽฏ

Purpose scoping

Each operation is bound to a purpose string via HKDF + AAD. A ciphertext for auth:session can never be read as payment:card.

๐Ÿ“ฆ

Zero dependencies

Built on the Web Crypto API. No supply-chain surface, tiny footprint, ships ESM + CJS with full types.

๐ŸŒ

Runs everywhere

Node.js โ‰ฅ18, modern browsers, Deno, Bun, Cloudflare Workers & Vercel Edge โ€” one API across all of them.

โœ‰๏ธ

Envelope & rotation

DEK/KEK envelope encryption, key rotation with backward-compatible payloads, and key fingerprinting for multi-key debugging.

๐Ÿ”‘

Batteries included

Signed tokens, TOTP/HOTP, RSA & EC keys, password KDF, streaming, deterministic search fields, multi-recipient โ€” all in one toolkit.

The toolkit

Everything you need to encrypt

One client, many primitives. Full reference โ†’

๐Ÿ” Symmetric

encryptdecryptencryptObjectAES-256-GCMChaCha20

๐Ÿ”Ž Deterministic

encryptDeterministicAES-SIVsearchable

โœ‰๏ธ Envelope

envelopeEncryptDEK/KEKmultiRecipientEncrypt

๐ŸŒŠ Streaming

encryptStreamdecryptStreamchunked AEAD

๐ŸŽซ Signed Tokens

signverifyHMAC-SHA256

๐Ÿ” Asymmetric

RSA-OAEPRSA-PSSECDHECDSA

๐Ÿ“ฑ OTP

generateTOTPverifyTOTPgenerateHOTP

๐Ÿ—๏ธ Keys

deriveKeyFromPasswordrotatekeyFingerprintzeroize

๐ŸŽฒ Utilities

hashhmacsecureRandom*base32

Encrypt with confidence

Authenticated, purpose-scoped, zero-dependency. Built for real applications.