<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY rfc3174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3174.xml">
<!ENTITY rfc3526 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3526.xml">
<!ENTITY rfc3766 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3766.xml">
<!ENTITY rfc4250 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4250.xml">
<!ENTITY rfc4253 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml">
<!ENTITY rfc4344 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4344.xml">
<!ENTITY rfc5656 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5656.xml">
<!ENTITY rfc6187 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6187.xml">
<!ENTITY rfc6194 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6194.xml">
<!ENTITY rfc6234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6234.xml">
<!ENTITY rfc8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
]>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc
     submissionType="IETF"
     category="std"
     consensus="yes"
     number="8268"
     updates="4250, 4253"
     ipr="trust200902">
 <front>
   <title abbrev="More MODP DH KEX Groups for SSH">More Modular
   Exponentiation (MODP) Diffie-Hellman (DH) Key Exchange (KEX) Groups
   for Secure Shell (SSH)</title>
    <author initials="M. D." surname="Baushke"
            fullname="Mark D. Baushke">
      <organization>Juniper Networks, Inc.</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089-1228</code>
          <country>United States of America</country>
        </postal>
        <phone>+1 408 745 2952</phone>
        <email>mdb@juniper.net</email>
        <uri>http://www.juniper.net/</uri>
      </address>
    </author>
   <date month="December" year="2017" />

   <workgroup>Internet Engineering Task Force</workgroup>

   <keyword>Public Key</keyword>
   <keyword>Private Key</keyword>
   <keyword>group14</keyword>
   <keyword>group15</keyword>
   <keyword>group16</keyword>
   <keyword>group17</keyword>
   <keyword>group18</keyword>
   <keyword>2048-bit</keyword>
   <keyword>3072-bit</keyword>
   <keyword>4096-bit</keyword>
   <keyword>6144-bit</keyword>
   <keyword>8192-bit</keyword>

   <abstract>

     <t>
       This document defines added Modular Exponentiation (MODP)
       groups for the Secure Shell (SSH) protocol using SHA-2 hashes.
       This document updates RFC 4250. This document updates RFC 4253
       by correcting an error regarding checking the Peer's DH Public
       Key.
     </t>

   </abstract>

 </front>

 <middle>

   <section title="Overview and Rationale">

     <t>
       Secure Shell (SSH) is a common protocol for secure
       communication on the Internet. Security protocols and
       primitives are an active area for research and help to suggest
       updates to SSH.
     </t>

     <t>
       Section 8 of <xref target="RFC4253"/> contains a small error in
       point 3 regarding checking the Peer's DH Public Key. <xref
       target="checking"/> of this document provides the correction.
     </t>

     <t>
       Due to security concerns with SHA-1 <xref target="RFC6194"/>
       and with MODP groups with less than 2048 bits <xref
       target="NIST-SP-800-131Ar1"/>, implementers and users should
       request support for larger Diffie-Hellman (DH) MODP group sizes
       with data-integrity verification by using the SHA-2 family of
       secure hash algorithms and by having MODP groups provide more
       security. The use of larger MODP groups and the move to the
       SHA-2 family of hashes are important features to strengthen the
       key exchange algorithms available to the SSH client and server.
     </t>

     <t>
       DH primes being adopted by this document are all "safe primes"
       such that p = 2q + 1 where q is also a prime. New MODP groups
       are being introduced starting with the MODP 3072-bit group15.
       All use SHA512 as the hash algorithm.
     </t>

     <t>
       The DH 2048-bit MODP group14 is already present in most SSH
       implementations and most implementations already have a SHA256
       implementation, so "diffie-hellman-group14-sha256" is provided
       as easy to implement.
     </t>

     <t>
       It is intended that these new MODP groups with SHA-2-based
       hashes update Section 6.4 of <xref target="RFC4253"/> and
       Section 4.10 of <xref target="RFC4250"/>.
     </t>

     <t>
       The United States Information Assurance Directorate (IAD) at
       the National Security Agency (NSA) has published "Commercial
       National Security Algorithm Suite and Quantum Computing
       Frequently Asked Questions". <xref
       target="MFQ-U-OO-815099-15"/> is addressed to organizations
       that run classified or unclassified national security systems
       (NSS) and vendors that build products used in NSS.
     </t>

     <t>
       This FAQ document indicates that NSS should no longer use:

       <list style="symbols">

         <t>
           Elliptic Curve Diffie-Hellman (ECDH) and Elliptic Curve
           Digital Signature Algorithm (ECDSA) with NIST P-256. (For
           SSH, this would suggest avoiding <xref target="RFC5656"/>
           Key Exchange Algorithm "ecdh-sha2-nistp256" and Public Key
           Algorithm "ecdsa-sha2-nistp256".)
         </t>

         <t>
           SHA-256 (For SSH, this would suggest avoiding any Key
           Exchange Method using SHA1, SHA224, or SHA256 in favor of
           using SHA384 or SHA512.)
         </t>

         <t>
           AES-128 (For SSH, this would suggest avoiding Encryption
           Algorithms <xref target="RFC4253"/> "aes128-cbc" and <xref
           target="RFC4344"/> "aes128-ctr".)
         </t>

         <t>
           RSA with 2048-bit keys (For SSH, this would suggest
           avoiding <xref target="RFC4253"/> "ssh-rsa" using RSA with
           SHA1 as well as <xref target="RFC6187"/>
           "x509v3-rsa2048-sha256" as well as any other RSA key that
           has a length less than 3072-bits or uses a hash less than
           SHA384.)
         </t>

         <t>
           Diffie-Hellman with 2048-bit keys (For SSH, this would
           suggest avoiding use of <xref target="RFC4253"/> both of
           "diffie-hellman-group1-sha1" and "diffie-hellman-group14-sha1"
           as well as avoiding "diffie-hellman-group14-sha256" added by
           this document.)
         </t>

       </list>

     </t>

     <t>
       The FAQ also states that NSS users should select DH groups
       based upon well-established and validated parameter sets that
       comply with the minimum required sizes. Some specific examples
       include:

       <list style="symbols">

         <t>
           Elliptic Curves are currently restricted to the NIST P-384
           group only for both ECDH and ECDSA, in accordance with
           existing NIST and National Information Assurance
           Partnership (NIAP) standards. (For SSH, this means using
           <xref target="RFC5656"/> "ecdh-sha2-nistp384" for key
           exchange and "ecdsa-sha2-nistp384" for Public Key Algorithm
           Names.)
         </t>

         <t>
           RSA moduli should have a minimum size of 3072 bits
           (other than the noted PKI exception), and keys should be
           generated in accordance with all relevant NIST standards.
         </t>

         <t>
           For Diffie-Hellman, use a Diffie-Hellman prime modulus of
           at least 3072 bits. (For bit sizes as specified in <xref
           target="RFC3526"/>, this would allow for any of group15,
           group16, group17, group18 to be used.)
         </t>

       </list>

     </t>

     <t>
       Although SSH may not always be used to protect Top Secret
       communications, this document adopts the use of the DH groups
       provided as an example in the FAQ as well as the use of SHA512
       rather than SHA256 for the new DH groups.
     </t>

   </section>

   <section title="Requirements Language">

        <t>
          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&nbsp;14 <xref
          target="RFC2119"/> <xref target="RFC8174"/> when, and only
          when, they appear in all capitals, as shown here.
        </t>

   </section>

   <section title="Key Exchange Algorithms">

     <t>
       This document adds some new Key Exchange Algorithm Method Names
       to what originally appeared in <xref target="RFC4253"/> and
       <xref target="RFC4250"/>.
     </t>

     <t>
       This document adopts the style and conventions of <xref
       target="RFC4253"/> in specifying how the use of new data key
       exchange is indicated in SSH.
     </t>

     <t>
       The following new key exchange method algorithms are defined:
       <list style="symbols">
         <t>diffie-hellman-group14-sha256</t>
         <t>diffie-hellman-group15-sha512</t>
         <t>diffie-hellman-group16-sha512</t>
         <t>diffie-hellman-group17-sha512</t>
         <t>diffie-hellman-group18-sha512</t>
       </list>

       The SHA-2 family of secure hash algorithms is defined in
       <xref target="RFC6234"/>.
     </t>

     <t>
       The method of key exchange used for the name
       "diffie-hellman-group14-sha256" is the same as that for
       "diffie-hellman-group14-sha1" except that the SHA256 hash
       algorithm is used. It is recommended that
       "diffie-hellman-group14-sha256" SHOULD be supported to smooth
       the transition to newer group sizes.
     </t>

     <t>
       The group15 through group18 names are the same as those
       specified in <xref target="RFC3526"/>: 3072-bit MODP group15,
       4096-bit MODP group16, 6144-bit MODP group17, and 8192-bit MODP
       group18.
     </t>

     <t>
       The SHA512 algorithm is to be used when "sha512" is specified
       as a part of the key exchange method name.
     </t>

   </section>

   <section title="Checking the Peer's DH Public Key" anchor="checking">

     <t>
       Section 8 of <xref target="RFC4253"/> contains a small error in
       point 3. When checking e (client Public Key) and f (server
       Public Key) values, an incorrect range is provided. The
       erroneous text is:

       <list>

         <t>
           Values of 'e' or 'f' that are not in the range [1, p-1]
           MUST NOT be sent or accepted by either side. If this
           condition is violated, the key exchange fails.
         </t>

       </list>

       The problem is that the range should have been an open interval
       excluding the endpoint values. (i.e., "(1, p-1)"). This
       document amends that document text as follows:

       <list>

         <t>
           DH Public Key values MUST be checked and both conditions:

           <list>

             <t>
               1 &lt; e &lt; p-1
             </t>

             <t>
               1 &lt; f &lt; p-1
             </t>

           </list>

           MUST be true. Values not within these bounds MUST NOT be
           sent or accepted by either side. If either one of these
           conditions is violated, then the key exchange fails.
         </t>

       </list>

       This simple check ensures that:

       <list style="symbols">

         <t>
           The remote peer behaves properly.
         </t>

         <t>
           The local system is not forced into the two-element
           subgroup.
         </t>

       </list>

     </t>

   </section>

   <section title="IANA Considerations">

     <t>
       IANA has added the following entries to the "Key Exchange Method Names"
       registry <xref target="IANA-KEX"/>:
     </t>

     <texttable style="headers">
       <ttcol>Method Name</ttcol><ttcol>Reference</ttcol>
       <c>diffie-hellman-group14-sha256</c><c>RFC 8268</c>
       <c>diffie-hellman-group15-sha512</c><c>RFC 8268</c>
       <c>diffie-hellman-group16-sha512</c><c>RFC 8268</c>
       <c>diffie-hellman-group17-sha512</c><c>RFC 8268</c>
       <c>diffie-hellman-group18-sha512</c><c>RFC 8268</c>
     </texttable>

   </section>

   <section title="Security Considerations">

     <t>
       The security considerations of <xref target="RFC4253"/> apply
       to this document.
     </t>

     <t>
       The security considerations of <xref target="RFC3526"/> suggest
       that MODP group14 through group18 have security strengths that
       range between 110 bits of security through 310 bits of
       security. They are based on "Determining Strengths For Public
       Keys Used For Exchanging Symmetric Keys" <xref
       target="RFC3766"/>. Care should be taken to use sufficient
       entropy and/or deterministic random-bit generator (DRBG)
       algorithms to maximize the true security strength of the key
       exchange and ciphers selected.
     </t>

     <t>
       Using a fixed set of Diffie-Hellman parameters makes them a
       high value target for pre-computation.
       Generating additional sets of primes to be used, or moving to
       larger values mitigates this issue.
     </t>
   </section>

 </middle>

 <back>

   <references title="Normative References">

     &rfc2119;
     &rfc3526;
     &rfc4250;
     &rfc4253;
     &rfc6234;
     &rfc8174;

   </references>

   <references title="Informative References">

     <reference
         anchor="IANA-KEX"
         target="http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xhtml#ssh-parameters-16">
       <front>
         <title>Secure Shell (SSH) Protocol Parameters:
         Key Exchange Method Names</title>
         <author>
           <organization>Internet Assigned Numbers Authority (IANA)
           </organization>
         </author>
         <date/>
       </front>
     </reference>

<reference
         anchor="MFQ-U-OO-815099-15"
         target="https://www.iad.gov/iad/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/assets/public/upload/CNSA-Suite-and-Quantum-Computing-FAQ.pdf">
       <front>
         <title>Commerical National Security Algorithm Suite and Quantum Computing FAQ</title>
         <author fullname="NSA/CSS">
           <organization abbrev="NSA/CSS">National Security Agency / Central Security Service</organization>
         </author>
         <date month="January" year="2016"/>
       </front>
      <seriesInfo name="MFQ U/OO/815099-15" value="" />
     </reference>

     <reference
         anchor="NIST-SP-800-131Ar1"
         target="http://dx.doi.org/10.6028/NIST.SP.800-131Ar1">
       <front>
         <title>Transitions: Recommendation for the Transitioning of
         the Use of Cryptographic Algorithms and Key Lengths</title>
         <author surname="Barker" fullname="Elaine Barker"/>
         <author surname="Roginsky" fullname="Allen Roginsky"/>
         <date month="November" year="2015"/>
       </front>
       <seriesInfo
           name="NIST Special Publication" value="800-131A"/>
        <seriesInfo name="Revision" value="1"/>
        <seriesInfo name="DOI" value="10.6028/NIST.SP.800-131Ar1"/>
     </reference>

     &rfc3766;
     &rfc4344;
     &rfc5656;
     &rfc6187;
     &rfc6194;

   </references>

   <section title="Acknowledgements" numbered="no">

     <t>
       Thanks to the following people for review and comments: Denis
       Bider, Peter Gutmann, Damien Miller, Niels Moller, Matt
       Johnston, Iwamoto Kouichi, Dave Dugal, Daniel Migault, Anna
       Johnston, Ron Frederick, Rich Salz, Travis Finkenauer, and Eric
       Rescorla.
     </t>

   </section>

 </back>
</rfc>
