Monthly research note. Theme: Post-Quantum Cryptography & Migration.
TL;DR
A focused memo on Crypto Agility Tooling: Feature Flags, Policy, and Rollback: define the model, state the properties, then design the system so those properties remain true under failure and adversaries.
Most failures are boundary failures: parsing, persistence, concurrency, retries, and upgrades.
Key takeaways
- Constant-time requirements don’t disappear; they become harder under bigger primitives.
- Interop is the migration plan—test matrices are more important than whitepapers.
- Migration is mixed-version for years: compatibility and rollback are security features.
- Treat retries, reordering, and partial failure as default conditions.
- Automate guardrails; humans are for judgment, not for consistent enforcement.
Why this matters
- Constant-time constraints are harder under large primitives.
- Hybrid designs fail if binding is ambiguous (mix-and-match, downgrade).
- PQC changes bandwidth and CPU costs; DoS surfaces move.
- Interop is the real risk: multiple stacks, vendors, and versions.
Key questions
- How do you rotate algorithms safely (crypto agility without chaos)?
- How do you handle failures: decryption failures, invalid ciphertexts, malformed keys?
- How do you bind hybrid secrets to prevent downgrade and mix-and-match attacks?
- What are the new DoS surfaces (bigger keys, more CPU, more bandwidth)?
- What telemetry proves PQC is working (not just enabled)?
- What does interoperability testing look like across vendors and stacks?
Assumptions
- Side channels exist: timing and cache behavior leak information.
- Vendors vary: implementations and defaults differ.
- Bandwidth is limited in some environments; larger handshakes matter.
- Deployments are mixed; old clients must interoperate or fail safely.
Non-goals
- Relying on silent fallback to weaker modes during interop failures.
- Ignoring DoS implications of large primitives.
Any unbounded work per request becomes a DoS primitive under adversaries.
Model & invariants
A KEM gives you shared secrets without discrete-log assumptions:
Binding is the whole game: make the transcript an input to the KDF.
Make costs explicit: measure CPU and bandwidth, then add protections.
If the system can enter an invalid state, it eventually will—usually during an incident.
Security properties
- Evidence: critical actions emit verifiable audit events.
- Downgrade resistance: negotiation can’t silently weaken security posture.
- Replay resistance: duplicated inputs do not change outcomes.
- Authenticity: actions are bound to identity and purpose.
Failure modes
- Timeout ambiguity causing double-apply or partial state transitions.
- Recovery paths that only work when nothing is broken.
- Resource exhaustion (CPU/bandwidth/storage) turning into correctness failures.
- Config drift that weakens security posture over time.
Mixed-version deployments create states you never tested—plan for them explicitly.
Design sketch
flowchart TD
negotiate["Negotiate Algorithms"] --> bind["Bind Transcript"]
bind --> kdf["KDF (hybrid)"]
kdf --> keys["Traffic Keys"]
keys --> monitor["Monitor + Rollback"]Implementation notes
Explicit binding prevents downgrade and mix-and-match. Don’t leave it implicit.
Make rollbacks boring: if rollback is a hero move, it will fail.
// Hybrid binding sketch (pseudocode):
// ss = HKDF(ss_classical || ss_pqc, info=transcript_hash)
// Then derive traffic keys from ss.Verification strategy
- Interop matrices across vendors/versions and failure modes.
- Side-channel tests where tooling exists; constant-time audits.
- Chaos deploys: mixed versions + rollback during partial outages.
- DoS tests: measure CPU/bandwidth amplification and mitigation impact.
- Downgrade tests: active attacker manipulates negotiation.
Operational notes
- Document supported algorithm sets and deprecation timelines.
- Cap handshake cost per peer/IP; use stateless cookies when needed.
- Inventory long-lived secrets and migrate the highest-risk first.
- Add telemetry for negotiation outcomes, failures, and client cohorts.
- Roll out with canaries and explicit rollback triggers.
Design playbooks as protocols: predictable steps, bounded risk, and clear ownership.
What to monitor
- Rollback events and the conditions that triggered them.
- Authz failures and policy denials (unexpected spikes).
- Invariant violation rate (should be ~0).
- Error budget burn + tail latency under load.
- Retry/timeout rates by endpoint and client cohort.
Rollback plan
- Use canaries and staged rollout; stop early when signals degrade.
- Prefer backward-compatible changes; avoid “flag day” upgrades.
- Preserve evidence (configs, artifacts, audit logs) to reconstruct what changed.
- Keep dual-write / dual-verify windows where appropriate.
- Define an explicit rollback trigger (metrics + thresholds).
Evidence
- Jepsen (1) — Fault injection and correctness testing for distributed systems.
- Evidence: Turn faults into test cases; prioritize partition and clock-skew scenarios that violate user-visible guarantees.
- RFC 5869: HKDF (2) — Useful when discussing hybrid binding and context separation.
- Evidence: HKDF is the workhorse for domain separation; bind purpose/context to avoid cross-protocol key reuse.
Open questions
- What is the worst-case handshake cost under attack?
- Which clients will fail first, and what is the safe fallback behavior?
- Where would a downgrade be visible today, and how would you detect it?
- How do you rotate algorithms without introducing configuration chaos?
Checklist
- Costs bounded (CPU/memory/bandwidth) under adversarial inputs.
- Failure modes enumerated with mitigations.
- Safety properties stated as invariants.
- Telemetry captures correctness signals.
- Assumptions listed and reviewed.
- Rollback plan rehearsed and automated.
Further reading
- CRYSTALS-Kyber — KEM design and parameters commonly referenced in deployments.
- CRYSTALS-Dilithium — Signature scheme design and deployment constraints.
- RFC 5869: HKDF — Useful when discussing hybrid binding and context separation.
- NIST Post-Quantum Cryptography Project — Standardization process and algorithm selections.
- Learn TLA+ — Practical entry point for specification and model checking.
- Jepsen — Fault injection and correctness testing for distributed systems.