idnits 2.17.1 draft-ietf-dcrup-dkim-crypto-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document updates RFC6376, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (July 27, 2017) is 2455 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 312 ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 8032 Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Levine 3 Internet-Draft Taughannock Networks 4 Updates: 6376 (if approved) July 27, 2017 5 Intended status: Standards Track 6 Expires: January 28, 2018 8 New cryptographic signature methods for DKIM 9 draft-ietf-dcrup-dkim-crypto-04 11 Abstract 13 DKIM was designed to allow new cryptographic algorithms to be added. 14 This document adds a new signing algorithm and a new way to represent 15 signature validation keys, and deprecates an obsolete signing 16 algorithm. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on January 28, 2018. 35 Copyright Notice 37 Copyright (c) 2017 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 53 2. Conventions Used in This Document . . . . . . . . . . . . . . 3 54 3. Public key fingerprints . . . . . . . . . . . . . . . . . . . 3 55 4. Ed25519-SHA256 Signing Algorithm . . . . . . . . . . . . . . 4 56 5. Signature and key syntax . . . . . . . . . . . . . . . . . . 4 57 5.1. Signature syntax . . . . . . . . . . . . . . . . . . . . 4 58 5.2. Key syntax . . . . . . . . . . . . . . . . . . . . . . . 4 59 6. Key and algorithm choice and strength . . . . . . . . . . . . 5 60 7. Transition Considerations . . . . . . . . . . . . . . . . . . 5 61 8. Security Considerations . . . . . . . . . . . . . . . . . . . 5 62 8.1. Duplicate Signature Key Selection . . . . . . . . . . . . 5 63 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 64 9.1. DKIM Signature Tag Registry . . . . . . . . . . . . . . . 6 65 9.2. DKIM Key Type registry . . . . . . . . . . . . . . . . . 6 66 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 67 10.1. Normative References . . . . . . . . . . . . . . . . . . 6 68 10.2. Informative References . . . . . . . . . . . . . . . . . 7 69 10.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 7 70 Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 7 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 73 1. Introduction 75 Discussion Venue: Discussion about this draft is directed to the 76 dcrup@ietf.org [1] mailing list. 78 DKIM [RFC6376] signs e-mail messages, by creating hashes of the 79 message headers and content and signing the header hash with a 80 digital signature. Message recipients fetch the signature 81 verification key from the DNS where it is stored in a TXT record. 82 The defining documents specify a single signing algorithm, RSA 83 [RFC3447], and recommends key sizes of 1024 to 2048 bits. While 1024 84 bit signatures are common, stronger signatures are not. Widely used 85 DNS configuration software places a practical limit on key sizes, 86 because the software only handles a single 256 octet string in a TXT 87 record, and RSA keys longer than 1156 bits don't fit in 256 octets. 89 This document adds a new stronger signing algorithm, Edwards-Curve 90 Digital Signature Algorithm using the Curve25519 curve (ed25519), 91 which has much shorter keys than RSA for similar levels of security. 92 It also adds a new key representation for RSA keys, with the key 93 itself in the signature and a key fingerprint that fits in a a 256 94 octet string in the DNS regardless of the key length. 96 2. Conventions Used in This Document 98 The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", 99 "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 100 "OPTIONAL" in this document are to be interpreted as described in 101 [RFC2119]. 103 Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. The ABNF 104 tokens sig-a-tag-k, key-k-tag-type, and base64string are imported 105 from [RFC6376]. 107 3. Public key fingerprints 109 Rather than using a public key stored in the DNS, an RSA signature 110 can include the corresponding public key, with a verification 111 fingerprint in the DNS. For an RSA signature with a key fingerprint, 112 the Signing Algorithm is rsafp-sha256. The DNS record contains a 113 SHA-256 hash of the public key, stored in base64 in the p= tag. The 114 key type tag MUST be present and contains k=rsafp. 116 Note: since Ed25519 keys are 256 bits long, a SHA-256 hash of a key 117 is the same size as the key itself, so there would be no benefit to 118 storing ed25519 key fingerprints in the key record rather than the 119 keys themselves. 121 Section 5.5 of [RFC6376], on computing the message hash and 122 signature, is modified as follows: When creating a signature with a 123 signing algorithm that uses a key fingerprint, the signer includes 124 the public key in the signature as a base64 encoded string with a k= 125 tag. The key in the tag is the same one that would be published in a 126 non-fingerprint key record. 128 Section 3.7 of [RFC6376], on computing the message hashes, is not 129 modified. Since the key in the k= tag is known in advance, it 130 included in the signature in the same manner as all of the other 131 signature fields other than b=. 133 Section 6.1.3 of [RFC6376], to compute the verification, is modified 134 as follows: In item 4, if the signing algorithm uses a key 135 fingerprint, extract the verification key from the k= tag. If there 136 is no such tag, the signature does not validate. Extract the key 137 hash from the p= tag of the key record. If there is no such tag or 138 the tag is empty, the signature does not validate. Compute the 139 SHA-256 hash of the verification key, and compare it to the value of 140 the key hash. If they are not the same, the signature does not 141 validate. Otherwise proceed to verify the signature using the 142 validation key and the algorithm described in the "a=" tag. 144 4. Ed25519-SHA256 Signing Algorithm 146 The ed25519-sha256 signing algorithm computes a message hash as 147 defined in section 3 of [RFC6376], and signs it with the Pure variant 148 of Ed25519, as defined in in RFC 8032 section 5.1 [RFC8032]. The 149 signing algorithm is PureEdDSA, since the input to the signing 150 algorithm has already been hashed. The DNS record for the 151 verification public key MUST have a "k=ed25519" tag to indicate that 152 the key is an Ed25519 rather than RSA key. 154 The signature MAY contain a base64 copy of the public key in the p= 155 tag, to enable checks for a cryptograhphic attack described in the 156 Security section below. 158 5. Signature and key syntax 160 The syntax of DKIM signatures and DKIM keys are updated as follows. 162 5.1. Signature syntax 164 The syntax of DKIM algorithm tags in section 3.5 of [RFC6376] is 165 updated by adding this rule to the existing rule for sig-a-tag-k: 167 ABNF: 169 sig-a-tag-k =/ "rsafp" / "ed25519" 171 The following tag is added to the list of tags on the DKIM-Signature 172 header field in section 3.5 of [RFC6376]. 174 k= The public key (base64; REQUIRED). White space is ignored in 175 this value and MUST be ignored when reassembling the original 176 key. 178 ABNF: 180 sig-k-tag = %x6b [FWS] "=" [FWS] sig-k-tag-data 181 sig-k-tag-data = base64string 183 5.2. Key syntax 185 The syntax of DKIM key tags in section 3.6.1 of [RFC6376] is updated 186 by adding this rule to the existing rule for key-k-tag-type: 188 ABNF: 190 key-k-tag-type =/ "rsafp" / "ed25519" 192 6. Key and algorithm choice and strength 194 Section 3.3 of [RFC6376] describes DKIM's hash and signature 195 algorithms. It is updated as follows: 197 Signers SHOULD implement and verifiers MUST implement the rsafp- 198 sha256 and ed25519-sha256 algorithms. 200 Signers that use rsa-sha256 or rsafp-sha256 signatures MUST use keys 201 at least 1024 bits long and SHOULD use keys 2048 bits long. 202 Verifiers SHOULD NOT accept rsa-sha256 or rsafp-sha256 signatures 203 with keys less than 1024 bits long. 205 7. Transition Considerations 207 For backward compatibility, signers MAY add multiple signatures that 208 use old and new signing algorithms or key representations. Since 209 there can only be a single key record in the DNS for each selector, 210 the signatures will have to use different selectors, although they 211 can use the same d= and i= identifiers. 213 8. Security Considerations 215 Ed25519 and key fingerprints are widely used cryptographic 216 techniques, so the security of DKIM signatures using new signing 217 algorithms should be at least as good as those using old algorithms. 218 Since key fingerprints make it possible to publish verification 219 records for RSA keys of any length, rsafp signatures SHOULD use key 220 lengths of 1536 or 2048 bits. 222 8.1. Duplicate Signature Key Selection 224 The rsafp signature scheme describes a method where the public key is 225 hashed. The primary motivation for this design is allowing for a 226 smaller key representation of larger public keys. Hashing has a 227 secondary effect: the public key is included in messages and is 228 signed. Including and signing the public key renders duplicate 229 signature key selection attacks [Koblitz13] infeasible. An attacker 230 cannot claim a message by constructing a key that would be valid for 231 a signed message because the public key is covered by the signature. 233 There is currently no known way that an attacker might use a 234 duplicate signature key selection attack to their advantage and so 235 defending against the attack is not mandated by this specification. 236 In the event that a potential attack becomes known, a signer could 237 include the public key in messages using the `p=` parameter. If the 238 `p=` parameter is present, a verifier MUST ensure that the parameter 239 contains the public key that it uses to verify the message signature. 241 9. IANA Considerations 243 IANA is requested to update registries as follows. 245 9.1. DKIM Signature Tag Registry 247 The following value is added to the DKIM Signature Tag Registry 249 +------+-----------------+--------+ 250 | TYPE | REFERENCE | STATUS | 251 +------+-----------------+--------+ 252 | k | (this document) | active | 253 +------+-----------------+--------+ 255 Table 1: DKIM Signature Tag Registry Added Value 257 9.2. DKIM Key Type registry 259 The following values are added to the DKIM Key Type Registry 261 +---------+-----------+--------+ 262 | TYPE | REFERENCE | STATUS | 263 +---------+-----------+--------+ 264 | rsafp | [RFC3447] | active | 265 | ed25519 | [RFC8032] | active | 266 +---------+-----------+--------+ 268 Table 2: DKIM Key Type Registry Added Values 270 10. References 272 10.1. Normative References 274 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 275 Requirement Levels", BCP 14, RFC 2119, 276 DOI 10.17487/RFC2119, March 1997, 277 . 279 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 280 Standards (PKCS) #1: RSA Cryptography Specifications 281 Version 2.1", RFC 3447, DOI 10.17487/RFC3447, February 282 2003, . 284 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 285 Specifications: ABNF", STD 68, RFC 5234, 286 DOI 10.17487/RFC5234, January 2008, 287 . 289 [RFC6376] Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed., 290 "DomainKeys Identified Mail (DKIM) Signatures", STD 76, 291 RFC 6376, DOI 10.17487/RFC6376, September 2011, 292 . 294 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital 295 Signature Algorithm (EdDSA)", RFC 8032, 296 DOI 10.17487/RFC8032, January 2017, 297 . 299 10.2. Informative References 301 [Koblitz13] 302 Koblitz, N. and A. Menezes, "Another look at security 303 definitions", DOI 10.3934/amc.2013.7.1, 2013, 304 . 307 Advances in Mathematics of Communications, Vol 7, Num 1, 308 pp. 1-38. 310 10.3. URIs 312 [1] mailto:dcrup@ietf.org 314 Appendix A. Change log 316 03 to 04: Change eddsa to ed25519. Add Martin's key regeneration 317 issue. Remove hashed ed25519 keys. Fix typos and clarify text. 318 Move syntax updates to separate section. Take out SHA-1 stuff. 320 01 to 02: Clarify EdDSA algorithm is ed25519 with Pure version of 321 the signing. Make references to tags and fields consistent. 323 Author's Address 325 John Levine 326 Taughannock Networks 327 PO Box 727 328 Trumansburg, NY 14886 330 Phone: +1 831 480 2300 331 Email: standards@taugh.com