Skip to content
Scriptix LabsBeyond the Stack
Open source

The pieces we kept rewriting, published properly

Both packages are live on npm with zero runtime dependencies, full TypeScript types, generated API docs, and CI on every commit. They are also the clearest sample of how we build.

@ppabari/encryptix

v1.0.0

A 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/encryptix

Usage

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

@ppabari/strio

v1.1.0

Secure string generation, and 60+ string helpers

Almost every codebase grows its own `generateToken` helper, and most of them are subtly biased — a modulo over random bytes skews the character distribution, which quietly reduces the entropy you thought you had. strio does the rejection sampling properly so the output is uniform.

Beyond raw tokens it covers the shapes you actually reach for: prefixed record IDs with a checksum (`usr_K3xP9mQr2L4Xc`), human-memorable passphrases, patterned codes from a template like `####-AAAA-####`, and expiring tokens that hand back both the token and its expiry. An entropy calculator tells you how strong a given configuration really is.

It doubles as a general string toolkit — 60-plus helpers for casing, truncation, slugs, padding, and comparison — so it tends to replace two or three small dependencies at once. There is a CLI too, usable straight through npx with no install.

Install

npm install @ppabari/strio

Usage

import { generateId, generatePassphrase } from '@ppabari/strio'

generateId({ prefix: 'usr' })      // → 'usr_K3xP9mQr2L4Xc'
generatePassphrase({ words: 4 })   // → 'stone-river-proud-flame'

Highlights

  • Bias-free generation via rejection sampling
  • Prefixed IDs with checksums
  • Memorable passphrases and patterned codes
  • Expiring tokens with an expiry timestamp
  • Built-in entropy calculator
  • 60+ general string utilities
  • CLI via npx, no install needed
  • Zero dependencies, fully typed
Contact

Tell us what you're building

A few sentences is enough to start. If it's a fit we'll come back with questions and a rough shape; if it isn't, we'll say so rather than waste your time.

We reply within one business day.