<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.31 (Ruby 3.2.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-sfluhrer-ssh-mldsa-08" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.32.0 -->
  <front>
    <title abbrev="SSH ML-DSA">SSH Support of ML-DSA</title>
    <seriesInfo name="Internet-Draft" value="draft-sfluhrer-ssh-mldsa-08"/>
    <author fullname="Scott Fluhrer">
      <organization>Cisco Systems</organization>
      <address>
        <email>sfluhrer@cisco.com</email>
      </address>
    </author>
		<author initials="R." surname="Petrov" fullname="Roumen Petrov">
			<address>
				<postal>
					<city>Sofia</city>
					<code>1750</code>
					<country>Bulgaria</country>
				</postal>
				<email>pkixssh@roumenpetrov.info</email>
				<uri>https://roumenpetrov.info/secsh/</uri>
			</address>
		</author>
    <author fullname="Ryan Appel">
      <organization>Bank of America</organization>
      <address>
        <email>ryan.appel@bofa.com</email>
      </address>
    </author>
    <date year="2026" month="August" day="28"/>
    <area>sec</area>
    <workgroup>sshm</workgroup>
		<keyword>Module-Lattice-Based Digital Signature Standard</keyword>
		<keyword>ML-DSA</keyword>
		<keyword>Secure Shell</keyword>
		<keyword>SSH</keyword>
		<keyword>Secure remote-login</keyword>
		<keyword>Public Key Algorithm</keyword>
    <abstract>
      <?line 56?>

<t>This document describes the use of the ML-DSA digital signature algorithms in the Secure Shell (SSH) protocol. Accordingly, this RFC updates RFC 4253.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://sfluhrer.github.io/ssh-mldsa/draft-sfluhrer-ssh-mldsa.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-sfluhrer-ssh-mldsa/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Secure Shell Maintenance Security Area mailing list (<eref target="mailto:ssh@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/ssh/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/ssh/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/sfluhrer/ssh-mldsa"/>.</t>
    </note>
  </front>
  <middle>
    <?line 61?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>A Cryptographically Relevant Quantum Computer (CRQC) is a quantum computer with sufficient compute capability and stability that it is able to break traditional asymmetric cryptographic algorithms:
   e.g RSA, ECDSA; which are currently the only authentication algorithms available for SSH.
   NIST has recently published the post-quantum cryptography (PQC) algorithm known as ML-DSA <xref target="FIPS204"/> which is a digital signature algorithm.</t>
      <t>This document describes how to use this algorithm for authentication within SSH <xref target="RFC4251"/>, as a replacement for the traditional signature algorithms (RSA, ECDSA).</t>
			<t>
This document standardizes the use of the names <strong>ssh-mldsa-44</strong>, <strong>ssh-mldsa-65</strong>, and <strong>ssh-mldsa-87</strong>.
These algorithms correspond to Table 1. "ML-DSA parameter sets" defined in <xref target="FIPS204"/> Section 4 "Parameter Sets".
			</t>
      <section anchor="background-on-ml-dsa">
        <name>Background on ML-DSA</name>
        <t>ML-DSA (as specified in FIPS 204) is a signature algorithm that is believed to be secure against attackers who have a CRQC available to them.
   There are three parameter sets defined for it which belong to a respective NIST Security Category of 2, 3, and 5 (ML-DSA-44, ML-DSA-65, and ML-DSA-87).
   In addition, for each defined parameter set, there are two versions, the 'pure' version (where ML-DSA computes the hash of the message internally and then signs that hash),
   and a 'prehashed' version (where ML-DSA signs a hash that was computed outside of ML-DSA).
   For this protocol, we will always use the pure version.</t>
        <t>In addition, ML-DSA also has a 'context' input, which is a short string that is common to the sender and the recceiver.
   It is intended to allow for domain separation between separate uses of the same public key.
   This protocol always uses an empty (zero length) context.</t>
        <t>FIPS 204 also allows ML-DSA to be run in either deterministic or 'hedged' mode (where randomness is applied during the signature generation operation).
   We recommend that implementations use hedged mode, as it blocks certain side channel attacks.
   However, as both are interoperable, we do not place any requirement on which is used within this protocol.</t>
      </section>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</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 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

<t>The descriptions of key and signature formats use the notation
   introduced in <xref target="RFC4251"/>, Section 3, and the string data type from
   <xref target="RFC4251"/>, Section 5.  Identifiers and terminology from ML-DSA
   <xref target="FIPS204"/> are used throughout the document.</t>
    </section>
    <section anchor="public-key-algorithms">
      <name>Public Key Algorithms</name>
      <t>This document describes three public key algorithms for use with SSH, as
   per <xref target="RFC4253"/>, Section 6.6, corresponding to the three parameter sets of ML-DSA.
   The names of the algorithms are "ssh-mldsa-44", "ssh-mldsa-65" and "ssh-mldsa-87", to match the level 2, 3 and 5 parameter sets <xref target="FIPS204"/>.
   These algorithm support only signing; they do not support encryption.</t>
      <t>The below table lists the public key sizes and the signature size (in bytes) for the three parameter sets.</t>
      <table>
        <thead>
          <tr>
            <th align="left">Public Key Algorithm Name</th>
            <th align="left">Public Key Size</th>
            <th align="left">Signature Size</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">ssh-mldsa-44</td>
            <td align="left">1312</td>
            <td align="left">2420</td>
          </tr>
          <tr>
            <td align="left">ssh-mldsa-65</td>
            <td align="left">1952</td>
            <td align="left">3309</td>
          </tr>
          <tr>
            <td align="left">ssh-mldsa-87</td>
            <td align="left">2592</td>
            <td align="left">4627</td>
          </tr>
        </tbody>
      </table>
			<t>
Standard implementations of SSH <bcp14>SHOULD</bcp14> implement <strong>mldsa-65</strong> public Key algorithm.
It <bcp14>MAY</bcp14> implement <strong>mldsa-44</strong> and <strong>mldsa-87</strong> public key algorithms.
			</t>
    </section>
    <section anchor="public-key-format">
      <name>Public Key Format</name>
<ul>
<li>
			<t>
The <strong>mldsa-44</strong> key format has the following encoding:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-44</dd>
				<dt>string</dt><dd>key</dd>
			</dl>
			<t>
Here, 'key' is the 1312-octet public key encoded as is described in <xref target="FIPS204"/> Algorithm 22.
			</t>
</li>
<li>
			<t>
The <strong>mldsa-65</strong> key format has the following encoding:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-65</dd>
				<dt>string</dt><dd>key</dd>
			</dl>
			<t>
Here, 'key' is the 1952-octet public key encoded as is described in <xref target="FIPS204"/> Algorithm 22.
			</t>
</li>
<li>
			<t>
The <strong>mldsa-87</strong> key format has the following encoding:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-87</dd>
				<dt>string</dt><dd>key</dd>
			</dl>
			<t>
Here, 'key' is the 2592-octet public key encoded as is described in <xref target="FIPS204"/> Algorithm 22.
			</t>
</li>
</ul>
    </section>
    <section anchor="private-key-format">
      <name>Private Key Format</name>
      <t> It is not required that the implementation be able to import or export private keys, but if it does, it SHOULD
      use good judgement on the methods in which keys can be imported and exported. </t>
      <t> Implementers and Users of these implementations should be aware that <xref target="FIPS204"/> allows for the
      private key to be stored in either "seed" form or "expanded" form. While it is feasible for an implementation to
      expand the seed form of the private key to the expanded form, it is impossible to reverse this expansion. If one
      implementation only uses and stores the expanded form of the ML-DSA private key, exporting a key from that implementation to
      a different implementation that only supports seed format is impossible.</t>
      <t> Although Private key format is out of scope of this document, if an implementation stores a key in expanded
      form, it SHOULD also store the seed format of the same private key as to not prohibit interoperability. </t>
    </section>
    <section anchor="signature-algorithm">
      <name>Signature Algorithm</name>
<t>
Signatures are generated according to the procedure described in Section 5.2 of <xref target="FIPS204"/>, and verified according to the procedure described in Section 5.3, using an empty string as the context parameter.
</t>
    </section>
		<section numbered="true" toc="default">
			<name>Signature Format</name>
<ul>
<li>
			<t>
The <strong>mldsa-44</strong> public key algorithm has the following format for encoding the signature:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-44</dd>
				<dt>string</dt><dd>signature</dd>
			</dl>
			<t>
Here, 'signature' is the 2420-octet signature produced in accordance with <xref target="FIPS204"/> Algorithm 2.
			</t>
</li>
<li>
			<t>
The <strong>mldsa-65</strong> public key algorithm has the following format for encoding the signature:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-65</dd>
				<dt>string</dt><dd>signature</dd>
			</dl>
			<t>
Here, 'signature' is the 3309-octet signature produced in accordance with <xref target="FIPS204"/> Algorithm 2.
			</t>
</li>
<li>
			<t>
The <strong>mldsa-87</strong> public key algorithm has the following format for encoding the signature:
			</t>
			<dl newline="false" spacing="compact" indent="6">
				<dt>string</dt><dd>ssh-mldsa-87</dd>
				<dt>string</dt><dd>signature</dd>
			</dl>
			<t>
Here, 'signature' is the 4627-octet signature produced in accordance with <xref target="FIPS204"/> Algorithm 2.
			</t>
</li>
</ul>
		</section>
    <section anchor="verification-algorithm">
      <name>Verification Algorithm</name>
      <t>Signatures are verified in two steps.
   For the first step, the length of the signature must be checked against the parameter set,
   if the signature length does not match the expected signature length for the parameter set, it must be rejected.
   Then the signature is verified according to the procedure in
   <xref target="FIPS204"/>, algorithm 3, using the "pure" version of ML-DSA, with an empty context string.</t>
    </section>
    <section anchor="sshfp-dns-resource-records">
      <name>SSHFP DNS Resource Records</name>
      <t>Usage and generation of the SSHFP DNS resource record is described in
   <xref target="RFC4255"/>.  This section illustrates the generation of SSHFP resource
   records for ML-DSA keys, and this document also specifies
   the corresponding code point to "SSHFP RR Types for public key
   algorithms" in the "DNS SSHFP Resource Record Parameters" IANA
   registry <xref target="IANA-SSHFP"/>.</t>
      <t>The generation of SSHFP resource records keys for ML-DSA is
   described as follows.</t>
      <t>The encoding of ML-DSA public keys is described as above in section 4.</t>
      <t>The SSHFP Resource Record for an ML-DSA key fingerprint
   (with a SHA-256 fingerprint) would, for example, be:</t>
      <t>pqserver.example.com. IN SSHFP TBD 2 (
                    a87f1b687ac0e57d2a081a2f28267237
                    34d90ed316d2b818ca9580ea384d9240 )</t>
      <t>Replace TBD with the value eventually allocated by IANA.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document augments the Public Key Algorithm Names in <xref target="RFC4250"/>, Section 4.11.3.</t>
      <t>IANA is requested to add the following entries to "Public Key Algorithm
   Names" in the "Secure Shell (SSH) Protocol Parameters" registry
   <xref target="IANA-SSH"/>:</t>
      <table>
        <thead>
          <tr>
            <th align="left">Public Key Algorithm Name</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">ssh-mldsa-44</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">ssh-mldsa-65</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">ssh-mldsa-87</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>
      <t>IANA is requested to add the following entries to "SSHFP RR Types for
   public key algorithms" in the "DNS SSHFP Resource Record Parameters"
   registry <xref target="IANA-SSHFP"/>:</t>
      <table>
        <thead>
          <tr>
            <th align="left">Value</th>
            <th align="left">Description</th>
            <th align="left">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">TBD1</td>
            <td align="left">ML-DSA-44</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBD2</td>
            <td align="left">ML-DSA-65</td>
            <td align="left">This document</td>
          </tr>
          <tr>
            <td align="left">TBD3</td>
            <td align="left">ML-DSA-87</td>
            <td align="left">This document</td>
          </tr>
        </tbody>
      </table>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>The security considerations in <xref target="RFC4251"/>, Section 9 apply to all SSH
   implementations, including those using ML-DSA.</t>
      <t>The security considerations in ML-DSA <xref target="FIPS204"/> apply to all
   uses of ML-DSA, including those in SSH.</t>
      <t>Cryptographic algorithms and parameters are usually broken or
   weakened over time.  Implementers and users need to continously re-evaluate that cryptographic algorithms continue to provide the
   expected level of security.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="FIPS204" target="https://doi.org/10.6028/NIST.FIPS.204">
          <front>
            <title>Module-Lattice-Based Digital Signature Standard</title>
            <author>
              <organization/>
            </author>
            <date year="2024" month="August"/>
          </front>
          <seriesInfo name="NIST" value="FIPS 204"/>
        </reference>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4250.xml"/>
        <reference anchor="RFC4251">
          <front>
            <title>The Secure Shell (SSH) Protocol Architecture</title>
            <author fullname="T. Ylonen" initials="T." surname="Ylonen"/>
            <author fullname="C. Lonvick" initials="C." role="editor" surname="Lonvick"/>
            <date month="January" year="2006"/>
            <abstract>
              <t>The Secure Shell (SSH) Protocol is a protocol for secure remote login and other secure network services over an insecure network. This document describes the architecture of the SSH protocol, as well as the notation and terminology used in SSH protocol documents. It also discusses the SSH algorithm naming system that allows local extensions. The SSH protocol consists of three major components: The Transport Layer Protocol provides server authentication, confidentiality, and integrity with perfect forward secrecy. The User Authentication Protocol authenticates the client to the server. The Connection Protocol multiplexes the encrypted tunnel into several logical channels. Details of these protocols are described in separate documents. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4251"/>
          <seriesInfo name="DOI" value="10.17487/RFC4251"/>
        </reference>
        <reference anchor="RFC4253">
          <front>
            <title>The Secure Shell (SSH) Transport Layer Protocol</title>
            <author fullname="T. Ylonen" initials="T." surname="Ylonen"/>
            <author fullname="C. Lonvick" initials="C." role="editor" surname="Lonvick"/>
            <date month="January" year="2006"/>
            <abstract>
              <t>The Secure Shell (SSH) is a protocol for secure remote login and other secure network services over an insecure network.</t>
              <t>This document describes the SSH transport layer protocol, which typically runs on top of TCP/IP. The protocol can be used as a basis for a number of secure network services. It provides strong encryption, server authentication, and integrity protection. It may also provide compression.</t>
              <t>Key exchange method, public key algorithm, symmetric encryption algorithm, message authentication algorithm, and hash algorithm are all negotiated.</t>
              <t>This document also describes the Diffie-Hellman key exchange method and the minimal set of algorithms that are needed to implement the SSH transport layer protocol. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4253"/>
          <seriesInfo name="DOI" value="10.17487/RFC4253"/>
        </reference>
        <reference anchor="RFC4255">
          <front>
            <title>Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints</title>
            <author fullname="J. Schlyter" initials="J." surname="Schlyter"/>
            <author fullname="W. Griffin" initials="W." surname="Griffin"/>
            <date month="January" year="2006"/>
            <abstract>
              <t>This document describes a method of verifying Secure Shell (SSH) host keys using Domain Name System Security (DNSSEC). The document defines a new DNS resource record that contains a standard SSH key fingerprint. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4255"/>
          <seriesInfo name="DOI" value="10.17487/RFC4255"/>
        </reference>
        <reference anchor="IANA-SSH" target="https://www.iana.org/assignments/ssh-parameters">
          <front>
            <title>Secure Shell (SSH) Protocol Parameters</title>
            <author>
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
        <reference anchor="IANA-SSHFP" target="https://www.iana.org/assignments/dns-sshfp-rr-parameters)">
          <front>
            <title>DNS SSHFP Resource Record Parameters</title>
            <author>
              <organization/>
            </author>
            <date>n.d.</date>
          </front>
        </reference>
      </references>
    </references>
    <?line 222?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>The text of draft-josefsson-ssh-sphincs was used as the original template for this document.</t>
    </section>
  </back>
</rfc>
