Project: Fastcomcorp libzina (Post-Quantum Secure Messaging) Status: Formal Model for Reviewers Last Updated: February 24, 2026
This document outlines the security architecture and threat model for ZINA. It defines the trust boundaries, high-value assets, and the capabilities of various adversaries. It provides reviewers with a structured view of how ZINA defends against both classical and future quantum-computing threats.
| Asset | Category | Description |
|---|---|---|
| Message Content | Confidentiality | The plaintext of user communications. |
| User Identity | Privacy | Long-term identity keys (X448, Falcon-512) and social graph. |
| Forward Secrecy | Integrity | Protection of past messages if current keys are compromised. |
| Post-Compromise Security | Resilience | The ability of the protocol to recover security after key theft. |
| Metadata Protection | Privacy | Routing information, device IDs, and message timestamps. |
| Attachment Integrity | Integrity | Assurance that files haven't been tampered with in storage. |
We evaluate ZINA against four distinct adversary classes:
- Capability: Eavesdrops on all network traffic between peers and relays.
- Goal: Decrypt content or mapping social graphs through traffic analysis.
- ZINA Defense: PQ-Handshake and Hybrid Double Ratchet ensure all traffic is encrypted with AEAD.
- Capability: Can drop, modify, inject, or replay messages. Can attempt protocol downgrades.
- Goal: Impersonate peers or force sessions into weaker (v1/v2) crypto states.
- ZINA Defense: Ed448/Falcon-signed ratchets and Sticky Versioning prevent unauthorized downgrades or key injections.
- Capability: Controls the transport or persistent storage servers (CDNs/Relays).
- Goal: Link sender/receiver IDs or access attachments.
- ZINA Defense: Header Obfuscation conceals the social graph from relays. Out-of-band file encryption ensures relays only hold encrypted blobs.
- Capability: Records current traffic to decrypt it once cryptographically relevant quantum computers (CRQC) exist.
- Goal: Retrospective decryption of classical DH exchanges.
- ZINA Defense: ML-KEM-768 integration in every handshake and sparse ratchet ensures that recorded traffic remains secure against future Shor-algorithm attacks.
graph TD
subgraph "Local Trust Zone (Peer A)"
UA[User Application]
ZEA[Zina Engine]
DBA[(SQLite Store)]
end
subgraph "Untrusted Zone (Network)"
RL[Message Relay]
CDN[File Storage]
end
subgraph "Local Trust Zone (Peer B)"
UB[User Application]
ZEB[Zina Engine]
DBB[(SQLite Store)]
end
UA -- plaintext --> ZEA
ZEA -- encrypted envelope --> RL
RL -- encrypted envelope --> ZEB
ZEB -- plaintext --> UB
ZEA -- "encrypted blobs (v3)" --> CDN
ZEB -- "download/decrypt" --> CDN
ZEA -.-> DBA
ZEB -.-> DBB
| Threat Type | Potential Vector | ZINA Mitigation Strategy |
|---|---|---|
| Spoofing | Forged ratchet keys | Authenticated Ratchet: Every ratchet key is signed with Ed448/Falcon (FIPS 204). |
| Tampering | Modified ciphertext | AEAD (AES-256-GCM): All payloads and metadata use authenticated encryption with AAD binding. |
| Repudiation | Identity misuse | Hybrid Handshake: Identity keys are bound to the session via DH5 and PQ-KEM shared secrets. |
| Info Disclosure | Social graph leak | Header Obfuscation: Routing metadata is encrypted under a session-derived protection key. |
| DoS | Fuzzing/Malformed proto | Protocol Hardening: Strict Protobuf parsing and dedicated fuzzing suite for core logic. |
| Elevation | Protocol Downgrade | Sticky Versioning: Established v3 sessions explicitly block demotion to v1/v2 legacy modes. |
- Traffic Analysis: While headers are obfuscated, message timing and volume patterns (e.g., typing indicators) may still leak metadata to sophisticated observers.
- Endpoint Compromise: If the host device (OS) is compromised at the root level, SQLite stores and memory can be dumped, bypassing cryptographic protections.
- Manual Verification: SAS (Short Authentication Strings) or manual fingerprint verification is required to establish the initial "Root of Trust" against a MITM during the very first exchange.