Network Working Group | J. Levine |
Internet-Draft | Taughannock Networks |
Intended status: Standards Track | March 29, 2017 |
Expires: September 30, 2017 |
Cryptographic Update to DKIM
draft-levine-dcrup-dkim-crypto-00
DKIM was designed to allow new cryptographic algorithms to be added. This document adds a new algorithm and a new way to represent signature validation keys.
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 September 30, 2017.
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.
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 1024 bits don't fit in 256 octets.
This document adds a new signing algorithm, Elliptic Curve Diffie-Hellman (ECDH), 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.
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].
Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. The ABNF tokens sig-a-tag-k, key-k-tag-type, and base64tring are imported from [RFC6376].
The ecdh-sha256 signing algorithm computes a message hash as defined in section 3 of [RFC6376], and signs it using the ECDH algorithm defined in [RFC7748]. The DNS record for the verification public key MUST have a "k=ecdh" or "k=ecdhfp" tag to indicate that the key is an ECDH rather than RSA key.
ECDH signatures MUST NOT use SHA-1 hashes.
ABNF: sig-a-tag-k = "rsa" / "rsafp" / "ecdh" / "ecdhfp" x-sig-a-tag-k
The syntax of DKIM signature tags is updated as follows:
ABNF: key-k-tag-type = "rsa" / "rsafp" / "ecdh" / "ecdhfp" / x-key-k-tag-type
The syntax of DKIM key tags is updated as follows:
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 ECDH signature the Signing Algorithm is ecdhfp-sha256. The corresponding public key is included in the signature as a k= tag.
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=ecdhfp.
ABNF: sig-k-tag = %x6b [FWS] "=" [FWS] sig-k-tag-data sig-k-tag-data = base64string
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.
ECDH 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.
IANA is requested to update registries as follows.
The following value is added to the DKIM Signature Tag Registry
TYPE | REFERENCE | STATUS |
---|---|---|
k | (this document) | active |
The following values is added to the DKIM Key Type Registry
TYPE | REFERENCE | STATUS |
---|---|---|
rsafp | [RFC3447] | active |
ecdh | [RFC7748] | active |
ecdhfp | [RFC7748] | active |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[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. |
[RFC6376] | Crocker, D., Hansen, T. and M. Kucherawy, "DomainKeys Identified Mail (DKIM) Signatures", STD 76, RFC 6376, DOI 10.17487/RFC6376, September 2011. |
[RFC7748] | Langley, A., Hamburg, M. and S. Turner, "Elliptic Curves for Security", RFC 7748, DOI 10.17487/RFC7748, January 2016. |