Repository navigation
kavrix 0.2.28 — Protected database backup (kavrix backup)
Protected database backup — kavrix backup create | verify | restore
Kavrix never holds your keys, and losing every valid owner key and recovery kit is unrecoverable by design. 0.2.28 adds the missing safety net: one command seals your whole database file into a single passphrase-protected archive you can keep anywhere.
What's new
kavrix backup create --file ./work.backup.json --profile work
kavrix backup verify --file ./work.backup.json
kavrix backup restore --file ./work.backup.json --data-file ./restored.kavrixbackup createseals the local database file of the selected profile into one JSON archive, encrypted with XChaCha20-Poly1305 under an Argon2id key derived from a new backup passphrase (minimum 16 bytes, confirmed twice, masked prompt or stdin frames — never argv).- Tamper-evident by construction: the archive header — format, version, creation time, datastore kind, opaque database identity, exact plaintext length, and derivation parameters — is authenticated associated data. An archive cannot be relabeled to another database, truncated, or spliced without failing authentication. A wrong passphrase and a modified archive are deliberately indistinguishable (generic authentication failure, exit 10).
backup verifyauthenticates an archive and reports its database ID, sealed byte length, and creation time without writing anything. Malformed or unknown documents fail with exit 16 before any key derivation.backup restorepublishes the database file to a new destination through the protected-file writer (atomic, owner-only permissions, no clobber without--overwrite). The restored file is the same database: the original owner key unlocks it, orkavrix db recovery usere-anchors ownership from a recovery kit.kavrix frames "backup create"documents the stdin frame contract for automation.
Scope: local-file datastore profiles in this release (MongoDB archive backup refuses with a clear message). Archives are bounded at 128 MiB of database plaintext. Keep archives and their passphrase on separate protected media from the owner key and recovery kits.
Verification
9 crypto envelope tests (round-trip, wrong passphrase, tampered ciphertext/tag, AAD transplant, length mismatch, malformed documents) and 4 end-to-end CLI tests — including restoring a database and authenticating it under the original owner key. Exact-SHA CI and CodeQL passed on the tagged commit; the npm archive is published through trusted publishing with OIDC provenance.
Install / upgrade
npm install --global kavrix@0.2.28
kavrix --version # 0.2.28Full changelog: v0.2.27...v0.2.28