Getting Started
@ppabari/encryptix is a secure, zero-dependency crypto toolkit for Node.js, browsers, and edge runtimes β AES-256-GCM, ChaCha20-Poly1305, RSA, ECDH/ECDSA, AES-SIV, TOTP/HOTP, envelope encryption, streaming, signed tokens, and more.
Installation
npm install @ppabari/encryptix
# or
pnpm add @ppabari/encryptix
# or
yarn add @ppabari/encryptix
Quick Start
import { EncryptixClient, generateMasterKey } from '@ppabari/encryptix';
// One-time: generate and store your master key
const key = generateMasterKey(); // 64-char hex = 32 bytes
// β store as ENCRYPTIX_KEY in your environment
// Create a client (reads ENCRYPTIX_KEY from env automatically)
const enc = new EncryptixClient();
// Encrypt and decrypt
const payload = await enc.encrypt('user@example.com', 'user:email');
const email = await enc.decrypt(payload, 'user:email');
π
Store your key safely. Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, Doppler). Never commit it to source control.
Whatβs next
- Core Concepts β purpose scoping, the zero-dependency model, and the payload layout.
- Configuration β client options and environment variables.
- API Overview β the full method reference.
Runtime support
| Environment | Supported | Notes |
|---|---|---|
| Node.js | β β₯ 18 | Web Crypto is global from Node 18. |
| Browsers | β modern | Chrome, Edge, Firefox, Safari. |
| Deno / Bun | β | Web Crypto built in. |
| Cloudflare Workers / Vercel Edge | β | And other edge runtimes. |
βΉοΈ
ChaCha20-Poly1305 and scrypt use Node's native crypto module and are Node-only. Everything else runs on the universal Web Crypto API.