<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc [
 <!ENTITY nbsp    "&#160;">
 <!ENTITY zwsp   "&#8203;">
 <!ENTITY nbhy   "&#8209;">
 <!ENTITY wj     "&#8288;">
]> 

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="info" docName="draft-ietf-sshm-mlkem-hybrid-kex-10" number="10042" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">

 <front>
   <title abbrev="PQ SSH">Post-Quantum/Traditional Hybrid Key Exchange with 
   the Module-Lattice-Based Key-Encapsulation Mechanism for Use in SSH</title>
    <seriesInfo name="RFC" value="10042"/>
   <author fullname="Panos Kampanakis" initials="P." surname="Kampanakis">
     <organization>AWS</organization>
     <address>
        <email>kpanos@amazon.com</email>
     </address>
    </author>
   <author fullname="Douglas Stebila" initials="D." surname="Stebila">
     <organization>University of Waterloo</organization>
     <address>
        <email>dstebila@uwaterloo.ca</email>
     </address>
    </author>
   <author fullname="Torben Hansen" initials="T." surname="Hansen">
     <organization>AWS</organization>
     <address>
        <email>htorben@amazon.com</email>
     </address>
    </author>
    <date year="2026" month="August"/>

   <area>SEC</area>
    <workgroup>sshm</workgroup>

   <keyword>post-quantum SSH</keyword>
   
   <abstract>
      <t>This document defines Post-Quantum Traditional (PQ/T) Hybrid key exchange methods based on the quantum-resistant Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) 
standard and traditional Elliptic-Curve Diffie-Hellman (ECDH) key exchange schemes. These methods are defined for use in the Secure Shell (SSH) transport layer protocol.</t>
    </abstract>
  </front>
  <middle>
  
    <section numbered="true" toc="default">
   
      <name>Introduction</name>
		
      <t>Secure Shell (SSH) <xref target="RFC4251"/> performs key establishment using key exchange methods based on Elliptic Curve Diffie-Hellman (ECDH) style schemes defined in <xref target="RFC5656"/> and <xref target="RFC8731"/>. 
        The cryptographic security of these key exchanges relies on certain instances of the discrete logarithm problem being computationally infeasible to solve for adversaries. </t>
	  <t>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 <xref target="RFC9958"/>.</t>
	  
	  <t>This document addresses the problem by extending the SSH transport layer protocol key exchange (<xref section="7" target="RFC4253"/>) with Post-Quantum Traditional (PQ/T) Hybrid key exchange methods <xref target="RFC9794"/>. It follows the migration considerations laid out in <xref section="4.3" target="I-D.ietf-opsawg-rfc5706bis"/>. 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. <xref target="PQ-PROOF"/> and <xref target="PQ-PROOF2"/> contain proofs of security for such PQ/T Hybrid key exchange schemes.</t>
	  
      <t>In the context of the <xref target="NIST_PQ"/>, key exchange algorithms are formulated as Key-Encapsulation Mechanisms (KEMs), which consist of three algorithms:</t>
      <dl newline="true" spacing="normal">
        <dt>'KeyGen() -> (pk, sk)':</dt>
	<dd>A probabilistic key generation algorithm, which generates a public key 'pk' and a secret key 'sk'.</dd>
        <dt>'Encaps(pk) -> (ct, ss)':</dt>
	<dd>A probabilistic encapsulation algorithm, which takes as input a public key 'pk' and outputs a ciphertext 'ct' and shared secret 'ss'.</dd>
        <dt>'Decaps(sk, ct) -> ss':</dt>
	<dd>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.</dd>
      </dl>
	  	 
      <t>The main security property for KEMs is indistinguishability under adaptive chosen ciphertext attacks (IND-CCA2), which means that shared secret values should be indistinguishable from random strings even given the ability to have arbitrary ciphertexts decapsulated.  IND-CCA2 corresponds to security against an active attacker, and the public key / secret key pair can be treated as a long-term key or reused.  A weaker security notion is indistinguishability under chosen plaintext attack (IND-CPA), which means that the shared secret values should be indistinguishable from random strings given a copy of the public key. IND-CPA roughly corresponds to security against a passive attacker, and sometimes corresponds to one-time key exchange.</t>
	  
	  	 
	  <t>The post-quantum KEM used in this document is the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM). ML-KEM was standardized in 2024 <xref target="FIPS203"/> with three parameter variants, ML-KEM-512, ML-KEM-768, and ML-KEM-1024. This specification's PQ/T Hybrid key exchange message abstraction, key derivation, and input to the SSH hash calculation, H, align with the ones defined in <xref target="RFC9941"/>, which uses a different quantum-resistant KEM.</t> 
	  
      <section numbered="true" toc="default">
        <name>Requirements Language</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>

      </section>
    </section>
	
    <section anchor="kex" numbered="true" toc="default">
	<name>PQ/T Hybrid Key Exchange</name>
	
    	<section anchor="kex-abstr" numbered="true" toc="default">
    	<name>PQ/T Hybrid Key Exchange Method Abstraction</name>
    	<t>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 <xref target="RFC4251"/>.</t>

        <t>In a PQ/T Hybrid key exchange, instead of SSH_MSG_KEXDH_INIT <xref target="RFC4253"/> or SSH_MSG_KEX_ECDH_INIT <xref target="RFC5656"/>, the client sends:</t>

<sourcecode type=""><![CDATA[
       byte     SSH_MSG_KEX_HYBRID_INIT
       string   C_INIT]]></sourcecode>

        <t>where C_INIT is the concatenation of C_PK2 and C_PK1 (C_INIT = C_PK2 || C_PK1, where || depicts concatenation). C_PK1 and C_PK2 represent the ephemeral client public keys used for each key exchange of the PQ/T Hybrid mechanism. Typically, C_PK1 represents a traditional / classical (i.e., ECDH) key exchange public key. C_PK2 represents the 'pk' output of the corresponding post-quantum KEM's 'KeyGen' at the client. </t>
		
        <t>Instead of SSH_MSG_KEXDH_REPLY <xref target="RFC4253"/> or SSH_MSG_KEX_ECDH_REPLY <xref target="RFC5656"/>, the server sends:</t>
<sourcecode type=""><![CDATA[
       byte     SSH_MSG_KEX_HYBRID_REPLY
       string   K_S, server's public host key
       string   S_REPLY
       string   the signature on the exchange hash]]></sourcecode>

        <t>where S_REPLY is the concatenation of S_CT2 and S_PK1 (S_REPLY = S_CT2 || S_PK1). Typically, S_PK1 represents the ephemeral (EC)DH server public key. S_CT2 represents the ciphertext 'ct' output of the corresponding KEM's 'Encaps' algorithm generated by the server, which encapsulates a secret to the client's public key C_PK2. Before producing S_CT2, to prevent length extension attack attempts, the server <bcp14>MUST</bcp14> check that the length of the C_INIT is the sum of the expected length of each public key in the negotiated method, C_PK1 and C_PK2. It also <bcp14>MUST</bcp14> perform the encapsulation key checks defined in Section 7.2 of <xref target="FIPS203"/>. If any of these checks fail, the client <bcp14>MUST</bcp14> abort using a disconnect message (SSH_MSG_DISCONNECT) with a SSH_DISCONNECT_KEY_EXCHANGE_FAILED as the reason.</t>
        
        <t>C_PK1, S_PK1, C_PK2, and S_CT2 are used to establish two shared secrets, K_CL and K_PQ. K_CL is the output from the classical ECDH exchange using C_PK1 and S_PK1. K_PQ is the post-quantum shared secret decapsulated from S_CT2. Before decapsulating, to prevent length extension attack attempts, the client <bcp14>MUST</bcp14> check that the length of the S_REPLY is the sum of the expected length of the traditional public key, S_PK1, and the ML-KEM ciphertext, S_CT2, in the negotiated method. The client <bcp14>MUST</bcp14> abort using a disconnect message (SSH_MSG_DISCONNECT) with a SSH_DISCONNECT_KEY_EXCHANGE_FAILED as the reason if the check fails or decapsulation fails for any other reason. K_CL and K_PQ are used together to generate the shared secret K according to <xref target="shared-secret"/>. </t>
	<t>For all method names, both the client and server <bcp14>MUST</bcp14> process the ECDH and X25519 public keys (C_PK1 and S_PK1) as described in <xref section="4" target="RFC5656"/> and <xref section="3" target="RFC8731"/>, respectively, including validity and length checks and SSH disconnect messages if the checks fail.</t>
		
    	</section>

       <section anchor="message-numbers" numbered="true" toc="default">
    	<name>PQ/T Hybrid Key Exchange Message Numbers</name>
         <t>The message numbers 30-49 are key exchange method specific as specified in <xref target="RFC4250"/>. These numbers may be redefined by any key exchange method <xref target="RFC4253"/> without requiring an IANA registration process. This document defines the following key exchange message numbers:</t>
<sourcecode type=""><![CDATA[
      #define SSH_MSG_KEX_HYBRID_INIT               30
      #define SSH_MSG_KEX_HYBRID_REPLY              31]]></sourcecode>

    	</section>

    	<section anchor="kex-methods" numbered="true" toc="default">
    	<name>PQ/T Hybrid Key Exchange Method Names</name>

		<t>The PQ/T Hybrid key exchange method names defined in this document (to be used in SSH_MSG_KEXINIT <xref target="RFC4253"/>) are:</t>
<ul>
<li>mlkem768nistp256-sha256</li>
<li>mlkem1024nistp384-sha384</li>
<li>mlkem768x25519-sha256</li>
</ul>

		<t>These instantiate the abstract PQ/T Hybrid key exchanges defined in <xref target="kex-abstr"/>.</t>

    	  <section numbered="true" toc="default">
    	  <name>mlkem768nistp256-sha256</name>
		  <t>mlkem768nistp256-sha256 defines that the traditional client and server public keys C_PK1 and S_PK1 belong to the NIST P-256 curve <xref target="NIST-SP800-186"/>. The private and public keys are generated as described therein. The public keys are defined as octet strings for NIST P-256 as per <xref target="RFC5656"/>; point compression may be used. The K_CL shared secret is generated from the exchanged C_PK1 and S_PK1 public keys as defined in <xref target="RFC5656"/> (key agreement method ecdh-sha2-nistp256).</t>
    	  
		  <t>The post-quantum C_PK2 and S_CT2 represent ML-KEM-768 public key and ciphertext from the client and server, respectively, which are encoded as octet strings. The K_PQ shared secret is decapsulated from the ciphertext S_CT2 using the client post-quantum KEM private key as defined in <xref target="FIPS203"/>. </t>

		  <t>The HASH function used in the key exchange <xref target="RFC4253"/> is SHA-256 <xref target="NIST-SHA2"/> <xref target="RFC6234"/>.</t>

    	  </section>

    	  <section numbered="true" toc="default">
    	  <name>mlkem1024nistp384-sha384</name>
		  <t>mlkem1024nistp384-sha384 defines that the traditional client and server public keys C_PK1 and S_PK1 belong to the NIST P-384 curve <xref target="NIST-SP800-186"/>. The private and public keys are generated as described therein. The public keys are defined as octet strings for NIST P-384 as per <xref target="RFC5656"/>; point compression may be used. The K_CL shared secret is generated from the exchanged C_PK1 and S_PK1 public keys as defined in <xref target="RFC5656"/> (key agreement method ecdh-sha2-nistp384).</t>
    	  
		  <t>The post-quantum C_PK2 and S_CT2 represent ML-KEM-1024 public key and ciphertext from the client and server, respectively, which are encoded as octet strings. The K_PQ shared secret is decapsulated from the ciphertext S_CT2 using the client post-quantum KEM private key as defined in <xref target="FIPS203"/>.</t>

		  <t>The HASH function used in the key exchange <xref target="RFC4253"/> is SHA-384 <xref target="NIST-SHA2"/> <xref target="RFC6234"/>.</t>
    	  </section>

    	  <section numbered="true" toc="default">
    	  <name>mlkem768x25519-sha256</name>
		  <t>mlkem768x25519-sha256 defines that the traditional client and server public keys C_PK1 and S_PK1 belong to the Curve25519 curve <xref target="RFC7748"/>. Private and public keys are generated as described therein. The public keys are defined as strings of 32 bytes as per <xref target="RFC8731"/>. The K_CL shared secret is generated from the exchanged C_PK1 and S_PK1 public keys as defined in <xref target="RFC8731"/> (key agreement method curve25519-sha256).</t>
	
		  <t>The post-quantum C_PK2 and S_CT2 represent ML-KEM-768 public key and ciphertext from the client and server, respectively, which are encoded as octet strings. The K_PQ shared secret is decapsulated from the ciphertext S_CT2 using the client post-quantum KEM private key as defined in <xref target="FIPS203"/>.</t> 
		  
		  <t>The HASH function used in the key exchange <xref target="RFC4253"/> is SHA-256 <xref target="NIST-SHA2"/> <xref target="RFC6234"/>.</t>
    	  </section>
	  
    	</section>

    	<section  anchor="shared-secret" numbered="true" toc="default">
    	<name>Shared Secret K</name>
    	<t>The PQ/T Hybrid key exchange establishes K_CL and K_PQ from the ECDH and ML-KEM key exchanges, respectively. The shared secret, K, is the HASH output of the concatenation of the two shared secrets K_CL and K_PQ as:</t> 
<ul empty="true">
       <li><t>K = HASH(K_PQ || K_CL)</t></li>
</ul>

	<t>This is similar, but not the same (for efficiency) logic as in TLS 1.3 <xref target="RFC9954"/>. In <xref target="RFC9954"/>, the classical and post-quantum exchanged secrets are concatenated and used in the key schedule, whereas in this document they are concatenated and hashed before being used in SSH's key derivation methodology.</t> 
	<t>The ECDH shared secret was traditionally encoded as an integer (mpint) as per <xref target="RFC4253"/>, <xref target="RFC5656"/>, and <xref target="RFC8731"/> and used in deriving the key. In this specification, the two shared secrets, K_PQ and K_CL, are fed into the hash function to derive K, but they are encoded as fixed-length byte arrays, not as integers. Byte arrays are defined in <xref section="5" target="RFC4251"/>.    Specifically for K_CL, the conversion from mpint to a byte array is done by
   taking the mpint that the corresponding standalone key exchange method
   would have output and re-encoding it as a fixed-size (32 bytes for
   Curve25519 and secp256r1 or 48 bytes for secp384r1) byte array that is 
   always big-endian.</t>		
    </section>
 	
    	<section numbered="true" toc="default">
    	<name>Key Derivation</name>
        <t>The derivation of encryption keys <bcp14>MUST</bcp14> be done from the shared secret K according to <xref section="7.2" target="RFC4253"/> with a modification on the exchange hash H. </t>
        
        <t>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:</t>

<sourcecode><![CDATA[
      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 secret]]></sourcecode>

	<t>K, the shared secret used in H, was traditionally encoded as an integer (mpint) as per <xref target="RFC4253"/>, <xref target="RFC5656"/>, and <xref target="RFC8731"/>. In this specification, K is the hash output of the two concatenated byte arrays (<xref target="shared-secret"/>), which is not an integer. Thus, K is encoded as a string using the process described in <xref section="5" target="RFC4251"/> and is then fed along with other data in H to the key exchange method's HASH function to generate encryption keys.
	</t>
	
    	</section>
 

    </section>
  
	<section numbered="true" toc="default">
	<name>Message Size</name>
	<t>An SSH implementation adhering to <xref target="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_length', 'padding_length', 'payload', 'random padding', and 'mac'). These numbers represent what must be minimally supported by SSH applications. Although some post-quantum key exchange schemes could produce large messages, this document does not define method names (<xref target="kex-methods"/>), which can lead to packets exceeding the minimally specified lengths in <xref section="6.1" target="RFC4253"/>. Thus, this document does not define new behavior for cases where a PQ/T Hybrid key exchange message causes a packet to exceed the minimally supported length.</t>
	</section>

   <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>

      <t>IANA has registered the following method names in the "Key Exchange Method Names" registry within the "Secure Shell (SSH) Protocol Parameters" registry group <xref target="IANA-SSH"/>.</t>

<table anchor="iana-table"> 
  <name>New Key Exchange Method Names</name>
  <thead>
    <tr>
      <th>Method Name</th> 
      <th>Reference</th>
      <th>OK to Implement</th>
    </tr>
  </thead>
  <tbody> 
    <tr>
      <td>mlkem768nistp256-sha256</td>
      <td>RFC 10042</td>
      <td><bcp14>SHOULD</bcp14></td>
    </tr>
    <tr>
      <td>mlkem1024nistp384-sha384</td>
      <td>RFC 10042</td>
      <td><bcp14>SHOULD</bcp14></td>
    </tr>
    <tr>
      <td>mlkem768x25519-sha256</td>
      <td>RFC 10042</td>
      <td><bcp14>SHOULD</bcp14></td>
    </tr>
  </tbody>
</table>
    </section>

    <section anchor="Security" numbered="true" toc="default">
      <name>Security Considerations</name>
	  <t>The security considerations given in <xref target="RFC5656"/> and <xref target="RFC8731"/> also apply to the ECDH part of the P/T Hybrid key exchange schemes defined in this document.</t>
	  <t>As it is commonly done with (EC)DH keys today, generating an ephemeral key exchange keypair for ECDH and ML-KEM per connection is <bcp14>REQUIRED</bcp14> by this specification. Additionally, implementations <bcp14>MUST NOT</bcp14> 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 cryptographically secure random data. The generation of quality random numbers for the traditional and ML-KEM keypairs and the ML-KEM ciphertext can be difficult; see Section 3.3 of <xref target="FIPS203"/> for additional information around randomness generation for ML-KEM.</t>
	  <t>Implementations <bcp14>MUST</bcp14> use the encodings for K_PQ, K_CL, and K specified in this document to prevent potential side-channel attacks. The way a derived binary secret string is encoded (i.e., adding or removing zero bytes for encoding) before it is hashed may lead to a variable-length secret, which raises the potential for a side-channel attack. In broad terms, when the secret is longer, the hash function may need to process more blocks internally, which could determine the length of what is hashed. This could leak the most significant bit of the derived secret and/or allow detection of when the most significant bytes are zero. In some unfortunate circumstances, this has led to timing attacks, e.g., the Lucky Thirteen <xref target="LUCKY13"/> and Raccoon <xref target="RACCOON"/> attacks. In <xref target="RFC8731"/> and <xref target="RFC5656"/>, the ECDH shared secrets were mpint and fixed-length integer encoded, respectively, which raised a potential for such side-channel attacks. This problem is addressed in this document by encoding K_PQ and K_CL as fixed-length byte arrays and K as a string.</t>

	  <t><xref target="PQ-PROOF"/> and <xref target="PQ-PROOF2"/> contain
	  proofs of security for PQ/T Hybrid key exchange schemes. <xref
	  target="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 <xref target="appendixA"/>. 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.</t>
		<t>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.</t>
    </section>
  </middle>

 <back>

<displayreference target="I-D.connolly-cfrg-xwing-kem" to="XWING-KEM"/>
<displayreference target="I-D.ietf-opsawg-rfc5706bis" to="OAM-CONS"/>
<displayreference target="I-D.josefsson-chempat" to="CHEMPAT"/>
   <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4251.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4253.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5656.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6234.xml"/> 
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8731.xml"/>
        <reference anchor="FIPS203" target="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf">
          <front>
            <title>Module-Lattice-Based Key-Encapsulation Mechanism Standard</title>
            <author>
              <organization abbrev="NIST">National Institute of Standards and Technology</organization>
            </author>
            <date year="2024" month="August" day="13"/>
          </front>
          <seriesInfo name='NIST FIPS' value='203'/>
          <seriesInfo name='DOI' value='10.6028/NIST.FIPS.203'/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4250.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7748.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9794.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9958.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9954.xml"/>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-opsawg-rfc5706bis.xml"/>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.connolly-cfrg-xwing-kem.xml"/>
		  
        <reference anchor="IANA-SSH" target="https://www.iana.org/assignments/ssh-parameters">
          <front>
               <title>Secure Shell (SSH) Protocol Parameters</title>
               <author>
                 <organization>IANA</organization>
               </author>
             </front>
        </reference>

        <reference anchor="NIST_PQ" target="https://csrc.nist.gov/projects/post-quantum-cryptography">
          <front>
               <title>Post-Quantum Cryptography (PQC)</title>
               <author>
                 <organization>NIST</organization>
               </author>
               <date day="5" month="August" year="2026"/>
             </front>
        </reference>

        <reference anchor="NIST-SP800-186">
          <front>
               <title>Recommendations for Discrete Logarithm-based Cryptography: Elliptic Curve Domain Parameters</title>
               <author initials="L." surname="Chen" fullname="Lily Chen"/>
               <author initials="D." surname="Moody" fullname="Dustin Moody"/>
               <author initials="K." surname="Randall" fullname="Karen Randall"/>
               <author initials="A." surname="Regenscheid" fullname="Andrew Regenscheid"/>
               <author initials="A." surname="Robinson" fullname="Angela Robinson"/>
               <date month="February" year="2023"/>
             </front>
          <refcontent>National Institute of Standards and Technology</refcontent>
          <seriesInfo name='NIST SP' value='800-186'/>
          <seriesInfo name='DOI' value='10.6028/NIST.SP.800-186'/>
        </reference>
        <reference anchor="NIST-SHA2" target="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf">
          <front>
               <title>Secure Hash Standard (SHS)</title>
               <author>
                 <organization abbrev="NIST">National Institute of Standards and Technology</organization>
               </author>
               <date month="August" year="2015"/>
             </front>
          <seriesInfo name='NIST FIPS' value='180-4'/>
          <seriesInfo name='DOI' value='10.6028/NIST.FIPS.180-4'/>
        </reference>
 
        <reference anchor="NIST-SP-800-56C">
          <front>
            <title>Recommendation for Key-Derivation Methods in Key-Establishment Schemes</title>
            <author initials="E." surname="Barker" fullname="Elaine Barker"/>
            <author initials="L." surname="Chen" fullname="Lily Chen"/>
            <author initials="R." surname="Davis" fullname="Richard Davis"/>
            <date year="2020" month="August"/>
          </front>
          <refcontent>National Institute of Standards and Technology</refcontent>
          <seriesInfo name='NIST SP' value='800-56Cr2'/>
          <seriesInfo name='DOI' value='10.6028/NIST.SP.800-56Cr2'/>
        </reference>
        <reference anchor="NIST-SP-800-135">
          <front>
            <title>Recommendation for Existing Application-Specific Key Derivation Functions</title>
            <author initials="Q." surname="Dang" fullname="Quynh Dang"/>
            <date year="2011" month="December"/>
          </front>
          <refcontent>National Institute of Standards and Technology</refcontent>
          <seriesInfo name='NIST SP' value='800-135r1'/>
          <seriesInfo name='DOI' value='10.6028/NIST.SP.800-135r1'/>
        </reference>
        <reference anchor="RACCOON" target="https://raccoon-attack.com/">
          <front>
            <title>Raccoon Attack: Finding and Exploiting Most-Significant-Bit-Oracles in TLS-DH(E)</title>
            <author initials="R." surname="Merget">
              <organization/>
            </author>
            <author initials="M." surname="Brinkmann">
              <organization/>
            </author>
            <author initials="N." surname="Aviram">
              <organization/>
            </author>
            <author initials="J." surname="Somorovsky">
              <organization/>
            </author>
            <author initials="J." surname="Mittmann">
              <organization/>
            </author>
            <author initials="J." surname="Schwenk">
              <organization/>
            </author>
            <date year="2020" month="September"/>
          </front>
        </reference>
        <reference anchor="LUCKY13" target="https://ieeexplore.ieee.org/iel7/6547086/6547088/06547131.pdf">
          <front>
            <title>Lucky Thirteen: Breaking the TLS and DTLS record protocols</title>
            <author initials="N.J." surname="Al Fardan">
              <organization/>
            </author>
            <author initials="K.G." surname="Paterson">
              <organization/>
            </author>
            <date year="2013"/>
          </front>
          <refcontent>2013 IEEE Symposium on Security and Privacy, pp. 526-540</refcontent>
          <seriesInfo name='DOI' value='10.1109/SP.2013.42'/>
        </reference>
        <reference anchor="PQ-PROOF" target="https://eprint.iacr.org/2020/1364">
          <front>
            <title>Security of Hybrid Key Encapsulation</title>
            <author initials="M." surname="Campagna" fullname="Matthew Campagna">
              <organization></organization>
            </author>
            <author initials="A." surname="Petcher" fullname="Adam Petcher">
              <organization></organization>
            </author>
            <date year="2020"/>
          </front>
          <refcontent>Cryptology ePrint Archive, Paper 2020/1364</refcontent>
        </reference>
        <reference anchor="PQ-PROOF2" target="https://eprint.iacr.org/2023/972">
          <front>
            <title>Security of Hybrid Key Establishment using Concatenation</title>
            <author initials="A." surname="Petcher" fullname="Adam Petcher">
              <organization></organization>
            </author>
            <author initials="M." surname="Campagna" fullname="Matthew Campagna">
              <organization></organization>
            </author>
            <date year="2023"/>
          </front>
          <refcontent>Cryptology ePrint Archive, Paper 2023/972</refcontent>
        </reference>
        <reference anchor="NIST-SP-800-227">
          <front>
            <title>Recommendations for Key-Encapsulation Mechanisms</title>
            <author initials="G." surname="Alagic" fullname="Gorjan Alagic"/>
            <author initials="E." surname="Barker" fullname="Elaine Barker"/>
            <author initials="L." surname="Chen" fullname="Lily Chen"/>            
            <author initials="D." surname="Dustin" fullname="Dustin Moody"/>
            <author initials="A." surname="Robinson" fullname="Angela Robinson"/>
            <author initials="H." surname="Silberg" fullname="Hamilton Silberg"/>
            <author initials="N." surname="Waller" fullname="Noah Waller"/>
            <date year="2025" month="September"/>
          </front>
          <refcontent>National Institute of Standards and Technology</refcontent>
          <seriesInfo name='NIST SP' value='800-227'/>
          <seriesInfo name='DOI' value='10.6028/NIST.SP.800-227'/>
        </reference>
        <reference anchor="NIST-SP-800-133r2" >
          <front>
            <title>Recommendation for Cryptographic Key Generation</title>
            <author initials="E." surname="Barker" fullname="Elaine Barker"/>
            <author initials="A." surname="Roginsky" fullname="Allen Roginsky"/>
            <author initials="R." surname="Davis" fullname="Richard Davis"/>
            <date year="2020" month="June"/>
          </front>
          <refcontent>National Institute of Standards and Technology</refcontent>
          <seriesInfo name='NIST SP' value='800-133r2'/>
          <seriesInfo name='DOI' value='10.6028/NIST.SP.800-133r2'/>
        </reference>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9941.xml"/>

	<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.josefsson-chempat.xml"/>
      </references>
    </references>

    <section anchor="appendixA" numbered="true" toc="default">
      <name>Other Combiners</name>
	  <t>Other combiners to derive K and the SSH keys were considered while working on this document. These include:</t>
        <ol type="(%d)">
		  <li>K = K_PQ || K_CL. All SSH keys are derived from K as defined in <xref section="7.2" target="RFC4253"/>.</li>
		  <li><t>All SSH keys are derived from K as defined in <xref section="7.2" target="RFC4253"/>. </t>
		     <ol type="(%c)">
			   <li>K = HASH(K_PQ, K_CL). This is the option adopted in this specification.</li>
			   <li>K = HMAC-HASH(K_PQ, K_CL)</li>
			   <li>K = HMAC-HASH(0, K_PQ || K_CL)</li>
			 </ol>
		  </li>
		  <li>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)).</li>
		</ol>
	  <t>Option (3) follows the Extract-and-Expand logic described in <xref target="NIST-SP-800-56C"/>. It deviates from existing SSH key derivation significantly and might be viewed as too far from the current SSH design. It probably would be a good approach for SSH to move from basic hashing everywhere to use proper KDFs with extract/expand, but that should be a separate effort.</t>	
	  <t>We also considered combiners like the ones proposed in <xref target="I-D.josefsson-chempat"/> and <xref target="I-D.connolly-cfrg-xwing-kem"/>. <xref target="I-D.connolly-cfrg-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 <xref target="PQ-PROOF2"/> and discussed in <xref target="Security"/>.</t>
    </section>
	
    <section numbered="true" toc="default">
      <name>FIPS</name>
	  <t><xref target="NIST-SP-800-56C"/> and <xref target="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/secp256r1 curve or ML-KEM) with a shared secret from a non-approved algorithm (e.g., X25519). <xref target="NIST-SP-800-227"/> lists simple concatenation as an approved way of producing a PQ/T Hybrid shared secret in which one of the constituent secrets is from an approved algorithm (i.e., secp256r1, secp384r1, ML-KEM) and using it in a key derivation/combination method approved by <xref target="NIST-SP-800-56C"/> or <xref target="NIST-SP-800-133r2"/>. Although the SSH key derivation function does not follow <xref target="NIST-SP-800-56C"/> or <xref target="NIST-SP-800-133r2"/>, it is approved by <xref target="NIST-SP-800-135"/>. This method is the same used in this document to derive SSH keys from the quantum-resistant shared secret. Thus, the SSH key combiner in this document appears to be FIPS-approved although it is not specifically called out in <xref target="NIST-SP-800-227"/>.</t> 
    </section>

    <section anchor="Acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
	  <t>The authors want to thank <contact fullname="Gerardo Ravago"/> from AWS for implementing this document and finding issues. We also want to thank <contact fullname="Damien Miller"/> and <contact fullname="Markus Friedl"/> for their feedback and for implementing some of the SSH key exchange methods in this document in OpenSSH. Special acknowledgements go to <contact fullname="Simon Tatham"/> from Putty, <contact fullname="Loganaden Velvindron"/>, <contact fullname="John Mattsson"/>, <contact fullname="Simon Josefsson"/>, and <contact fullname="Watson Ladd"/> for their valuable suggestions.</t>
    </section>
 </back>
</rfc>
