@ppabari/encryptix
v1.0.0A zero-dependency crypto toolkit
Application crypto usually fails not because the primitives are weak, but because the wiring around them is wrong: a nonce reused, a key with no rotation path, a ciphertext that cannot be decrypted after a deploy. encryptix is built around those failure modes rather than around the algorithm list.
Keys are purpose-scoped through HKDF, so a key derived for one context cannot silently decrypt another. Rotation produces payloads that stay backward-compatible, so old ciphertexts keep working after you turn the key over. Key fingerprinting makes multi-key debugging tractable. AES-SIV covers the deterministic-encryption case you need for searchable fields, where a random nonce would make lookups impossible.
It ships with zero runtime dependencies and runs on Node 18+, browsers, Cloudflare Workers, Deno, and Vercel Edge from the same import — because it is built on Web Crypto rather than Node internals.
Install
npm install @ppabari/encryptixUsage
import { EncryptixClient } from '@ppabari/encryptix'
const enc = new EncryptixClient() // reads ENCRYPTIX_KEY from env
const payload = await enc.encrypt('user@example.com', 'user:email')
const email = await enc.decrypt(payload, 'user:email')Highlights
- Zero runtime dependencies
- AES-256-GCM, ChaCha20-Poly1305, RSA-OAEP
- AES-SIV deterministic encryption for searchable fields
- Envelope encryption with the DEK/KEK pattern
- HKDF derivation with purpose scoping
- Key rotation with backward-compatible payloads
- Signed tokens, streaming encryption, TOTP/HOTP
- Node 18+, browsers, and edge runtimes