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.
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
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.
๐ 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*base32Encrypt with confidence
Authenticated, purpose-scoped, zero-dependency. Built for real applications.