> For the complete documentation index, see [llms.txt](https://cryptic-documentation.gitbook.io/cryptic-pq/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptic-documentation.gitbook.io/cryptic-pq/crytic-enterprise-whitepaper/4.-security-model.md).

# 4. Security Model

#### 4.1 Trust & Threats

**Trust Assumptions:**

* Intel/AMD TEE hardware is trustworthy
* TLS certificates are valid
* Client devices can verify attestation
* Platform operator (Secret Network) is non-malicious

**Threat Actors:**

1. **External Attacker**: Attempts to compromise service from internet
2. **Malicious Operator**: Service operator attempts to extract keys
3. **Physical Access**: Attacker with physical access to hardware
4. **Quantum Computer**: Future adversary with CRQC
5. **Insider Threat**: Compromised employee or contractor

#### 4.2 Security Guarantees

{% @mermaid/diagram content="graph TB
subgraph Layer1\["🌐 Layer 1: Network Security"]
TLS\[TLS 1.3 Encryption]
Firewall\[Firewall Rules]
DDoS\[DDoS Protection]
end

```
subgraph Layer2["🔐 Layer 2: Authentication"]
    JWT[JWT Validation]
    ChainSig[Chain Signatures]
    RateLimit[Rate Limiting]
end

subgraph Layer3["🏰 Layer 3: TEE Isolation"]
    TDX[Intel TDX<br/>Memory Encryption]
    Attestation[Remote Attestation]
    NoDebug[Debug Disabled]
end

subgraph Layer4["🔒 Layer 4: Key Management"]
    SessionMode[Session Keys<br/>No Persistence]
    Encryption[AES-256-GCM<br/>Key Wrapping]
    Zeroing[Memory Zeroing]
end

subgraph Layer5["🛡️ Layer 5: Post-Quantum"]
    Dilithium[Dilithium3 Signatures<br/>Quantum-Resistant]
    Kyber[Kyber768 KEM<br/>Quantum-Resistant]
end

subgraph Layer6["💾 Layer 6: Storage"]
    EncVolume[Encrypted Volume<br/>SecretVM]
    OnChainKMS[On-Chain KMS]
end

Layer1 --> Layer2
Layer2 --> Layer3
Layer3 --> Layer4
Layer4 --> Layer5
Layer5 --> Layer6

style Layer1 fill:#e3f2fd,stroke:#1976d2
style Layer2 fill:#f3e5f5,stroke:#7b1fa2
style Layer3 fill:#fff3e0,stroke:#f57c00
style Layer4 fill:#e8f5e9,stroke:#2e7d32
style Layer5 fill:#fce4ec,stroke:#c2185b
style Layer6 fill:#f1f8e9,stroke:#558b2f" %}
```

**Attack Vector Mitigations:**

| Attack Vector         | Mitigation                         | Verification       |
| --------------------- | ---------------------------------- | ------------------ |
| **Memory inspection** | Intel TDX memory encryption        | TEE attestation    |
| **Code tampering**    | Measured boot, reproducible builds | Attestation report |
| **Key exfiltration**  | TEE isolation, no debug interfaces | Remote attestation |
| **Replay attacks**    | Timestamp validation, nonces       | JWT exp claim      |
| **Rate limit bypass** | Sliding window per-user limits     | Enforced in TEE    |
| **Quantum attacks**   | Post-quantum algorithms            | NIST-standardized  |
| **Operator access**   | Session mode (no persistence)      | Auditable          |
| **Side-channels**     | Constant-time crypto, blinding     | Reference impl.    |

#### 4.3 Attestation

**Remote Attestation Workflow:**

```
1. Client requests service info
2. Service provides attestation endpoint
3. Client fetches TEE quote from :29343/cpu
4. Client verifies:
   - Intel/AMD signature on quote
   - Measurement matches published hash
   - TEE firmware is up-to-date
5. If valid, client trusts service
```

**Attestation Report Contains:**

* **MRENCLAVE**: Hash of code + data loaded in TEE
* **MRSIGNER**: Public key of code signer
* **ISV\_PROD\_ID**: Product identifier
* **ISV\_SVN**: Security version number
* **Report Data**: Custom data (e.g., service public key)

**Reproducible Builds**: Clients can rebuild Docker image and verify hash matches attestation.

#### 4.4 Compliance

**Current:**

* ✅ NIST PQC standards (FIPS 203, 204)
* ✅ TEE-based isolation (comparable to FIPS 140-2 Level 2)
* ✅ Audit logging
* ✅ SOC 2 Type II path (Secret Network platform)

**Phase 2 (CloudHSM):**

* ✅ FIPS 140-2 Level 3 certification
* ✅ PCI-DSS compliance
* ✅ HIPAA technical safeguards
* ✅ FedRAMP eligible
