Repository navigation
RFC: Post-Quantum Cryptography (PQC) for Lemonade-Nexus #3974
Slackyster
started this conversation in
Request for Comment (RFC)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Proposal size
Working group (a large scope increase spanning multiple release cycles)
Updates
Proposed — open for discussion.
User story
As a Lemonade Nexus user or administrator, I want the network to support standardized post-quantum cryptography so that identities, communications, distributed trust, and software updates can remain secure against future quantum-capable adversaries.
As an enterprise or government customer, I want Nexus to provide a clear path toward post-quantum security and support integration with appropriately validated cryptographic modules, so that the platform can meet applicable security and procurement requirements.
As a Nexus developer, I want cryptographic algorithms and backends to be replaceable through stable interfaces, so that future standards, implementation improvements, and compliance requirements can be adopted without redesigning the entire protocol.
This RFC proposes and acts as exploration of a very high complexity development steps for a phased migration of Lemonade-Nexus toward post-quantum cryptography (PQC), built around cryptographic agility and NIST-standardized algorithms.
The proposal introduces:
A cryptographic abstraction layer that enables future algorithm and backend changes.
NIST FIPS 203 ML-KEM for post-quantum key establishment.
NIST FIPS 204 ML-DSA for post-quantum digital signatures.
Hybrid classical/PQC operation during migration, with explicit downgrade prevention.
An investigation into a dedicated Lemonade Nexus fork of Cloudflare BoringTun to support post-quantum key establishment in the mesh transport.
PQC-capable identity, gossip, root-key rotation, recovery, TLS, and release verification.
An enterprise-oriented design that supports deployments requiring FIPS-validated cryptographic modules.
A staged path toward PQC enforcement and eventual retirement of classical-only operation.
The objective is not merely to add new algorithms. It is to make cryptographic evolution a supported architectural capability of Nexus, reducing the likelihood that future security requirements will require another fundamental redesign.
A sufficiently capable quantum computer could eventually undermine classical public-key cryptography. An adversary could also collect encrypted traffic today and retain it for future decryption, creating a harvest-now, decrypt-later risk.
PQC migration should therefore be treated as a security, architecture, and enterprise-readiness initiative.
Goals
Make cryptographic agility a first-class architectural requirement.
Adopt NIST-standardized PQC algorithms.
Support a carefully reviewed hybrid transition before classical-only security is retired.
Address transport-layer key establishment, not just application-layer encryption.
Protect identity, enrollment, signed state, root-of-trust operations, and release verification.
Design for enterprise deployments that require FIPS-validated cryptographic modules.
Prevent silent downgrade to classical-only security when stronger policies are required.
Preserve interoperability during staged deployment and upgrades.
Establish measurable criteria for PQC enforcement and eventual deprecation of classical-only operation.
High-level design
Nexus should adopt an architecture that supports standardized PQC while distinguishing algorithm implementation, protocol security, and cryptographic-module compliance.
Relevant standards
NIST FIPS 203 — ML-KEM
Defines the Module-Lattice-Based Key-Encapsulation Mechanism, or ML-KEM, for establishing shared secrets over public channels.
ML-KEM is the proposed foundation for post-quantum key establishment in Nexus, including the investigation of a hybrid mesh-tunnel handshake.
NIST FIPS 204 — ML-DSA
Defines the Module-Lattice-Based Digital Signature Algorithm, or ML-DSA, for digital signatures.
ML-DSA is the proposed foundation for post-quantum identity authentication, signed gossip messages, root-key endorsements, release manifests, and other signature-dependent trust operations.
Implementing ML-KEM and ML-DSA does not, by itself, make Nexus FIPS 140-3 compliant.
Cryptographic agility
Cryptographic agility is a core requirement of this proposal.
Nexus must be able to introduce, negotiate, enforce, and retire cryptographic algorithms without requiring a redesign of the entire network architecture.
PQC is the immediate motivation, but the architecture should also accommodate future standards, security updates, backend changes, and evolving compliance requirements.
Design principles
Algorithm and protocol separation
Protocol logic must not be tightly coupled to one cryptographic implementation.
To make it more clear we will handle cryptography backends as we do for models and agents.
Nexus should define interfaces for the cryptographic operations required by the protocol and allow implementations to be supplied by appropriate backends.
Explicit cryptographic policy
The system should support distinct deployment policies:
Classical: existing supported classical cryptography, for compatibility where permitted.
Hybrid: a reviewed combination of classical and post-quantum mechanisms.
PQC-enforced: operation requires the defined post-quantum protections and fails closed if they cannot be established.
These are policy concepts, not permission to combine arbitrary algorithms. Every supported suite must have a documented protocol definition and security analysis.
Downgrade resistance
An attacker must not be able to force a connection into a weaker mode without detection.
Negotiation must be authenticated or bound to the authenticated handshake transcript. A peer's capabilities and the selected security policy must be verified before a session is accepted.
Observability
Nexus should expose the negotiated cryptographic suite, policy status, backend identity, and relevant capability information to administrators without exposing secret key material.
Lifecycle management
The design must support adding algorithms, marking suites deprecated, disabling vulnerable suites, rotating keys, and migrating stored cryptographic records.
Cryptographic abstraction layer
Introduce a dedicated interface for the operations required by Nexus.
Expected responsibilities include:
Key generation and serialization.
Key encapsulation and decapsulation.
Digital-signature generation and verification.
Hybrid key establishment and signature verification.
Key derivation and domain separation.
Cryptographically secure random-number generation.
Algorithm capability discovery.
Backend selection and cryptographic policy enforcement.
Input validation and consistent error handling.
Test-vector and known-answer-test integration.
The abstraction must not hide security-relevant differences between algorithms. Callers must be able to determine whether an operation uses classical, hybrid, or PQC-enforced policy.
The interface should avoid unnecessarily exposing backend-specific details to the protocol while preserving the ability to verify what security properties an operation actually provides.
Backend and compliance strategy
The architecture should support more than one implementation backend where practical.
For enterprise deployments requiring FIPS validation:
Identify an appropriate cryptographic module.
Confirm that required operations and algorithms are supported.
Verify the module's applicable validation status and approved configuration.
Document unsupported algorithms and deployment restrictions.
Ensure that the selected Nexus configuration uses the module in the manner covered by its validation.
If the required PQC operation is not available in the selected validated module, Nexus must document the limitation and apply the configured policy. It must not silently substitute a weaker or unapproved operation.
Key establishment Decision
ML-KEM-768: initial PQC target under NIST FIPS 203.
ML-KEM-1024: evaluate for deployments requiring a higher NIST security category.
X25519: retain during migration where a reviewed hybrid design uses it.
A hybrid X25519 and ML-KEM construction should be used only after its combiner, authentication, transcript binding, and downgrade behavior have been specified and reviewed.
Digital signatures
ML-DSA-65: initial PQC signature target under NIST FIPS 204.
ML-DSA-87: evaluate for deployments with higher security requirements.
Ed25519: retain during migration where classical compatibility or a reviewed hybrid signature policy requires it.
Hybrid cryptography
Nexus should support a staged migration from classical cryptography to PQC.
Hybrid mechanisms can preserve classical security properties during the transition while adding protection against quantum attacks, provided that the construction and protocol are correctly designed.
Hybrid key establishment
Evaluate a reviewed construction combining X25519 and ML-KEM.
Hybrid signatures
Evaluate a hybrid signature scheme combining Ed25519 and ML-DSA for selected trust-critical operations.
Where the policy requires hybrid assurance, verification should require both signatures to validate.
PQC-enabled mesh transport and BoringTun
Transport security is a central part of this proposal.
Nexus must address the security of the mesh tunnel's own key establishment rather than relying exclusively on PQC at the application or identity layer.
Evaluate a Lemonade-Nexus BoringTun fork
Investigate maintaining a dedicated fork of Cloudflare BoringTun, the Rust userspace implementation of WireGuard.
Repository: https://github.com/cloudflare/boringtun
Breaking changes
Potential breaking changes include:
Larger public keys, signatures, and handshake messages.
New identity and signed-message formats.
Changes to peer capability negotiation.
A separate PQC-enabled transport protocol mode.
Changes to persistent trust records and root-key rotation.
Additional cryptographic dependencies and backend configuration.
Different compatibility requirements for older clients and relays.
Increased CPU, memory, storage, and network requirements.
Ongoing maintenance responsibilities if a BoringTun fork is adopted.
Maintenance plan
CI should automate repeatable correctness, compatibility, regression, security, and performance checks wherever practical. Human maintainers remain responsible for reviewing cryptographic design changes, evaluating upstream updates, validating deployment behavior, and deciding when a new algorithm or protocol version should be supported.
Hybrid protocol tests: Verify successful handshakes, matching derived secrets, authenticated negotiation, and correct hybrid policy enforcement.
Interoperability tests: Establish connections between supported client, server, and relay versions, including mixed-version deployments where permitted.
Performance tests: Measure handshake latency, CPU and memory use, message sizes, and rekeying overhead. Use baselines and regression thresholds where measurements are stable enough to be meaningful.
CI should cover at least the following environments :
Classical compatibility mode.
Hybrid X25519 plus ML-KEM mode.
PQC-enforced mode.
Supported cryptographic backends.
Client-to-server and client-to-relay connections.
Mixed-version peers and rolling upgrades.
Key rotation, rekeying, and recovery.
Failure and downgrade scenarios.
My recommendation is to make the hybrid-handshake tests and downgrade-prevention tests required CI checks.
Risks
PQC keys and signatures can be substantially larger than classical equivalents.
Until full PQC is enforced Mixed deployments may create pressure to accept classical-only connections.
Using NIST-standardized algorithms does not establish FIPS 140-3 validation.
References
NIST FIPS 203 — ML-KEM: https://csrc.nist.gov/pubs/fips/203/final
NIST FIPS 204 — ML-DSA: https://csrc.nist.gov/pubs/fips/204/final
All reactions