Skip to content

Claude/check paramant post quantum p2 hhi#27

Merged
Apolloccrypt merged 2 commits into
mainfrom
claude/check-paramant-post-quantum-p2Hhi
Apr 25, 2026
Merged

Claude/check paramant post quantum p2 hhi#27
Apolloccrypt merged 2 commits into
mainfrom
claude/check-paramant-post-quantum-p2Hhi

Conversation

@Apolloccrypt
Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits April 25, 2026 17:37
…M row

The crypto-stack table previously hid the classical leg of the hybrid
(ECDH P-256, present in crypto-wasm/src/lib.rs) and conflated relay-side
STH/receipt signing with client-side signing — which only the Node/Python
SDK actually performs today. The browser ParaShare/Drop path encrypts but
does not yet sign client-side. Site copy on paramant.app implies otherwise.

Also tighten the "what a compromised relay cannot do" row: a registered
pubkey substitution is only ruled out *after* an out-of-band fingerprint
check (TOFU model), which the rest of the docs already assume.
Closes HIGH-2 from the post-quantum review on this branch: the WASM
AES-256-GCM call previously had no Associated Data, so the wire-format
header (magic byte, length prefixes, sender ECDH pubkey, nonce, ctLen)
was only authenticated implicitly via cascade — HKDF salt = ctKem[..32]
makes a tampered ctKem derive a different key, and AES-GCM fails. That
is a secure-by-failure outcome but not explicit binding; mutated length
prefixes can shift parsing offsets in surprising ways before the AEAD
tag is even reached.

Now: encrypt_blob produces magic 0x03 and passes the entire wire prelude
(offset 0 through u32be(ctLen)) to AES-GCM as Associated Data, so any
in-flight mutation is rejected explicitly with a clean auth error.
decrypt_blob accepts both 0x02 (legacy, no AAD) and 0x03 (AAD-bound)
so already-uploaded blobs keep decrypting.

Also:
- Cargo.toml: disable wasm-pack's wasm-opt step. wasm-opt downloads a
  binaryen tarball at build time, which fails offline and makes the
  SHA-256 pin in crypto-bridge.js non-reproducible. ~50 KB code-size cost
  is worth "anyone with stable Rust + wasm-pack rebuilds to the same
  hash."
- crypto-bridge.js: update WASM_SHA256 pin and the wire-format comment.
- crypto-wasm/test.js: load noble from relay/node_modules; cover the new
  magic byte; add a tamper-detection negative test (flip a byte in the
  prelude, expect rejection).
- frontend/pkg/: rebuilt artifacts.

Verified: node crypto-wasm/test.js — round-trip OK, tamper detected.
@Apolloccrypt Apolloccrypt merged commit 12bf912 into main Apr 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants