Skip to content

v0.24.0 — hashing + encryption

Choose a tag to compare

@tshafer tshafer released this 10 Jul 21:04
· 144 commits to main since this release

Auth foundations, edge-safe via Web Crypto (no bcrypt to compile):

const hashed = await hash.make(password);
await hash.verify(hashed, password);           // timing-safe

const token = await encryption.encrypt({ userId: 1 });
await encryption.decrypt(token);                // { userId: 1 } | null

Hashing is PBKDF2-SHA256 (self-describing, with needsRehash()); encryption is AES-GCM keyed by config('app.key'), returning null on tampered payloads. See docs/hashing.md.