stable

`@noy-db/on-*` — Authentication / unlock paths

The unlock catalog: every on-* method a user can prove identity with — passkeys, OIDC, magic links, TOTP, recovery codes, Shamir, PIN, and threat defence.

How a user proves who they are. noy-db encrypts everything client-side: each vault's data is protected by data-encryption keys (DEKs), held in the user's keyring and wrapped by a single key-encryption key (KEK). Each on-* package is one way to unlock that keyring. Composable — stack them however your threat model needs.

The on- prefix reads as "you get on via this method." Every package in this family is a crypto primitive only — storage, rate-limiting, audit integration, and UI belong to the caller.

Overview — by tier and integration

The whole family at a glance, next to the one kernel-built credential (the tier-1 secret). This is the same catalog surfaced on the authentication page — single-sourced:

Auth methods — the on-* family and the kernel tier
MethodTier / roleFactorIntegrationWhat it does
secret → KEKTier 1Root secretKnowledge kernel The master secret; PBKDF2-SHA256 (600k) derives the KEK. Built into @noy-db/hub — no on- package.
on-passwordTier 2AuthenticatorKnowledge external pkg A separate frequently-typed password as a keyring slot wrapping the DEK set (LUKS-style); unlock yields kek: null.
on-webauthnTier 2Authenticator (passkey/biometric)Possession · Biometric external pkg Hardware-key / passkey unlock via WebAuthn PRF (rawId fallback); wraps the DEK map, not the KEK.
on-oidc
GoogleAppleLINEMicrosoftMetaAWS Cognito
Tier 2Authenticator (federated)Provider-set external pkg Federated login via a Bitwarden-style XOR key connector; the server never sees the KEK.
on-pinTier 3Quick unlockKnowledge external pkg Short-PIN warm resume of an already-unlocked session; cannot cold-open, never holds a KEK.
on-totp
Google AuthenticatorAuthy1PasswordMicrosoft Authenticator
2FAStep-up factorPossession external pkg RFC-6238 TOTP second factor a policy gate can demand; not an unlock.
on-email-otp2FAStep-up factorPossession external pkg Short-lived emailed codes via caller transport; not an unlock.
on-recoveryRecoveryRecovery (paper)Possession external pkg Printable one-time codes; last-resort unlock, burned after use.
on-shamirRecoveryRecovery (k-of-n)Possession ×N external pkg Splits the KEK into k-of-n shares; combining reconstructs the real KEK.
on-magic-linkViewerDelegated viewerPossession external pkg Single-use link opening a read-only viewer session, no secret; server-secret-bound HKDF.
on-threatOverlayThreat overlay— external pkg Lockout / duress-wipe / honeypot logic layered on unlock attempts; not a factor.

Factor — Knowledge (something you remember) · Possession (a device you hold) · Biometric (something you are) · Provider-set (chosen by the OIDC issuer) · — not a factor.

Catalog

Device / SSO

PackageWhat it does
webauthnHardware-key passkey unlock via WebAuthn PRF — Touch ID, Face ID, Windows Hello, YubiKey. No secret at all.
oidcSplit-key OIDC bridge — the KEK is XOR-split between a device half and a server half; the server never sees plaintext. Requires operating a key-connector server.

Delegation

PackageWhat it does
magic-linkOne-shot viewer session — a single-use, vault-bound URL opens a read-only session; no account, no shared secret.

Recovery

PackageWhat it does
recoveryLast-resort unlock via printable Base32 codes (28 chars, 120 bits of entropy) that burn on use.
shamirk-of-n Shamir Secret Sharing of the KEK for multi-party custody; each share composable with another on-* method.

Second factor

PackageWhat it does
totpRFC 6238 authenticator-app codes, zero dependencies, constant-time verification against the official test vectors.
email-otpEmail OTP with a caller-supplied transport (SMTP / SES / Postmark / any function) and constant-time verification.
passwordRoutine tier-2 login password — a separate secret from the tier-1 master phrase, PBKDF2-SHA256 600K wrapping the DEK set.

Local lock

PackageWhat it does
pinSession-resume PIN / biometric quick-lock (tier 3) — re-unlocks cached DEKs without re-typing the secret.

Defence

PackageWhat it does
threatLockout + duress + honeypot triad — pure stateful primitives for brute-force lockout, coercion response, and decoy vaults.

Compare

PackageProvesNeeds a server?Role
webauthnpossession-of-device (hardware authenticator, optional biometric)✗primary unlock
oidcfederated identity (OIDC ID token)✓primary unlock
magic-linkemail-delegation (bearer of a single-use URL)✓delegated unlock
recoveryone-time recovery code (burns on use)✗recovery
shamirrecovery-shares (k-of-n reconstruction)✗recovery
totpone-time-code (authenticator app)✗step-up 2FA
email-otpone-time-code (email)✓step-up 2FA
passwordknowledge (tier-2 password)✗primary unlock
pinknowledge (short PIN / biometric)✗quick-resume (tier 3)
threatn/a✗defence overlay