Network Working Group J. Levine
Internet-Draft Taughannock Networks
Updates: 6376 (if approved) June 20, 2017
Intended status: Standards Track
Expires: December 22, 2017
Cryptographic Update to DKIM
draft-ietf-dcrup-dkim-crypto-02
Abstract
DKIM was designed to allow new cryptographic algorithms to be added.
This document adds a new signing algorithm and a new way to represent
signature validation keys, and deprecates an obsolete signing
algorithm.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 22, 2017.
Copyright Notice
Copyright (c) 2017 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
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Levine Expires December 22, 2017 [Page 1]
Internet-Draft DKIM Crypto Update June 2017
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Conventions Used in This Document . . . . . . . . . . . . . . 2
3. EdDSA-SHA256 Signing Algorithm . . . . . . . . . . . . . . . 3
4. Public key fingerprints . . . . . . . . . . . . . . . . . . . 3
5. Key and algorithm choice and strength . . . . . . . . . . . . 4
6. Transition Considerations . . . . . . . . . . . . . . . . . . 4
7. Security Considerations . . . . . . . . . . . . . . . . . . . 5
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
8.1. DKIM Signature Tag Registry . . . . . . . . . . . . . . . 5
8.2. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 5
8.3. DKIM Key Type registry . . . . . . . . . . . . . . . . . 5
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 6
9.1. Normative References . . . . . . . . . . . . . . . . . . 6
9.2. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 6
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction
Discussion Venue: Discussion about this draft is directed to the
dcrup@ietf.org [1] mailing list.
DKIM [RFC6376] signs e-mail 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.
The defining documents specify a single signing algorithm, RSA
[RFC3447], and recommends key sizes of 1024 to 2048 bits. 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 longer than 1156 bits don't fit in 256 octets.
This document adds a new signing algorithm, Edwards-Curve Digital
Signature Algorithm (EdDSA), which has much shorter keys than RSA for
similar levels of security. It also adds a new key representation,
with the key itself in the signature and a shorter key fingerprint in
the DNS.
2. Conventions Used in This Document
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC2119].
Levine Expires December 22, 2017 [Page 2]
Internet-Draft DKIM Crypto Update June 2017
Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. The ABNF
tokens sig-a-tag-k, key-k-tag-type, and base64string are imported
from [RFC6376].
3. EdDSA-SHA256 Signing Algorithm
The eddsa-sha256 signing algorithm computes a message hash as defined
in section 3 of [RFC6376], and signs it with Ed25519, the EdDSA
algorithm using the edwards25519 curve, as defined in in RFC 8032
section 5.1 [RFC8032]. The signing algorithm is PureEdDSA as defined
in RFC 8032 section 4, since the input to the signing algorithm has
already been hashed. The DNS record for the verification public key
MUST have a "k=eddsa" or "k=eddsafp" tag to indicate that the key is
an EdDSA rather than RSA key.
The syntax of DKIM signature tags is updated as follows, where this
rule replaces the existing rule for sig-a-tag-k:
ABNF:
sig-a-tag-k = "rsa" / "rsafp" / "eddsa" / "eddsafp"
/ x-sig-a-tag-k
The syntax of DKIM key tags is updated as follows, where this rule
replaces the existing rule for key-k-tag-type:
ABNF:
key-k-tag-type = "rsa" / "rsafp" / "eddsa" / "eddsafp"
/ x-key-k-tag-type
4. Public key fingerprints
Rather than using a public key stored in the DNS, a signature MAY
include the corresponding public key, with a fingerprint in the DNS.
For an RSA signature, the Signing Algorithm is rsafp-sha256, or for
an EdDSA signature the Signing Algorithm is eddsafp-sha256. The DNS
record contains a SHA-256 hash of the public key, stored in base64 in
the p= tag. The key type tag MUST be present and contains k=rsafp or
k=eddsafp.
k= The public key (base64; REQUIRED). White space is ignored in
this value and MUST be ignored when reassembling the original
key.
Levine Expires December 22, 2017 [Page 3]
Internet-Draft DKIM Crypto Update June 2017
ABNF:
sig-k-tag = %x6b [FWS] "=" [FWS] sig-k-tag-data
sig-k-tag-data = base64string
Section 5.5 of [RFC6376], on computing the message hash and
signature, is modified as follows: When creating a signature with a
signing algorithm that uses a key fingerprint, the signer includes
the public key in the signature as a base64 encoded string with a k=
tag. The key in the tag is the same one that would be published in a
non-fingerprint key record.
Section 3.7 of [RFC6376], on computing the message hashes, is not
modified. Since the key in the k= tag is known in advance, it
included in the signature in the same manner as all of the other
signature fields other than b=.
Section 6.1.3 of [RFC6376], to compute the verification, is modified
as follows: In item 4, if the signing algorithm uses a key
fingerprint, extract the verification key from the k= tag. If there
is no such tag, the signature does not validate. Extract the key
hash from the p= tag of the key record. If there is no such tag or
the tag is empty, the signature does not validate. Compute the
SHA-256 hash of the verification key, and compare it to the value of
the key hash. If they are not the same, the signature does not
validate. Otherwise proceed to verify the signature using the
validation key and the algorithm described in the "a=" tag.
5. Key and algorithm choice and strength
Section 3.3 of [RFC6376] describes DKIM's hash and signature
algorithms. It is updated as follows:
Signers MUST NOT implement and verifiers SHOULD NOT implement the
rsa-sha1 algorithm. Signers SHOULD implement and verifiers MUST
implement the rsafp-256, eddsa-sha256, and eddsafp-sha256 algorithms.
Signers that use rsa-sha256 signatures MUST use keys at least 1024
bits long and SHOULD use keys 2048 bits long. Verifiers MUST NOT
accept rsa-sha256 signatures with keys less than 1024 bits long.
6. Transition Considerations
For backward compatibility, signers MAY add multiple signatures that
use old and new signing algorithms or key representations. Since
there can only be a single key record in the DNS for each selector,
the signatures will have to use different selectors, although they
can use the same d= and i= identifiers.
Levine Expires December 22, 2017 [Page 4]
Internet-Draft DKIM Crypto Update June 2017
7. Security Considerations
EdDSA and key fingerprints are widely used cryptographic techniques,
so the security of DKIM signatures using new signing algorithms
should be at least as good as those using old algorithms. Since key
fingerprints make it possible to publish verification records for RSA
keys of any length, rsafp signatures SHOULD use key lengths of 1536
or 2048 bits.
8. IANA Considerations
IANA is requested to update registries as follows.
8.1. DKIM Signature Tag Registry
The following value is added to the DKIM Signature Tag Registry
+------+-----------------+--------+
| TYPE | REFERENCE | STATUS |
+------+-----------------+--------+
| k | (this document) | active |
+------+-----------------+--------+
Table 1: DKIM Signature Tag Registry Added Value
8.2. DKIM Hash Algorithms Registry
The following value is updated in the DKIM Hash Algorithms Registry
+------+-------------------+----------+
| TYPE | REFERENCE | STATUS |
+------+-------------------+----------+
| sha1 | [FIPS-180-3-2008] | historic |
+------+-------------------+----------+
Table 2: DKIM Hash Algorithms Registry Updated Value
8.3. DKIM Key Type registry
The following values are added to the DKIM Key Type Registry
Levine Expires December 22, 2017 [Page 5]
Internet-Draft DKIM Crypto Update June 2017
+---------+-----------+--------+
| TYPE | REFERENCE | STATUS |
+---------+-----------+--------+
| rsafp | [RFC3447] | active |
| eddsa | [RFC8032] | active |
| eddsafp | [RFC8032] | active |
+---------+-----------+--------+
Table 3: DKIM Key Type Registry Added Values
9. References
9.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
Standards (PKCS) #1: RSA Cryptography Specifications
Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February
2003, <http://www.rfc-editor.org/info/rfc3447>.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC5234, January 2008,
<http://www.rfc-editor.org/info/rfc5234>.
[RFC6376] Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed.,
"DomainKeys Identified Mail (DKIM) Signatures", STD 76,
RFC 6376, DOI 10.17487/RFC6376, September 2011,
<http://www.rfc-editor.org/info/rfc6376>.
[RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital
Signature Algorithm (EdDSA)", RFC 8032,
DOI 10.17487/RFC8032, January 2017,
<http://www.rfc-editor.org/info/rfc8032>.
9.2. URIs
[1] mailto:dcrup@ietf.org
Appendix A. Change log
01 to 02: Clarify EdDSA algorithm is ed25519 with Pure version of
the signing. Make references to tags and fields consistent.
Levine Expires December 22, 2017 [Page 6]
Internet-Draft DKIM Crypto Update June 2017
Author's Address
John Levine
Taughannock Networks
PO Box 727
Trumansburg, NY 14886
Phone: +1 831 480 2300
Email: standards@taugh.com
Levine Expires December 22, 2017 [Page 7]