<?xml version="1.0" encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc number="8301" 
     category="std" 
     submissionType="IETF"
     consensus="yes"
     ipr="trust200902" 
     updates="6376">

 <front>
   <title abbrev="DKIM Crypto Usage Update">Cryptographic Algorithm and Key
   Usage Update to DomainKeys&nbsp;Identified&nbsp;Mail&nbsp;(DKIM)</title>

   <author initials="S." surname="Kitterman"
	   fullname="Scott Kitterman">
      <organization>Kitterman Technical Services</organization>

      <address>
	 <postal>
	    <street>3611 Scheel Dr</street>
	    <city>Ellicott City</city>
	    <region>MD</region>
	    <code>21042</code>
	    <country>United States of America</country>
	 </postal>
	    
	 <phone>+1 301 325-5475</phone>
	 <email>scott@kitterman.com</email>
      </address>
   </author>

   <date month="January" year="2018" />

   <keyword>email authentication</keyword>

   <abstract>
     <t>The cryptographic algorithm and key size requirements included when
     DomainKeys Identified Mail (DKIM) was designed a decade ago are
     functionally obsolete and in need of immediate revision.  This document
     updates DKIM requirements to those minimally suitable for operation with
     currently specified algorithms.</t>
   </abstract>
 </front>

 <middle>
   <section anchor="intro" title="Introduction">
     <t><xref target="RFC6376">DKIM</xref> signs
     email messages by creating hashes of the message
	headers and content and signing the header hash with a digital signature.
	Message recipients fetch the signature verification key from the DNS where it is
	stored in a TXT record.</t>

     <t>
	The defining documents, <xref target="RFC6376">RFC 6376</xref> and its
        predecessors, specify a single signing algorithm, <xref target="RFC8017">RSA</xref>,
	and recommend key sizes of 1024 to 2048 bits (but require verification of 512-bit keys).
        As discussed in <xref target="VULNOTE">US-CERT Vulnerability Note VU#268267</xref>, the operational
        community has recognized that shorter keys compromise the effectiveness of DKIM.
	While 1024-bit signatures are common, stronger signatures are not.  Widely used DNS
        configuration software places a practical limit on key sizes, because the software only
        handles a single 256-octet string in a TXT record, and RSA keys significantly longer
        than 1024 bits don't fit in 256 octets.</t>

      <t>
        Due to the recognized weakness of the SHA-1 hash algorithm (see <xref target="RFC6194"/>)
        and the wide availability of the SHA-256 hash algorithm (it has been a required part
        of <xref target="RFC6376">DKIM</xref> since it was originally standardized in 2007), the
        SHA-1 hash algorithm MUST NOT be used.  This is being done now to allow the
        operational community time to fully shift to SHA-256 in advance of any
        SHA-1-related crisis.</t>

   </section>
   
   <section title="Conventions Used in This Document">
     <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="Updates to DKIM Signing and Verification Requirements">

     <t>This document updates <xref target="RFC6376"/> as follows:</t>

     <t><list style="symbols">
         <t><xref target="dkim-signing-verification-alg"/> of this document updates 
         Section 3.3 of <xref target="RFC6376"/>.</t>

         <t><xref target="key-sizes"/> of this document updates Section 3.3.3 of <xref target="RFC6376"/>.</t>

         <t>The algorithm described in Section 3.3.1 of <xref target="RFC6376"/> is
         now historic and no longer used by DKIM.</t>
     </list></t>

     <t>Sections 3.3.2 and 3.3.4 of <xref target="RFC6376"/> are not
     affected.</t>
  
   <section title="Signing and Verification Algorithms" anchor="dkim-signing-verification-alg">
   
     <t>DKIM supports multiple digital signature algorithms.  Two algorithms
     are defined by this specification at this time: rsa-sha1 and rsa-
     sha256.  Signers MUST sign using rsa-sha256.  Verifiers MUST be able to
     verify using rsa-sha256.  rsa-sha1 MUST NOT be used for signing or
     verifying.</t>

     <t>DKIM signatures identified as having been signed with historic
     algorithms (currently, rsa-sha1) have permanently failed evaluation as
     discussed in Section 3.9 of <xref target="RFC6376"/>.</t>
   </section>

   <section title="Key Sizes" anchor="key-sizes">

     <t>Selecting appropriate key sizes is a trade-off between cost,
     performance, and risk.  Since short RSA keys more easily succumb to
     off-line attacks, Signers MUST use RSA keys of at least 1024 bits for
     all keys.  Signers SHOULD use RSA keys of at least 2048 bits.  Verifiers
     MUST be able to validate signatures with keys ranging from 1024 bits to
     4096 bits, and they MAY be able to validate signatures with larger keys.
     Verifier policies can use the length of the signing key as one metric for
     determining whether a signature is acceptable.  Verifiers MUST NOT
     consider signatures using RSA keys of less than 1024 bits as valid
     signatures.</t>

     <t>DKIM signatures with insufficient key sizes (currently, rsa-sha256 with
     less than 1024 bits) have permanently failed evaluation as discussed in
     Section 3.9 of <xref target="RFC6376"/>.</t>

   </section>

   </section>

   <section title="Security Considerations">
      <t> This document does not change the Security Considerations of
      <xref target="RFC6376"/>.  It reduces the risk of signature compromise
      due to weak cryptography.  The SHA-1 risks discussed in
      Section 3 of <xref target="RFC6194"/> are resolved due to rsa-sha1 no
      longer being used by DKIM.</t>
   </section>

   <section title="IANA Considerations">

     <t>IANA has updated the Reference and Status fields of the "sha1"
     registration in the "DKIM Hash Algorithms" registry. The registration now
     appears as follows:</t>


      <texttable>
        <ttcol align="center">Type</ttcol>
        <ttcol align="left">Reference</ttcol>
        <ttcol align="left">Status</ttcol>

        <c>sha1</c>
        <c><xref target="RFC6376"/> [RFC8301]</c>
        <c>historic</c>
      </texttable>
   </section>
 </middle>

 <back>
   <references title="Normative References">
      <?rfc include="reference.RFC.2119" ?>
      <?rfc include="reference.RFC.6376" ?>
      <?rfc include="reference.RFC.8017" ?>
      <?rfc include="reference.RFC.8174"?>
   </references>

   <references title="Informative References">

      <reference anchor="VULNOTE" target="http://www.kb.cert.org/vuls/id/268267">
         <front>
            <title>Vulnerability Note VU#268267: DomainKeys Identified Mail (DKIM) Verifiers may inappropriately convey message trust</title>
            <author>
               <organization>US-CERT</organization>
            </author>
            <date month="October" year="2012" />
         </front>
      </reference>

      <?rfc include="reference.RFC.6194" ?>

   </references>
   <section anchor="thanks" title="Acknowledgements" numbered="no">
      <t> The author wishes to acknowledge the following individuals for their
      review and comments on this proposal:
      Kurt Andersen, Murray S.&nbsp;Kucherawy, Martin Thomson, John Levine,
      Russ Housley, and Jim Fenton. </t>
      <t> Thanks to John Levine for his DKIM Crypto Update (DCRUP) work that
      was the source for
      much of the introductory material in this document. </t>
    </section>
 </back>
</rfc>
