idnits 2.17.1 draft-ietf-curdle-cms-eddsa-signatures-01.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 document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The "Author's Address" (or "Authors' Addresses") section title is misspelled. -- The document date (19 November 2016) is 2714 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) == Missing Reference: 'RFC5652' is mentioned on line 207, but not defined ** Downref: Normative reference to an Informational draft: draft-irtf-cfrg-eddsa (ref. 'EDDSA') -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS202' == Outdated reference: A later version (-10) exists of draft-ietf-curdle-pkix-02 ** Obsolete normative reference: RFC 4634 (Obsoleted by RFC 6234) -- Possible downref: Non-RFC (?) normative reference: ref. 'X680' -- Possible downref: Non-RFC (?) normative reference: ref. 'X690' Summary: 3 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet-Draft R. Housley 3 Intended status: Standards Track Vigil Security 4 Expires: 19 May 2017 19 November 2016 6 Use of EdDSA Signatures in the Cryptographic Message Syntax (CMS) 7 9 Abstract 11 This document specifies the conventions for using Edwards-curve 12 Digital Signature Algorithm (EdDSA) for Curve25519 and Curve448 in 13 the Cryptographic Message Syntax (CMS). For each curve, EdDSA 14 defines the PureEdDSA and HashEdDSA modes. However, the HashEdDSA 15 mode is not used with the CMS. In addition, no context string is 16 used with the CMS. 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 19 May 2017. 35 Copyright Notice 37 Copyright (c) 2016 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 1. Introduction 52 This document specifies the conventions for using the Edwards-curve 53 Digital Signature Algorithm (EdDSA) [EDDSA] for Curve25519 and 54 Curve448 with the Cryptographic Message Syntax [CMS] signed-data 55 content type. For each curve, [EDDSA] defines the PureEdDSA and 56 HashEdDSA modes. However, the HashEdDSA mode is not used with the 57 CMS. In addition, no context string is used with CMS. EdDSA with 58 Curve25519 is referred to as Ed25519, and EdDSA with Curve448 is 59 referred to as Ed448. The CMS conventions for PureEdDSA with Ed25519 60 and Ed448 are described in this document. 62 1.1. Terminology 64 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 65 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 66 document are to be interpreted as described in RFC 2119 [STDWORDS]. 68 1.2. ASN.1 70 CMS values are generated using ASN.1 [X680], which uses the Basic 71 Encoding Rules (BER) and the Distinguished Encoding Rules (DER) 72 [X690]. 74 2. EdDSA Signature Algorithm 76 The Edwards-curve Digital Signature Algorithm (EdDSA) [EDDSA] is a 77 variant of Schnorr's signature system with (possibly twisted) Edwards 78 curves. Ed25519 is intended to operate at around the 128-bit 79 security level, and Ed448 at around the 224-bit security level. 81 One of the parameters of the EdDSA algorithm is the "prehash" 82 function. This may be the identity function, resulting in an 83 algorithm called PureEdDSA, or a collision-resistant hash function, 84 resulting in an algorithm called HashEdDSA. In most situations the 85 CMS SignedData includes signed attributes, including the message 86 digest of the content. Since HashEdDSA offers no benefit when signed 87 attributes are present, only PureEdDSA is used with the CMS. 89 2.1. Algorithm Identifiers 91 Each algorithms are identified by an object identifier, and the 92 algorithm identifier may contain parameters if needed. 94 The ALGORITHM definition is repeated here for convenience: 96 ALGORITHM ::= CLASS { 97 &id OBJECT IDENTIFIER UNIQUE, 98 &Type OPTIONAL } 99 WITH SYNTAX { 100 OID &id [PARMS &Type] } 102 2.2. EdDSA Algorithm Identifiers 104 The EdDSA signature algorithm is defined in [EDDSA], and the 105 conventions for encoding the public key are defined in 106 [ID.curdle-pkix]. 108 The id-Ed25519 and id-Ed448 object identifiers are used to identify 109 EdDSA public keys in certificates. The object identifiers are 110 specified in [ID.curdle-pkix], and they are repeated here for 111 convenience: 113 sigAlg-Ed25519 ALGORITHM ::= { OID id-Ed25519 } 115 sigAlg-Ed448 ALGORITHM ::= { OID id-Ed448 } 117 id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 } 119 id-Ed448 OBJECT IDENTIFIER ::= { 1 3 101 113 } 121 2.3. Message Digest Algorithm Identifiers 123 When the signer includes signed attributes, a message digest 124 algorithm is used to compute the message digest on the eContent 125 value. When signing with Ed25519, the message digest algorithm MUST 126 be SHA-512 [RFC4634]. When signing with Ed448, the message digest 127 algorithm MUST be SHAKE256 [FIPS202] with a 512-bit output value. 129 Signing with Ed25519 uses SHA-512 as part of the signing operation, 130 and signing with Ed448 uses SHAKE256 as part of the signing 131 operation. 133 For convenience, the object identifiers and parameter syntax for 134 these algorithms are repeated here: 136 hashAlg-SHA-512 ALGORITHM ::= { OID id-sha512 } 138 hashAlg-SHAKE256 ALGORITHM ::= { OID id-shake256 } 140 hashAlg-SHAKE256-LEN ALGORITHM ::= { OID id-shake256-len 141 PARMS SHAKE256OutputLen } 143 hashalgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 144 country(16) us(840) organization(1) 145 gov(101) csor(3) nistalgorithm(4) 2 } 147 id-sha512 OBJECT IDENTIFIER ::= { hashAlgs 3 } 149 id-shake256 OBJECT IDENTIFIER ::= { hashAlgs 12 } 151 id-shake256-len OBJECT IDENTIFIER ::= { TBD } 153 SHAKE256OutputLen ::= INTEGER -- Output length in bits 155 {{{ NOTE: NIST will assign the missing object identifier soon. }}} 157 When using the id-sha512 or id-shake256 algorithm identifier, the 158 parameters MUST be absent. 160 When using the id-shake256-len algorithm identifier, the parameters 161 MUST be present, and the parameter MUST contain 512, encoded as a 162 positive integer value. 164 2.4. EdDSA Signatures 166 The id-Ed25519 and id-Ed448 object identifiers are also used for 167 signature values. When used to identify signature algorithms, the 168 AlgorithmIdentifier parameters field MUST be absent. 170 The data to be signed is processed using PureEdDSA, and then a 171 private key operation generates the signature value. As described in 172 Section 3.3 of [EDDSA], the signature value is the opaque value 173 ENC(R) || ENC(S). As described in Section 5.3 of [CMS], the 174 signature value is ASN.1 encoded as an OCTET STRING and included in 175 the signature field of SignerInfo. 177 3. Signed-data Conventions 179 The processing depends on whether the signer includes signed 180 attributes. 182 The inclusion of signed attributes is preferred, but the conventions 183 for signed-data without signed attributes are provided for 184 completeness. 186 3.1. Signed-data Conventions With Signed Attributes 188 The SignedData digestAlgorithms field includes the identifiers of the 189 message digest algorithms used by one or more signer. There MAY be 190 any number of elements in the collection, including zero. When 191 signing with Ed25519, the digestAlgorithm SHOULD include id-sha512, 192 and if present, the algorithm parameters field MUST be absent. When 193 signing with Ed448, the digestAlgorithm SHOULD include 194 id-shake256-len, and if present, the algorithm parameters field MUST 195 also be present, and the parameter MUST contain 512, encoded as a 196 positive integer value. 198 The SignerInfo digestAlgorithm field includes the identifier of the 199 message digest algorithms used by the signer. When signing with 200 Ed25519, the digestAlgorithm MUST be id-sha512, and the algorithm 201 parameters field MUST be absent. When signing with Ed448, the 202 digestAlgorithm MUST be id-shake256-len, the algorithm parameters 203 field MUST be present, and the parameter MUST contain 512, encoded as 204 a positive integer value. 206 The SignerInfo signedAttributes MUST include the message-digest 207 attribute as specified in Section 11.2 of [RFC5652]. When signing 208 with Ed25519, the message-digest attribute MUST contain the message 209 digest computed over the eContent value using SHA-512. When signing 210 with Ed448, the message-digest attribute MUST contain the message 211 digest computed over the eContent value using SHAKE256 with an output 212 length of 512 bits. 214 The SignerInfo signatureAlgorithm field MUST contain either 215 id-Ed25519 or id-Ed448, depending on the elliptic curve that was used 216 by the signer. The algorithm parameters field MUST be absent. 218 The SignerInfo signature field contains the octet string resulting 219 from the EdDSA private key signing operation. 221 3.2. Signed-data Conventions Without Signed Attributes 223 The SignedData digestAlgorithms field includes the identifiers of the 224 message digest algorithms used by one or more signer. There MAY be 225 any number of elements in the collection, including zero. When 226 signing with Ed25519, list of identifiers MAY include id-sha512, and 227 if present, the algorithm parameters field MUST be absent. When 228 signing with Ed448, list of identifiers MAY include id-shake256, and 229 if present, the algorithm parameters field MUST be absent. 231 The SignerInfo digestAlgorithm field includes the identifier of the 232 message digest algorithms used by the signer. When signing with 233 Ed25519, the digestAlgorithm MUST be id-sha512, and the algorithm 234 parameters field MUST be absent. When signing with Ed448, the 235 digestAlgorithm MUST be id-shake256, and the algorithm parameters 236 field MUST be absent. 238 NOTE: Either id-sha512 or id-shake256 is used as part to the 239 private key signing operation. A message digest computed with one 240 of these algorithms is not an input to the private key signing 241 operation. 243 The SignerInfo signatureAlgorithm field MUST contain either 244 id-Ed25519 or id-Ed448, depending on the elliptic curve that was used 245 by the signer. The algorithm parameters field MUST be absent. 247 The SignerInfo signature field contains the octet string resulting 248 from the EdDSA private key signing operation. 250 4. Implementation Considerations 252 The EdDSA specification [EDDSA] includes the following warning. It 253 deserves highlighting. 255 PureEdDSA requires two passes over the input. Many existing APIs, 256 protocols, and environments assume digital signature algorithms 257 only need one pass over the input, and may have API or bandwidth 258 concerns supporting anything else. 260 5. Security Considerations 262 Implementations must protect the EdDSA private key. Compromise of 263 the EdDSA private key may result in the ability to forge signatures. 265 The generation of EdDSA private key relies on random numbers. The 266 use of inadequate pseudo-random number generators (PRNGs) to generate 267 these values can result in little or no security. An attacker may 268 find it much easier to reproduce the PRNG environment that produced 269 the keys, searching the resulting small set of possibilities, rather 270 than brute force searching the whole key space. The generation of 271 quality random numbers is difficult. RFC 4086 [RANDOM] offers 272 important guidance in this area. 274 Unlike DSA and ECDSA, EdDSA does not require the generation of a 275 random value for each signature operation. 277 Using the same private key for different algorithms has the potential 278 of allowing an attacker to get extra information about the private 279 key. For this reason, the same private key SHOULD NOT be used with 280 more than one EdDSA set of parameters. For example, do not use the 281 same private key with PureEdDSA and HashEdDSA. 283 When computing signatures, the same hash function should be used for 284 all operations. This reduces the number of failure points in the 285 signature process. 287 6. Normative References 289 [CMS] Housley, R., "Cryptographic Message Syntax (CMS)", 290 RFC 5652, September 2009. 292 [EDDSA] Josefsson, S. and I. Liusvaara, "Edwards-curve Digital 293 Signature Algorithm (EdDSA)", draft-irtf-cfrg-eddsa-08, 294 19 August 2016, Work-in-progress. 296 [FIPS202] National Institute of Standards and Technology, U.S. 297 Department of Commerce, "SHA-3 Standard: Permutation-Based 298 Hash and Extendable-Output Functions", FIPS 202, 299 August 2015. 301 [ID.curdle-pkix] 302 Josefsson, S., and J. Schaad, "Algorithm Identifiers for 303 Ed25519, Ed25519ph, Ed448, Ed448ph, X25519 and X448 for 304 use in the Internet X.509 Public Key Infrastructure", 305 draft-ietf-curdle-pkix-02, 31 October 2016, 306 Work-in-progress. 308 [RFC4634] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 309 (SHA and HMAC-SHA)", RFC 4634, July 2006. 311 [STDWORDS] Bradner, S., "Key words for use in RFCs to Indicate 312 Requirement Levels", BCP 14, RFC 2119, March 1997. 314 [X680] ITU-T, "Information technology -- Abstract Syntax Notation 315 One (ASN.1): Specification of basic notation", ITU-T 316 Recommendation X.680, 2015. 318 [X690] ITU-T, "Information technology -- ASN.1 encoding rules: 319 Specification of Basic Encoding Rules (BER), Canonical 320 Encoding Rules (CER) and Distinguished Encoding Rules 321 (DER)", ITU-T Recommendation X.690, 2015. 323 7. Informative References 325 [RANDOM] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 326 Requirements for Security", RFC 4086, June 2005. 328 Author Address 330 Russ Housley 331 918 Spring Knoll Drive 332 Herndon, VA 20170 333 USA 334 housley@vigilsec.com