docs: README at-rest claims match the SQLCipher store (stale since #43) #55

Merged
sirius merged 1 commit from wt/t_f2fc5190 into main 2026-09-12 21:21:07 +00:00
Owner

The README still described the pre-#43 design: only chat bodies encrypted, self.identity_sk and the roster plaintext on disk, and sqlcipher listed as a v1 non-goal. #43 shipped whole-file SQLCipher, so all three claims were false.

What changed (docs only, no code):

  • README.md banner (line 6) — "Chat bodies are encrypted at rest; identity keys in sqlite are still plaintext" → the whole store is encrypted at rest with SQLCipher, with the row-bound AEAD layer kept on top.
  • README.md "Seized laptop" — now describes what ships: the whole onionwire.db is SQLCipher (rusqlite feature bundled-sqlcipher-vendored-openssl), 32-byte key = Argon2id(passphrase, 16-byte salt in store_salt, mode 0600) passed as a raw key (PRAGMA key = "x'…'") as the first statement after open; file header, schema, self.identity_sk, friend pubkeys, locators, profiles and payments are all ciphertext on disk. Fail-closed unlock, encrypted store with store_salt missing refuses to open, and the v0.2.1 plaintext→SQLCipher in-place upgrade is named. The per-message ChaCha20-Poly1305 + row-bound AAD layer is documented as on top of whole-file encryption (it stops row ciphertext swaps; whole-file encryption does not).
  • README.md "Not in v1" (line 319) — dropped sqlcipher; it shipped in #43.
  • docs/SECURITY_AUDIT.md — the "Still true" bullet repeated the same "identity secret key and roster are plaintext" claim. Replaced with the residual risk that actually remains (no defense against a live compromise or a known passphrase), pointing at the threat model.

Caveats deliberately kept honest: /wipe is still not a forensic erase (SSD wear-levelling), at-rest encryption does not protect against a live compromise or an attacker who has the passphrase, and docs/THREAT_MODEL.md remains the reference.

Evidence

Docs-only, so nothing to clippy; the wording was checked against docs/THREAT_MODEL.md, docs/SECURITY_AUDIT.md and src/store.rs, and the load-bearing claims are asserted by existing tests, run on this branch:

cargo test --locked --test store
  21 passed; 0 failed
  whole_store_file_is_encrypted_at_rest ... ok      # chat bodies, friend pubkey hex, locator and identity_sk are not in onionwire.db*
  encrypted_store_without_salt_file_refuses_to_guess ... ok
  wrong_passphrase_touches_nothing_and_leaves_store_readable ... ok

cargo test --locked --lib -- store::
  6 passed; 0 failed
  plaintext_v0_2_1_store_is_encrypted_in_place_and_keeps_history ... ok
  legacy_plaintext_store_with_wrong_passphrase_is_left_untouched ... ok
  swapped_ciphertext_does_not_show_other_friends_body ... ok

grep -rn -i "plaintext|sqlcipher" README.md docs/ now only matches places where it is genuinely true (messages.plaintext column name, application-layer plaintext classification in PROTOCOL.md, the v0.2.1 upgrade notes in THREAT_MODEL.md, Arti state-dir wording).

Merge order / collisions

Branched from origin/main (c39259b) — not stacked on the unmerged docs PRs. README.md is a hotspot: PR #53 also edits README line 6 and line 319, so whichever of #53/#55 lands second needs a trivial rebase (my line-6 edit only touches the final sentence; my line-319 edit only removes , sqlcipher).

Known stale spot left alone deliberately: crates/onionwire-sdk/README.md:22 ("Identity keys in sqlite are plaintext — that is honest, not an oversight.") is the same rot, but that file is inside PR #51's diff, so fixing it here would stack on an unmerged branch. It needs a follow-up card.

Card: t_f2fc5190

The README still described the pre-#43 design: only chat bodies encrypted, `self.identity_sk` and the roster plaintext on disk, and `sqlcipher` listed as a v1 non-goal. #43 shipped whole-file SQLCipher, so all three claims were false. What changed (docs only, no code): - **`README.md` banner (line 6)** — "Chat bodies are encrypted at rest; identity keys in sqlite are still plaintext" → the whole store is encrypted at rest with SQLCipher, with the row-bound AEAD layer kept on top. - **`README.md` "Seized laptop"** — now describes what ships: the whole `onionwire.db` is SQLCipher (`rusqlite` feature `bundled-sqlcipher-vendored-openssl`), 32-byte key = Argon2id(passphrase, 16-byte salt in `store_salt`, mode 0600) passed as a raw key (`PRAGMA key = "x'…'"`) as the first statement after open; file header, schema, `self.identity_sk`, friend pubkeys, locators, profiles and payments are all ciphertext on disk. Fail-closed unlock, encrypted store with `store_salt` missing refuses to open, and the v0.2.1 plaintext→SQLCipher in-place upgrade is named. The per-message ChaCha20-Poly1305 + row-bound AAD layer is documented as *on top of* whole-file encryption (it stops row ciphertext swaps; whole-file encryption does not). - **`README.md` "Not in v1" (line 319)** — dropped `sqlcipher`; it shipped in #43. - **`docs/SECURITY_AUDIT.md`** — the "Still true" bullet repeated the same "identity secret key and roster are plaintext" claim. Replaced with the residual risk that actually remains (no defense against a live compromise or a known passphrase), pointing at the threat model. Caveats deliberately kept honest: `/wipe` is still not a forensic erase (SSD wear-levelling), at-rest encryption does not protect against a live compromise or an attacker who has the passphrase, and `docs/THREAT_MODEL.md` remains the reference. ## Evidence Docs-only, so nothing to clippy; the wording was checked against `docs/THREAT_MODEL.md`, `docs/SECURITY_AUDIT.md` and `src/store.rs`, and the load-bearing claims are asserted by existing tests, run on this branch: ``` cargo test --locked --test store 21 passed; 0 failed whole_store_file_is_encrypted_at_rest ... ok # chat bodies, friend pubkey hex, locator and identity_sk are not in onionwire.db* encrypted_store_without_salt_file_refuses_to_guess ... ok wrong_passphrase_touches_nothing_and_leaves_store_readable ... ok cargo test --locked --lib -- store:: 6 passed; 0 failed plaintext_v0_2_1_store_is_encrypted_in_place_and_keeps_history ... ok legacy_plaintext_store_with_wrong_passphrase_is_left_untouched ... ok swapped_ciphertext_does_not_show_other_friends_body ... ok ``` `grep -rn -i "plaintext|sqlcipher" README.md docs/` now only matches places where it is genuinely true (`messages.plaintext` column name, application-layer plaintext classification in PROTOCOL.md, the v0.2.1 upgrade notes in THREAT_MODEL.md, Arti state-dir wording). ## Merge order / collisions Branched from `origin/main` (c39259b) — not stacked on the unmerged docs PRs. `README.md` is a hotspot: **PR #53 also edits README line 6 and line 319**, so whichever of #53/#55 lands second needs a trivial rebase (my line-6 edit only touches the final sentence; my line-319 edit only removes `, sqlcipher`). Known stale spot left alone deliberately: `crates/onionwire-sdk/README.md:22` ("Identity keys in sqlite are plaintext — that is honest, not an oversight.") is the same rot, but that file is inside PR #51's diff, so fixing it here would stack on an unmerged branch. It needs a follow-up card. Card: t_f2fc5190
The v0.2 banner and the "Seized laptop" section still claimed only chat
bodies were encrypted, that `self.identity_sk` and the roster were
plaintext, and that "sqlcipher is out of v1". That has been false since
#43.

- README banner: whole store is encrypted at rest with SQLCipher, with the
  row-bound AEAD layer kept on top.
- "Seized laptop": whole-file SQLCipher (Argon2id key over the 16-byte
  `store_salt`, raw `PRAGMA key`), identity/friends/locators inside the
  encrypted file, fail-closed unlock and `store_salt`-missing refusal, and
  the in-place v0.2.1 upgrade. Kept the honest caveats: no defense against
  a live compromise or a known passphrase, `/wipe` is not a forensic erase
  (SSD wear-levelling), and THREAT_MODEL.md stays the reference.
- "Not in v1": drop `sqlcipher` (shipped in #43).
- docs/SECURITY_AUDIT.md "Still true" bullet repeated the same plaintext
  claim; restated it as the residual risk that actually remains.

No code change. Evidence: cargo test --test store (21 passed, incl.
whole_store_file_is_encrypted_at_rest) and cargo test --lib -- store::
(6 passed, incl. the plaintext->SQLCipher upgrade and the wrong-passphrase
no-op).

Card: t_f2fc5190
sirius force-pushed wt/t_f2fc5190 from ffe6978fa0 to d256d3bb8e 2026-09-12 21:19:11 +00:00 Compare
sirius merged commit dc4ed84a19 into main 2026-09-12 21:21:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!55
No description provided.