- Home
- RFC 10042
RFC 10042: Post-Quantum/Traditional Hybrid Key Exchange with the Module-Lattice-Based Key-Encapsulation Mechanism for Use in SSH
- P. Kampanakis,
- D. Stebila,
- T. Hansen
Abstract
This document defines Post-Quantum Traditional (PQ/T) Hybrid key exchange methods based on the quantum
Status of This Memo
This document is not an Internet Standards Track specification; it is published for informational purposes.¶
This document is a product of the Internet Engineering Task Force (IETF). It has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are candidates for any level of Internet Standard; see Section 2 of RFC 7841.¶
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
https://
Copyright Notice
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(https://
1. Introduction
Secure Shell (SSH) [RFC4251] performs key establishment using key exchange methods based on Elliptic Curve Diffie-Hellman (ECDH) style schemes defined in [RFC5656] and [RFC8731]. The cryptographic security of these key exchanges relies on certain instances of the discrete logarithm problem being computationally infeasible to solve for adversaries.¶
However, if sufficiently large quantum computers become available, these instances would no longer be computationally infeasible, rendering the current key exchange and authentication methods in SSH insecure. While large quantum computers are not available today, an adversary could record the encrypted communication sent between the client and server in an SSH session and later decrypt it when sufficiently large quantum computers become available. This kind of attack is known as a 'harvest now, decrypt later' attack [RFC9958].¶
This document addresses the problem by extending the SSH transport layer protocol key exchange (Section 7 of [RFC4253]) with Post-Quantum Traditional (PQ/T) Hybrid key exchange methods [RFC9794]. It follows the migration considerations laid out in Section 4.3 of [OAM-CONS]. The security provided by each key exchange scheme in a PQ/T Hybrid key exchange method is independent. This means that the PQ/T Hybrid key exchange method will always be at least as secure as the most secure key exchange scheme executed as part of the exchange. [PQ-PROOF] and [PQ-PROOF2] contain proofs of security for such PQ/T Hybrid key exchange schemes.¶
In the context of the [NIST_
- 'KeyGen() -> (pk, sk)':
- A probabilistic key generation algorithm, which generates a public key 'pk' and a secret key 'sk'.¶
- 'Encaps(pk) -> (ct, ss)':
- A probabilistic encapsulation algorithm, which takes as input a public key 'pk' and outputs a ciphertext 'ct' and shared secret 'ss'.¶
- 'Decaps(sk, ct) -> ss':
- A decapsulation algorithm, which takes as input a secret key 'sk' and ciphertext 'ct' and outputs a shared secret 'ss', or in some cases, a distinguished error value.¶
The main security property for KEMs is indistinguishab
The post-quantum KEM used in this document is the Module
1.1. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
2. PQ/T Hybrid Key Exchange
2.1. PQ/T Hybrid Key Exchange Method Abstraction
This section defines the abstract structure of a PQ/T Hybrid key exchange method. This structure must be instantiated with two key exchange schemes. The byte and string types are to be interpreted in this document as described in [RFC4251].¶
In a PQ/T Hybrid key exchange, instead of SSH_
byte SSH_MSG_KEX_HYBRID_INIT
string C_INITwhere C_
Instead of SSH_
byte SSH_MSG_KEX_HYBRID_REPLY
string K_S, server's public host key
string S_REPLY
string the signature on the exchange hashwhere S_
C_
For all method names, both the client and server MUST process the ECDH and X25519 public keys
2.2. PQ/T Hybrid Key Exchange Message Numbers
The message numbers 30-49 are key exchange method specific as specified in [RFC4250]. These numbers may be redefined by any key exchange method [RFC4253] without requiring an IANA registration process. This document defines the following key exchange message numbers:¶
#define SSH_MSG_KEX_HYBRID_INIT 30
#define SSH_MSG_KEX_HYBRID_REPLY 312.3. PQ/T Hybrid Key Exchange Method Names
The PQ/T Hybrid key exchange method names defined in this document (to be used in SSH_
These instantiate the abstract PQ/T Hybrid key exchanges defined in Section 2.1.¶
2.3.1. mlkem768nistp256-sha256
mlkem768nistp256
The post-quantum C_
The HASH function used in the key exchange [RFC4253] is SHA-256 [NIST-SHA2] [RFC6234].¶
2.3.2. mlkem1024nistp384-sha384
mlkem1024nistp38
The post-quantum C_
The HASH function used in the key exchange [RFC4253] is SHA-384 [NIST-SHA2] [RFC6234].¶
2.3.3. mlkem768x25519-sha256
mlkem768x25519
The post-quantum C_
The HASH function used in the key exchange [RFC4253] is SHA-256 [NIST-SHA2] [RFC6234].¶
2.5. Key Derivation
The derivation of encryption keys MUST be done from the shared secret K according to Section 7.2 of [RFC4253] with a modification on the exchange hash H.¶
The PQ/T Hybrid key exchange hash H is the result of computing the HASH, where HASH is the hash algorithm specified in the named PQ/T Hybrid key exchange method name, over the concatenation of the following:¶
string V_C, client identification string (CR and LF excluded)
string V_S, server identification string (CR and LF excluded)
string I_C, payload of the client's SSH_MSG_KEXINIT
string I_S, payload of the server's SSH_MSG_KEXINIT
string K_S, server's public host key
string C_INIT, client message octet string
string S_REPLY, server message octet string
string K, SSH shared secretK, the shared secret used in H, was traditionally encoded as an integer (mpint) as per [RFC4253], [RFC5656], and [RFC8731]. In this specification, K is the hash output of the two concatenated byte arrays (Section 2.4), which is not an integer. Thus, K is encoded as a string using the process described in Section 5 of [RFC4251] and is then fed along with other data in H to the key exchange method's HASH function to generate encryption keys.¶
3. Message Size
An SSH implementation adhering to [RFC4253] must be able to support packets with an uncompressed payload length of 32768 bytes or less and a total packet size of 35000 bytes or less (including 'packet_
4. IANA Considerations
IANA has registered the following method names in the "Key Exchange Method Names" registry within the "Secure Shell (SSH) Protocol Parameters" registry group [IANA-SSH].¶
| Method Name | Reference | OK to Implement |
|---|---|---|
| mlkem768nistp256 |
RFC 10042 | SHOULD |
| mlkem1024nistp38 |
RFC 10042 | SHOULD |
| mlkem768x25519 |
RFC 10042 | SHOULD |
5. Security Considerations
The security considerations given in [RFC5656] and [RFC8731] also apply to the ECDH part of the P/T Hybrid key exchange schemes defined in this document.¶
As it is commonly done with (EC)DH keys today, generating an ephemeral key exchange keypair for ECDH and ML-KEM per connection is REQUIRED by this specification. Additionally, implementations MUST NOT reuse randomness in the generation of ML-KEM ciphertexts. As a reminder, the security properties of the protocol in this document, SSH itself, and the cryptographic algorithms used, including ML-KEM, depend on the availability and proper use of cryptographical
Implementations MUST use the encodings for K_
[PQ-PROOF] and [PQ-PROOF2] contain proofs of security for PQ/T Hybrid key exchange schemes. [PQ-PROOF2] discusses how the key combination to derive K and the derivation of SSH symmetric keys in this document can be proven to be IND-CPA and IND-CCA2 secure with some assumptions. IND-CPA is achieved if we assume the HASH calls perform as a KDF, which is a reasonable assumption. IND-CCA2 security is achieved by assuming the HASH is a random oracle, which is a stronger assumption especially for variants of the SHA-2 family, which introduce length extension risks. To leverage a HASH that is more suitable as a random oracle, we could use SHAKE256 or introduce HMAC-SHA-256 as proposed in options (2b) and (2c) in Appendix A. This document uses SHA-2, which is ubiquitous, although it makes an IND-CCA2 proof need stronger assumptions because even SSH's traditional key derivation has not been proven to be IND-CCA2.¶
X25519, the traditional elliptic curve key exchange used in one of the PQ/T hybrid methods specified in this document, is generally considered easier to implement securely without side channels than its NIST counterparts (with P256 and P384). Historically, implementations of P256 and P384 have suffered various implementation issues, which have been addressed over time. Optimized X25119 implementations are also more efficient than P256 and P384. Thus, X25519 has seen more adoption than P256 and P384 across cryptographic use cases. NIST curves are sometimes preferred for regulatory compliance.¶
6. References
6.1. Normative References
- [FIPS203]
-
NIST, "Module
-Lattice , NIST FIPS 203, DOI 10-Based Key -Encapsulation Mechanism Standard" .6028 , , <https:///NIST .FIPS .203 nvlpubs >..nist .gov /nistpubs /FIPS /NIST .FIPS .203 .pdf - [RFC2119]
-
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10
.17487 , , <https:///RFC2119 www >..rfc -editor .org /info /rfc2119 - [RFC4251]
-
Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Protocol Architecture", RFC 4251, DOI 10
.17487 , , <https:///RFC4251 www >..rfc -editor .org /info /rfc4251 - [RFC4253]
-
Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Transport Layer Protocol", RFC 4253, DOI 10
.17487 , , <https:///RFC4253 www >..rfc -editor .org /info /rfc4253 - [RFC5656]
-
Stebila, D. and J. Green, "Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer", RFC 5656, DOI 10
.17487 , , <https:///RFC5656 www >..rfc -editor .org /info /rfc5656 - [RFC6234]
-
Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10
.17487 , , <https:///RFC6234 www >..rfc -editor .org /info /rfc6234 - [RFC8174]
-
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10
.17487 , , <https:///RFC8174 www >..rfc -editor .org /info /rfc8174 - [RFC8731]
-
Adamantiadis, A., Josefsson, S., and M. Baushke, "Secure Shell (SSH) Key Exchange Method Using Curve25519 and Curve448", RFC 8731, DOI 10
.17487 , , <https:///RFC8731 www >..rfc -editor .org /info /rfc8731
6.2. Informative References
- [CHEMPAT]
-
Josefsson, S., "Chempat: Generic Instantiated PQ/T Hybrid Key Encapsulation Mechanisms", Work in Progress, Internet-Draft, draft
-josefsson , , <https://-chempat -05 datatracker >..ietf .org /doc /html /draft -josefsson -chempat -05 - [IANA-SSH]
-
IANA, "Secure Shell (SSH) Protocol Parameters", <https://
www >..iana .org /assignments /ssh -parameters - [LUCKY13]
-
Al Fardan, N.J. and K.G. Paterson, "Lucky Thirteen: Breaking the TLS and DTLS record protocols", 2013 IEEE Symposium on Security and Privacy, pp. 526-540, DOI 10
.1109 , , <https:///SP .2013 .42 ieeexplore >..ieee .org /iel7 /6547086 /6547088 /06547131 .pdf - [NIST-SHA2]
-
NIST, "Secure Hash Standard (SHS)", NIST FIPS 180-4, DOI 10
.6028 , , <https:///NIST .FIPS .180 -4 nvlpubs >..nist .gov /nistpubs /FIPS /NIST .FIPS .180 -4 .pdf - [NIST-SP800-186]
-
Chen, L., Moody, D., Randall, K., Regenscheid, A., and A. Robinson, "Recommendations for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters", National Institute of Standards and Technology, NIST SP 800-186, DOI 10
.6028 , , <https:///NIST .SP .800 -186 doi >..org /10 .6028 /NIST .SP .800 -186 - [NIST
-SP -800 -56C] -
Barker, E., Chen, L., and R. Davis, "Recommendation for Key-Derivation Methods in Key
-Establishment Schemes" , National Institute of Standards and Technology, NIST SP 800-56Cr2, DOI 10.6028 , , <https:///NIST .SP .800 -56Cr2 doi >..org /10 .6028 /NIST .SP .800 -56Cr2 - [NIST
-SP -800 -133r2] -
Barker, E., Roginsky, A., and R. Davis, "Recommendation for Cryptographic Key Generation", National Institute of Standards and Technology, NIST SP 800-133r2, DOI 10
.6028 , , <https:///NIST .SP .800 -133r2 doi >..org /10 .6028 /NIST .SP .800 -133r2 - [NIST
-SP -800 -135] -
Dang, Q., "Recommendation for Existing Application
-Specific Key Derivation Functions" , National Institute of Standards and Technology, NIST SP 800-135r1, DOI 10.6028 , , <https:///NIST .SP .800 -135r1 doi >..org /10 .6028 /NIST .SP .800 -135r1 - [NIST
-SP -800 -227] -
Alagic, G., Barker, E., Chen, L., Dustin, D., Robinson, A., Silberg, H., and N. Waller, "Recommendations for Key
-Encapsulation Mechanisms" , National Institute of Standards and Technology, NIST SP 800-227, DOI 10.6028 , , <https:///NIST .SP .800 -227 doi >..org /10 .6028 /NIST .SP .800 -227 - [NIST_
PQ] -
NIST, "Post-Quantum Cryptography (PQC)", , <https://
csrc >..nist .gov /projects /post -quantum -cryptography - [OAM-CONS]
-
Claise, B., Clarke, J., Farrel, A., Barguil, S., Pignataro, C., and R. Chen, "Guidelines for Considering Operations and Management in IETF Specifications", Work in Progress, Internet-Draft, draft
-ietf , , <https://-opsawg -rfc5706bis -06 datatracker >..ietf .org /doc /html /draft -ietf -opsawg -rfc5706bis -06 - [PQ-PROOF]
-
Campagna, M. and A. Petcher, "Security of Hybrid Key Encapsulation", Cryptology ePrint Archive, Paper 2020/1364, , <https://
eprint >..iacr .org /2020 /1364 - [PQ-PROOF2]
-
Petcher, A. and M. Campagna, "Security of Hybrid Key Establishment using Concatenation", Cryptology ePrint Archive, Paper 2023/972, , <https://
eprint >..iacr .org /2023 /972 - [RACCOON]
-
Merget, R., Brinkmann, M., Aviram, N., Somorovsky, J., Mittmann, J., and J. Schwenk, "Raccoon Attack: Finding and Exploiting Most
-Significant , , <https://-Bit -Oracles in TLS-DH(E)" raccoon >.-attack .com / - [RFC4250]
-
Lehtinen, S. and C. Lonvick, Ed., "The Secure Shell (SSH) Protocol Assigned Numbers", RFC 4250, DOI 10
.17487 , , <https:///RFC4250 www >..rfc -editor .org /info /rfc4250 - [RFC7748]
-
Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves for Security", RFC 7748, DOI 10
.17487 , , <https:///RFC7748 www >..rfc -editor .org /info /rfc7748 - [RFC9794]
-
Driscoll, F., Parsons, M., and B. Hale, "Terminology for Post-Quantum Traditional Hybrid Schemes", RFC 9794, DOI 10
.17487 , , <https:///RFC9794 www >..rfc -editor .org /info /rfc9794 - [RFC9941]
-
Friedl, M., Mojzis, J., and S. Josefsson, "Secure Shell (SSH) Key Exchange Method Using Hybrid Streamlined NTRU Prime sntrup761 and X25519 with SHA-512: sntrup761x25519
-sha512" , RFC 9941, DOI 10.17487 , , <https:///RFC9941 www >..rfc -editor .org /info /rfc9941 - [RFC9954]
-
Stebila, D., Fluhrer, S., and S. Gueron, "Hybrid Key Exchange in TLS 1.3", RFC 9954, DOI 10
.17487 , , <https:///RFC9954 www >..rfc -editor .org /info /rfc9954 - [RFC9958]
-
Banerjee, A., Reddy.K, T., Schoinianakis, D., Hollebeek, T., and M. Ounsworth, "Post-Quantum Cryptography for Engineers", RFC 9958, DOI 10
.17487 , , <https:///RFC9958 www >..rfc -editor .org /info /rfc9958 - [XWING-KEM]
-
Connolly, D., Schwabe, P., and B. Westerbaan, "X-Wing: general-purpose hybrid post-quantum KEM", Work in Progress, Internet-Draft, draft
-connolly , , <https://-cfrg -xwing -kem -10 datatracker >..ietf .org /doc /html /draft -connolly -cfrg -xwing -kem -10
Appendix A. Other Combiners
Other combiners to derive K and the SSH keys were considered while working on this document. These include:¶
- (1)
- K = K_
PQ || K_ CL . All SSH keys are derived from K as defined in Section 7.2 of [RFC4253].¶ - (2)
-
All SSH keys are derived from K as defined in Section 7.2 of [RFC4253].¶
- (3)
- K = HKDF
-HASH_ Extract (0, K_ PQ || K_ CL ). SSH keys are now derived from K using HKDF-HASH(K, H || session_ id, 6*sizeof (HASH )).¶
Option (3) follows the Extract
We also considered combiners like the ones proposed in [CHEMPAT] and [XWING-KEM]. [XWING-KEM] has a separate IND-CCA2 security proof. Although such combiners may be proven IND-CCA2 secure, to be IND-CCA2, the SSH key derivation would still require the assumptions laid out in [PQ-PROOF2] and discussed in Section 5.¶
Appendix B. FIPS
[NIST-SP-800-56C] and [NIST-SP-800-135] give NIST recommendations for key derivation methods in key exchange protocols. Some PQ/T Hybrid combinations may combine the shared secret from a NIST-approved algorithm (e.g., ECDH using the nistp256
Acknowledgements
The authors want to thank Gerardo Ravago from AWS for implementing this document and finding issues. We also want to thank Damien Miller and Markus Friedl for their feedback and for implementing some of the SSH key exchange methods in this document in OpenSSH. Special acknowledgement