Implemet mailstones 0-1
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
The target is a maintained Signal-protocol implementation supporting the exact PQXDH suite selected by the project, including ML-KEM where supported by that implementation. Do not assume that a standalone ML-KEM library plus X25519 automatically implements PQXDH.
|
||||
|
||||
The Android foundation currently provisions a local ECDSA P-256 signing key in Android Keystore and exposes its public key and SHA-256 fingerprint to the development UI. This is a storage/API skeleton only: it is not post-quantum, does not authenticate another device, and is not yet bound to an account, signed prekey bundle, or selected PQXDH profile. Do not show it as proof that a call or peer is secure.
|
||||
|
||||
Before selecting a dependency, record:
|
||||
- upstream project and exact version/commit
|
||||
- license and maintenance status
|
||||
|
||||
+42
-11
@@ -9,37 +9,68 @@ M0 requires a reviewed threat model and selected, audited crypto and SFrame inte
|
||||
|
||||
| Area | Finding | M0 decision |
|
||||
|---|---|---|
|
||||
| PQXDH | Signal's PQXDH specification defines a parameterized protocol, but the implementation suite and encodings must match exactly across clients. PQXDH authenticates classically in the current spec; its post-quantum property is for forward secrecy, not quantum-resistant peer authentication. | Keep PQXDH as the handshake design candidate. Require identity verification and an explicitly versioned, interoperable suite. |
|
||||
| Signal libsignal | The upstream project provides Android artifacts for `armeabi-v7a`, `arm64-v8a`, `x86`, and `x86_64`. Its current PQXDH source labels the KDF suite `X25519_SHA-256_CRYSTALS-KYBER-1024`; that is not evidence of compatibility with standardized ML-KEM. The library is AGPL-3.0-only. | Do not select it for the requested PQXDH + ML-KEM suite until upstream confirms an ML-KEM-compatible protocol/API and interoperability vectors. Resolve AGPL obligations before adoption. |
|
||||
| ML-KEM | A standalone ML-KEM implementation is not a PQXDH implementation. Substituting it into the Signal suite or combining it with X25519 locally would create an unreviewed protocol variant. | Select only a maintained implementation that explicitly supports the exact agreed PQXDH profile, or wait for a compatible audited upstream implementation. Do not compose primitives in this project. |
|
||||
| SFrame | RFC 9605 specifies the frame encryption format and delegates key management, sender authentication, and anti-replay behavior to the application. The WebRTC Encoded Transform API is a browser API and does not establish availability from the Android native Java API used by this app. WebRTC has native C++ frame-encryptor interfaces; Kotlin access and packaged-build compatibility still need proof. | Keep RFC 9605 as the format candidate. Prototype the Android encoded-audio path using a pinned WebRTC build and native/JNI integration before selecting a library or claiming SFrame support. |
|
||||
| WebRTC packaging | Signal's RingRTC is a maintained Android/native WebRTC middleware reference, but it is AGPL-3.0-only and is not itself evidence that its media encryption behavior is RFC 9605 SFrame. | Use only as a technical reference unless licensing and exact SFrame behavior are established. |
|
||||
| PQXDH | Signal's PQXDH specification defines a parameterized protocol, but the implementation suite and encodings must match exactly across clients. The current spec's example KEM is pre-standardization CRYSTALS-Kyber-1024. PQXDH authenticates classically in the current spec; its post-quantum property is for forward secrecy, not quantum-resistant peer authentication. | Keep PQXDH as the handshake design candidate. Require identity verification and an explicitly versioned, interoperable suite. |
|
||||
| Signal libsignal | The upstream project provides Android artifacts for `armeabi-v7a`, `arm64-v8a`, `x86`, and `x86_64`. Its current PQXDH source labels the KDF suite `X25519_SHA-256_CRYSTALS-KYBER-1024`; this is not standardized FIPS 203 ML-KEM. Signal's separate ML-KEM Braid is a post-handshake sparse continuous key agreement/ratchet, not a replacement PQXDH handshake. libsignal is AGPL-3.0-only. | Do not select it as an exact PQXDH + FIPS 203 ML-KEM handshake. Evaluate separately whether its Kyber PQXDH plus ML-KEM Braid meets the product's desired call-session properties, and resolve AGPL obligations before adoption. |
|
||||
| ML-KEM | A standalone ML-KEM implementation is not a PQXDH implementation. Signal publishes an ML-KEM Braid specification that can take a PQXDH shared secret as its initial secret, but it is a separate, stateful SCKA protocol with significant message/chunk and integration requirements. | Keep ML-KEM Braid as a possible post-handshake ratchet research path. Do not substitute KEMs in PQXDH or combine primitives locally. First decide whether a brief call requires a continuous PQ ratchet. |
|
||||
| Upstream WebRTC SFrame | WebRTC has now imported Cisco's SFrame library and added internal native `SframeEncryptor` / `SframeDecryptor` classes. Recent changes are still wiring the media path: upstream change notes say audio SFrame is not yet fully handled, and the receive path is also being connected. I found no SFrame-specific public Android Java API in the upstream Android API/source listings. | Strong upstream direction, but not yet a ready Android integration. Recheck once audio send/receive, Java/JNI exposure, and release packaging are complete. |
|
||||
| SFrame legacy frame hooks | RFC 9605 specifies frame encryption and delegates key management, sender authentication, and anti-replay behavior to the application. Android `RtpSender.setFrameEncryptor(...)` / JNI and `RtpReceiver.setFrameDecryptor(...)` can accept native `FrameEncryptorInterface` / `FrameDecryptorInterface`; upstream labels these interfaces “not ready for production use.” These generic hooks do not themselves implement SFrame. | Keep RFC 9605 as the format candidate. An integration must be shown byte-compatible with RFC 9605 and tested against its vectors; do not treat successful use of the legacy hook as proof of SFrame. |
|
||||
| Android WebRTC prototype artifact | Inspected Maven Central AAR `io.github.webrtc-sdk:android:150.7871.04` locally (2026-11-16), SHA-256 `1872dda4e3bf7d6ea6f7c6e11861332081c57081a1e62fc82fab72415c69c84c`. Its `classes.jar` contains legacy `FrameEncryptor` / `FrameDecryptor` hooks, setters on `RtpSender` / `RtpReceiver`, and custom `FrameCryptor` types; its `.so` files contain both legacy JNI setters for `armeabi-v7a`, `arm64-v8a`, `x86`, and `x86_64`. No `SframeEncryptor` / `SframeDecryptor` Java class or native symbol was found in the AAR. It contains only a manifest, classes jar and four native libraries, with no license/notice files. The GitHub repository declares MIT, while the Maven POM declares BSD 3-Clause; this discrepancy and the lack of an independently checked Maven checksum/signature-to-release mapping remain unresolved. | **Passes legacy API/ABI existence check only.** Do not select for production or treat its `FrameCryptor` as RFC 9605 SFrame without a wire-format/vector proof. Resolve license metadata, complete third-party notices and artifact provenance before adoption. |
|
||||
| WebRTC alternatives | Google upstream documents building a WebRTC AAR, but its Android development guide requires a large source/toolchain checkout (about 16 GB including Android components). Signal's RingRTC is an Android/native WebRTC middleware reference, but AGPL-3.0-only and not evidence by itself of RFC 9605 behavior. | Prefer the pinned prebuilt artifact for an initial API/linkage spike; use a source build only if native implementation or artifact provenance requires it. Keep RingRTC as a technical reference unless licensing and exact SFrame behavior are established. |
|
||||
|
||||
## PQXDH + ML-KEM candidate screen
|
||||
|
||||
**Result: no acceptable Android library selected.** The PQXDH specification is parameterized, so an ML-KEM-1024 profile is possible in principle; the library still needs to implement the full authenticated prekey protocol and a reviewed, interoperable profile. A primitive library or an X25519 + ML-KEM combiner is not sufficient.
|
||||
|
||||
| Candidate | What public sources show | Decision |
|
||||
|---|---|---|
|
||||
| Signal `libsignal` | Android artifacts and a mature Signal protocol implementation are available, but its PQXDH KEM suite is round-3 CRYSTALS-Kyber-1024 (`0x08`), not FIPS 203 ML-KEM-1024. It is AGPL-3.0-only. | Not suitable for the stated FIPS 203 handshake requirement unless upstream publishes a compatible profile/API; separately resolve AGPL terms. |
|
||||
| `pqxdh-zoa` Rust crate 0.1.1 | Docs show a generic PQXDH construction with ML-KEM-1024, but the example uses `ed25519-dalek` signatures and several pre-release Rust dependencies. It is not an Android library, and I found no independent audit or interop evidence for the required XEdDSA/Signal profile. | Research reference only; not a dependency candidate. |
|
||||
| `@open-e2ee/signal-protocol-sdk` | Its security document describes FIPS 203 ML-KEM-1024, but also states it is not canonical Signal Messenger compatibility and does not implement XEdDSA. It is JavaScript, not the Kotlin/native Android integration required here. | Not suitable for this Android client or Signal profile. |
|
||||
| PQXDH.NET 0.1.0 | The NuGet page claims X25519 + ML-KEM-1024 and .NET Standard support, but labels it an experimental AI-assisted project and tells users to conduct their own security review. It does not provide a Kotlin/JNI Android API or independent interoperability evidence. | Reject for this security-critical dependency gate. |
|
||||
| Kodium | Public project docs describe X3DH/Double Ratchet plus a separate ML-KEM hybrid feature, and explicitly state it has not been audited. Its PQ feature is not the required PQXDH implementation. | Not suitable. |
|
||||
|
||||
This screen is not proof that no implementation exists anywhere. It records that no candidate found in this review meets the repository's stated protocol, platform, maintenance and security-review requirements. Do not relax those requirements by composing a local variant.
|
||||
|
||||
## Repo-specific implications
|
||||
|
||||
- The Go API, keyserver, signaling and push services are placeholders. No service should handle private keys, handshake secrets, or clear audio. The key directory should store and return versioned public bundles only, with atomic one-time-prekey consumption designed before implementation.
|
||||
- Android currently has only a Compose shell and no WebRTC or Signal dependencies. The locally present Gradle changes (AGP 8.13.2, Java/Kotlin JVM 21 and wrapper files) are preserved. The app has `minSdk 29`; candidate native artifacts must be checked against this baseline and all intended ABIs.
|
||||
- Docker Compose is development-only. It has PostgreSQL health checking and loopback-bound service ports, but no TLS termination, coturn relay publication, or production secrets setup. It is not part of the crypto feasibility proof.
|
||||
- The threat model already names the right assets and adversaries, but needs explicit SFrame sender-authentication, nonce/counter, replay-window, key-rotation and downgrade requirements before M0 approval.
|
||||
- [THREAT-MODEL.md](THREAT-MODEL.md) now states the MVP trust boundary and fail-closed media invariants, including directional key separation, downgrade rejection, counter continuity, replay handling, rotation and teardown. It remains an M0 draft for project-owner review; exact suite/KDF/window parameters and UX remain open until candidate selection.
|
||||
|
||||
## Required proof work before M0 can exit
|
||||
|
||||
1. **PQXDH/ML-KEM compatibility:** identify an upstream-supported profile with exact KEM parameter set, protocol revision, encodings, signatures, Android API, license, release/commit and security review history. Obtain upstream confirmation where the docs/API are ambiguous.
|
||||
1. **PQXDH/ML-KEM compatibility:** no candidate currently passes the screen above. Identify an upstream-supported Android profile with exact KEM parameter set, protocol revision, encodings, signatures, license, release/commit and security review history. Obtain upstream confirmation where the docs/API are ambiguous.
|
||||
2. **Two-client interoperability:** produce a minimal Android initiator/responder proof using the selected library, published vectors or independently reviewed test vectors, failure cases, and confirmation that the profile is ML-KEM rather than the older Kyber variant.
|
||||
3. **SFrame audio hook:** pin a WebRTC build and show encoded Opus frames entering/leaving the Android native frame transform on supported ABIs. Check overhead, frame loss/reordering behavior, and RFC 9605 test vectors. Do not write an SFrame implementation from scratch as part of the app.
|
||||
3. **SFrame audio hook:** the candidate AAR proves legacy encryptor/decryptor hook classes and JNI setters for all four packaged ABIs, but not SFrame compliance. Current upstream has an RFC 9605 crypto core and native encryptor/decryptor, while media-pipeline integration and Android exposure remain incomplete. The next proof is a pinned build that can create/configure SFrame sender and receiver contexts for encoded Opus, then pass RFC 9605 vectors and two-device media tests. Before using the prebuilt candidate, reconcile its license metadata and collect complete third-party notices. Do not write SFrame cryptography from scratch as part of the app.
|
||||
4. **Key management and identity:** specify transcript binding, authenticated device identity, verified/unverified UX, per-sender directional media keys, key IDs/epochs, anti-replay state, rotation, teardown, and recovery after ICE restart. PQXDH output must feed a reviewed key schedule; signaling must not be trusted to authenticate peers.
|
||||
5. **License and maintenance review:** record exact dependency versions/commits, licenses, release cadence, supported Android API/ABIs, vulnerability reporting process and update strategy.
|
||||
|
||||
## Recommendation
|
||||
|
||||
Proceed with a bounded M0 proof-of-feasibility, but keep the dependency selection gate open. Treat libsignal as the leading PQXDH reference, not as a confirmed ML-KEM solution. For SFrame, prove the Android native frame hook first; a browser transform or a generic “frame encryption” API is insufficient evidence of RFC 9605 compatibility. M0 is complete only after both proofs, the license review, and the missing threat-model decisions are recorded.
|
||||
Proceed with M0 research, but keep both dependency gates open. No reviewed Android PQXDH + FIPS 203 ML-KEM implementation has passed selection. Treat libsignal as a protocol reference, not a compliant dependency. Evaluate ML-KEM Braid separately as a possible post-handshake ratchet, not as interchangeable with PQXDH. Upstream WebRTC is adding an RFC 9605 core, but its Android audio path is incomplete. The candidate AAR passes only a legacy hook presence check; its cryptor's SFrame conformance, license metadata and artifact provenance remain unverified. M0 is complete only after both a compatible PQXDH/ML-KEM implementation and a pinned Android SFrame audio path pass interoperability/vector checks, license review and threat-model review.
|
||||
|
||||
## Sources
|
||||
|
||||
- [Signal PQXDH specification](https://signal.org/docs/specifications/pqxdh/)
|
||||
- [libsignal source and Android artifact documentation](https://github.com/signalapp/libsignal) and [current PQXDH implementation](https://github.com/signalapp/libsignal/blob/main/rust/protocol/src/pqxdh.rs)
|
||||
- [libsignal issue documenting Kyber1024 versus final ML-KEM distinction](https://github.com/signalapp/libsignal/issues/593)
|
||||
- [`pqxdh-zoa` crate documentation](https://docs.rs/pqxdh-zoa/latest/pqxdh_zoa/)
|
||||
- [`open-e2ee/signal-protocol-js` security model](https://github.com/open-e2ee/signal-protocol-js/blob/main/docs/SECURITY.md)
|
||||
- [PQXDH.NET package and its own security-review notice](https://www.nuget.org/packages/PQXDH/)
|
||||
- [Kodium project overview and audit disclaimer](https://github.com/LivotovLabs/kodium)
|
||||
- [Signal ML-KEM Braid specification](https://signal.org/docs/specifications/mlkembraid/)
|
||||
- [RFC 9605: SFrame](https://www.rfc-editor.org/rfc/rfc9605.html)
|
||||
- [W3C WebRTC Encoded Transform](https://www.w3.org/TR/webrtc-encoded-transform/)
|
||||
- [WebRTC native frame-encryptor API history](https://webrtc.googlesource.com/src/%2B/ea0869145ed5ccc743908c51e882c747bbefa25e)
|
||||
- [Upstream Android FrameEncryptor interface and production-readiness caveat](https://webrtc.googlesource.com/src/+/refs/heads/main/sdk/android/api/org/webrtc/FrameEncryptor.java)
|
||||
- [Upstream Android RtpSender JNI setter](https://webrtc.googlesource.com/src/+/refs/heads/main/sdk/android/api/org/webrtc/RtpSender.java)
|
||||
- [Upstream native RtpSender frame-encryptor binding](https://webrtc.googlesource.com/src/+/refs/heads/main/sdk/android/src/jni/pc/rtp_sender.cc)
|
||||
- [WebRTC change importing the SFrame library](https://webrtc.googlesource.com/src/%2B/4dc35d5e89cb56e91b6d417897bc730256957129)
|
||||
- [WebRTC native SFrame encryptor implementation](https://webrtc.googlesource.com/src/%2B/26b31d40fe8f13d76d70076223b11437ce0471a8/modules/sframe/sframe_encryptor.cc)
|
||||
- [WebRTC change noting incomplete audio SFrame integration](https://webrtc.googlesource.com/src.git/%2B/08dca3a0742f6df93841433e0e92c4cb1cd59c52%5E%21/)
|
||||
- [WebRTC upstream branch and recent receive-path integration work](https://webrtc.googlesource.com/src)
|
||||
- [webrtc-sdk Android Maven artifact instructions and MIT repository license](https://github.com/webrtc-sdk/android)
|
||||
- [webrtc-sdk Android v150.7871.04 release](https://github.com/webrtc-sdk/android/releases/tag/v150.7871.04)
|
||||
- [Maven Central POM metadata for the inspected artifact](https://central.sonatype.com/artifact/io.github.webrtc-sdk/android/150.7871.04)
|
||||
- [webrtc-sdk maintained upstream fork description](https://github.com/webrtc-sdk)
|
||||
- [Official WebRTC Android AAR build guide](https://webrtc.googlesource.com/src/+/main/docs/native-code/android/README.md)
|
||||
- [Signal RingRTC repository and license](https://github.com/signalapp/ringrtc)
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# Threat model
|
||||
|
||||
**Review status:** M0 draft, prepared for project-owner review. This document does not approve a cryptographic library or claim that the scaffold provides secure calls.
|
||||
|
||||
## Scope and trust boundary
|
||||
|
||||
- MVP protects one-to-one voice calls between registered Android devices. Group calls, video, PSTN and endpoint compromise are out of scope.
|
||||
- Each endpoint is trusted with its own microphone audio and the plaintext audio it receives from the other endpoint.
|
||||
- API, key directory, signaling, push and TURN services are untrusted with respect to call secrets and media plaintext. They may deny service or observe metadata.
|
||||
- WebRTC DTLS-SRTP protects transport legs. The call is not considered end-to-end encrypted unless the selected RFC 9605 SFrame transform also protects encoded audio between the two authenticated devices.
|
||||
- Network E2EE does not protect audio from a rooted/compromised device, a malicious OS, a user-approved recording path, or an authorized remote participant.
|
||||
|
||||
## Assets
|
||||
Device identity private keys, prekey private material, call session secrets, SFrame sender keys, microphone audio, account credentials and contact relationships.
|
||||
|
||||
@@ -16,16 +26,38 @@ Device identity private keys, prekey private material, call session secrets, SFr
|
||||
- Authentication of the remote device
|
||||
- Forward secrecy properties provided by the selected audited handshake/session protocol
|
||||
- Replay resistance and device revocation
|
||||
- Downgrade resistance: an endpoint cannot silently fall back to unprotected media or a weaker handshake profile
|
||||
- Call and direction separation: media keys from one call or direction cannot be reused in another
|
||||
|
||||
## Limitations
|
||||
The mobile operator can observe that the device communicates, timing, IP/network metadata and approximate traffic volume. Endpoint malware, a compromised OS, microphone permissions abuse and social engineering are outside the guarantee of network E2EE. Push providers may observe opaque notification delivery metadata.
|
||||
|
||||
SFrame leaves routing metadata visible, including timing and media traffic volume. It does not provide confidentiality for its header or prove the civil identity of the sender. The handshake and user verification flow authenticate the remote device; SFrame key management must bind each sending direction to that authenticated call session. In the two-party MVP both endpoints are trusted participants and can derive call-session material, so this design does not provide non-repudiation between them.
|
||||
|
||||
## Media security invariants
|
||||
|
||||
These are protocol requirements, not claims about the current scaffold:
|
||||
|
||||
1. A call is shown as secure only after both endpoints have authenticated the same call transcript, confirmed the negotiated protocol profile, installed the required receive key, and enabled encryption for the local audio sender. Failure at any step aborts secure setup.
|
||||
2. No plaintext fallback is permitted. If a required transform is absent, a key is missing, a frame fails authentication, or the negotiated profile is unsupported, drop the frame and fail or terminate the call. Never pass the frame through as plaintext.
|
||||
3. Derive separate media key material for each call, sending direction, sender device, key epoch and SFrame context using the selected protocol's reviewed key schedule. Do not use the raw handshake output directly as an SFrame key, reuse a sender key for both directions, or treat a shared symmetric key as proof of an individual sender's identity.
|
||||
4. Bind call ID, both device IDs, protocol/profile version, handshake transcript hash and direction into the authenticated call context. Reject mismatches and unknown profile versions. Signaling metadata alone is not an authenticated identity claim.
|
||||
5. A `(key, nonce/counter)` pair must never repeat. Counters do not reset while their key remains active. If counter continuity cannot be preserved across process death or recovery, install fresh media key material and a new key ID before sending again.
|
||||
6. Receivers maintain per-sender replay state and a bounded reordering window. Reject duplicate or stale frames while accepting valid reordered frames within that window. Malformed SFrame headers and authentication failures are rejected without changing live key state.
|
||||
7. Key rotation installs a receive key before the sender uses it, changes the key ID/epoch, and retires old material after the defined overlap window. Teardown erases call and media key state; device revocation prevents new handshakes for that device.
|
||||
8. ICE restart does not authorize key or counter reuse. Continue with preserved counters only when cryptographic state is intact; otherwise rekey before media resumes.
|
||||
|
||||
The exact SFrame cipher suite, KDF labels and lengths, SFrame header mode, replay-window size, rotation overlap, and secure-indicator UX remain open until the implementation candidates are selected and reviewed. RFC 9605 requires applications to define key management and anti-replay behavior; this project must not infer those rules from a frame-transform API.
|
||||
|
||||
## Required mitigations
|
||||
- QR/safety-number verification
|
||||
- Signed identity/prekey bundles
|
||||
- One-time prekey atomic consumption
|
||||
- Strict transcript binding and replay protection
|
||||
- Directional media keys and nonce uniqueness
|
||||
- Authenticated protocol/profile negotiation with downgrade rejection
|
||||
- Fail-closed encoded-audio encryption and decryption, with no plaintext pass-through
|
||||
- Per-sender SFrame key IDs, counter continuity, replay window and rotation rules
|
||||
- Short-lived authenticated TURN credentials
|
||||
- Minimal server logs and retention
|
||||
- Secure local storage and device revocation
|
||||
|
||||
Reference in New Issue
Block a user