idnits 2.17.00 (12 Aug 2021) /tmp/idnits37953/draft-ietf-curdle-cms-eddsa-signatures-08.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (11 October 2017) is 1676 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) == Outdated reference: draft-ietf-curdle-pkix has been published as RFC 8410 -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS202' ** Downref: Normative reference to an Informational RFC: RFC 8032 -- Possible downref: Non-RFC (?) normative reference: ref. 'X680' -- Possible downref: Non-RFC (?) normative reference: ref. 'X690' Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 5 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: 11 April 2018 11 October 2017 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 11 April 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 1. Introduction 52 This document specifies the conventions for using the Edwards-curve 53 Digital Signature Algorithm (EdDSA) [RFC8032] for curve25519 54 [CURVE25519] and curve448 [CURVE448] with the Cryptographic Message 55 Syntax (CMS) [RFC5652] signed-data content type. For each curve, 56 [RFC8032] defines the PureEdDSA and HashEdDSA modes; however, the 57 HashEdDSA mode is not used with the CMS. In addition, no context 58 string is used with CMS. EdDSA with curve25519 is referred to as 59 Ed25519, and EdDSA with curve448 is referred to as Ed448. The CMS 60 conventions for PureEdDSA with Ed25519 and Ed448 are described in 61 this document. 63 1.1. Terminology 65 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 66 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 67 "OPTIONAL" in this document are to be interpreted as described in BCP 68 14 [RFC2119] [RFC8174] when, and only when, they appear in all 69 capitals, as shown here. 71 1.2. ASN.1 73 CMS values are generated using ASN.1 [X680], which uses the Basic 74 Encoding Rules (BER) and the Distinguished Encoding Rules (DER) 75 [X690]. 77 2. EdDSA Signature Algorithm 79 The Edwards-curve Digital Signature Algorithm (EdDSA) [RFC8032] is a 80 variant of Schnorr's signature system with (possibly twisted) Edwards 81 curves. Ed25519 is intended to operate at around the 128-bit 82 security level, and Ed448 at around the 224-bit security level. 84 One of the parameters of the EdDSA algorithm is the "prehash" 85 function. This may be the identity function, resulting in an 86 algorithm called PureEdDSA, or a collision-resistant hash function, 87 resulting in an algorithm called HashEdDSA. In most situations the 88 CMS SignedData includes signed attributes, including the message 89 digest of the content. Since HashEdDSA offers no benefit when signed 90 attributes are present, only PureEdDSA is used with the CMS. 92 2.1. Algorithm Identifiers 94 Each algorithm is identified by an object identifier, and the 95 algorithm identifier may contain parameters if needed. 97 The ALGORITHM definition is repeated here for convenience: 99 ALGORITHM ::= CLASS { 100 &id OBJECT IDENTIFIER UNIQUE, 101 &Type OPTIONAL } 102 WITH SYNTAX { 103 OID &id [PARMS &Type] } 105 2.2. EdDSA Algorithm Identifiers 107 The EdDSA signature algorithm is defined in [RFC8032], and the 108 conventions for encoding the public key are defined in 109 [CURDLE-PKIX]. 111 The id-Ed25519 and id-Ed448 object identifiers are used to identify 112 EdDSA public keys in certificates. The object identifiers are 113 specified in [CURDLE-PKIX], and they are repeated here for 114 convenience: 116 sigAlg-Ed25519 ALGORITHM ::= { OID id-Ed25519 } 118 sigAlg-Ed448 ALGORITHM ::= { OID id-Ed448 } 120 id-Ed25519 OBJECT IDENTIFIER ::= { 1 3 101 112 } 122 id-Ed448 OBJECT IDENTIFIER ::= { 1 3 101 113 } 124 2.3. Message Digest Algorithm Identifiers 126 When the signer includes signed attributes, a message digest 127 algorithm is used to compute the message digest on the eContent 128 value. When signing with Ed25519, the message digest algorithm MUST 129 be SHA-512 [FIPS180]. Additional information on SHA-512 is available 130 in RFC 6234 [RFC6234]. When signing with Ed448, the message digest 131 algorithm MUST be SHAKE256 [FIPS202] with a 512-bit output value. 133 Signing with Ed25519 uses SHA-512 as part of the signing operation, 134 and signing with Ed448 uses SHAKE256 as part of the signing 135 operation. 137 For convenience, the object identifiers and parameter syntax for 138 these algorithms are repeated here: 140 hashAlg-SHA-512 ALGORITHM ::= { OID id-sha512 } 142 hashAlg-SHAKE256 ALGORITHM ::= { OID id-shake256 } 143 hashAlg-SHAKE256-LEN ALGORITHM ::= { OID id-shake256-len 144 PARMS ShakeOutputLen } 146 hashalgs OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) 147 country(16) us(840) organization(1) 148 gov(101) csor(3) nistalgorithm(4) 2 } 150 id-sha512 OBJECT IDENTIFIER ::= { hashAlgs 3 } 152 id-shake256 OBJECT IDENTIFIER ::= { hashAlgs 12 } 154 id-shake256-len OBJECT IDENTIFIER ::= { hashAlgs 18 } 156 ShakeOutputLen ::= INTEGER -- Output length in bits 158 When using the id-sha512 or id-shake256 algorithm identifier, the 159 parameters MUST be absent. 161 When using the id-shake256-len algorithm identifier, the parameters 162 MUST be present, and the parameter MUST contain 512, encoded as a 163 positive integer value. 165 2.4. EdDSA Signatures 167 The id-Ed25519 and id-Ed448 object identifiers are also used for 168 signature values. When used to identify signature algorithms, the 169 AlgorithmIdentifier parameters field MUST be absent. 171 The data to be signed is processed using PureEdDSA, and then a 172 private key operation generates the signature value. As described in 173 Section 3.3 of [RFC8032], the signature value is the opaque value 174 ENC(R) || ENC(S), where || represents concatenation. As described in 175 Section 5.3 of [RFC5652], the signature value is ASN.1 encoded as an 176 OCTET STRING and included in the signature field of SignerInfo. 178 3. Signed-data Conventions 180 The processing depends on whether the signer includes signed 181 attributes. 183 The inclusion of signed attributes is preferred, but the conventions 184 for signed-data without signed attributes are provided for 185 completeness. 187 3.1. Signed-data Conventions With Signed Attributes 189 The SignedData digestAlgorithms field includes the identifiers of the 190 message digest algorithms used by one or more signer. There MAY be 191 any number of elements in the collection, including zero. When 192 signing with Ed25519, the digestAlgorithm SHOULD include id-sha512, 193 and if present, the algorithm parameters field MUST be absent. When 194 signing with Ed448, the digestAlgorithm SHOULD include 195 id-shake256-len, and if present, the algorithm parameters field MUST 196 also be present, and the parameter MUST contain 512, encoded as a 197 positive integer value. 199 The SignerInfo digestAlgorithm field includes the identifier of the 200 message digest algorithms used by the signer. When signing with 201 Ed25519, the digestAlgorithm MUST be id-sha512, and the algorithm 202 parameters field MUST be absent. When signing with Ed448, the 203 digestAlgorithm MUST be id-shake256-len, the algorithm parameters 204 field MUST be present, and the parameter MUST contain 512, encoded as 205 a positive integer value. 207 The SignerInfo signedAttributes MUST include the message-digest 208 attribute as specified in Section 11.2 of [RFC5652]. When signing 209 with Ed25519, the message-digest attribute MUST contain the message 210 digest computed over the eContent value using SHA-512. When signing 211 with Ed448, the message-digest attribute MUST contain the message 212 digest computed over the eContent value using SHAKE256 with an output 213 length of 512 bits. 215 The SignerInfo signatureAlgorithm field MUST contain either 216 id-Ed25519 or id-Ed448, depending on the elliptic curve that was used 217 by the signer. The algorithm parameters field MUST be absent. 219 The SignerInfo signature field contains the octet string resulting 220 from the EdDSA private key signing operation. 222 3.2. Signed-data Conventions Without Signed Attributes 224 The SignedData digestAlgorithms field includes the identifiers of the 225 message digest algorithms used by one or more signer. There MAY be 226 any number of elements in the collection, including zero. When 227 signing with Ed25519, list of identifiers MAY include id-sha512, and 228 if present, the algorithm parameters field MUST be absent. When 229 signing with Ed448, list of identifiers MAY include id-shake256, and 230 if present, the algorithm parameters field MUST be absent. 232 The SignerInfo digestAlgorithm field includes the identifier of the 233 message digest algorithms used by the signer. When signing with 234 Ed25519, the digestAlgorithm MUST be id-sha512, and the algorithm 235 parameters field MUST be absent. When signing with Ed448, the 236 digestAlgorithm MUST be id-shake256, and the algorithm parameters 237 field MUST be absent. 239 NOTE: Either id-sha512 or id-shake256 is used as part to the 240 private key signing operation. However, the private key signing 241 operation does not take a message digest computed with one of 242 these algorithms as an input. 244 The SignerInfo signatureAlgorithm field MUST contain either 245 id-Ed25519 or id-Ed448, depending on the elliptic curve that was used 246 by the signer. The algorithm parameters field MUST be absent. 248 The SignerInfo signature field contains the octet string resulting 249 from the EdDSA private key signing operation. 251 4. Implementation Considerations 253 The EdDSA specification [RFC8032] includes the following warning. It 254 deserves highlighting, especially when signed-data is used without 255 signed attributes and the content to be signed might be quite large: 257 PureEdDSA requires two passes over the input. Many existing APIs, 258 protocols, and environments assume digital signature algorithms 259 only need one pass over the input, and may have API or bandwidth 260 concerns supporting anything else. 262 5. Security Considerations 264 Implementations must protect the EdDSA private key. Compromise of 265 the EdDSA private key may result in the ability to forge signatures. 267 The generation of EdDSA private key relies on random numbers. The 268 use of inadequate pseudo-random number generators (PRNGs) to generate 269 these values can result in little or no security. An attacker may 270 find it much easier to reproduce the PRNG environment that produced 271 the keys, searching the resulting small set of possibilities, rather 272 than brute force searching the whole key space. The generation of 273 quality random numbers is difficult. RFC 4086 [RANDOM] offers 274 important guidance in this area. 276 Unlike DSA and ECDSA, EdDSA does not require the generation of a 277 random value for each signature operation. 279 Using the same private key with different algorithms has the 280 potential to leak extra information about the private key to an 281 attacker. For this reason, the same private key SHOULD NOT be used 282 with more than one set of EdDSA parameters, although it appears that 283 there are no security concerns when using the same private key with 284 PureEdDSA and HashEdDSA [RFC8032]. 286 When computing signatures, the same hash function SHOULD be used for 287 all operations. This reduces the number of failure points in the 288 signature process. 290 6. IANA Considerations 292 This document requires no actions by IANA. 294 7. Acknowledgements 296 Many thanks to Jim Schaad, Daniel Migault, and Adam Roach for the 297 careful review and comments on the draft document. Thanks to Quynh 298 Dang for coordinating the object identifiers assignment by NIST. 300 8. Normative References 302 [CURDLE-PKIX] 303 Josefsson, S., and J. Schaad, "Algorithm Identifiers for 304 Ed25519, Ed25519ph, Ed448, Ed448ph, X25519 and X448 for 305 use in the Internet X.509 Public Key Infrastructure", 306 draft-ietf-curdle-pkix-02, 31 October 2016, 307 Work-in-progress. 309 [FIPS180] National Institute of Standards and Technology, U.S. 310 Department of Commerce, "Secure Hash Standard", Federal 311 Information Processing Standard (FIPS) 180-3, October 312 2008. 314 [FIPS202] National Institute of Standards and Technology, U.S. 315 Department of Commerce, "SHA-3 Standard: Permutation-Based 316 Hash and Extendable-Output Functions", Federal Information 317 Processing Standard (FIPS) 202, August 2015. 319 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 320 Requirement Levels", BCP 14, RFC 2119, March 1997. 322 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", 323 RFC 5652, September 2009. 325 [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-curve Digital 326 Signature Algorithm (EdDSA)", RFC 8032, January 2017. 328 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 329 2119 Key Words", BCP 14, RFC 8174, May 2017. 331 [X680] ITU-T, "Information technology -- Abstract Syntax Notation 332 One (ASN.1): Specification of basic notation", ITU-T 333 Recommendation X.680, 2015. 335 [X690] ITU-T, "Information technology -- ASN.1 encoding rules: 336 Specification of Basic Encoding Rules (BER), Canonical 337 Encoding Rules (CER) and Distinguished Encoding Rules 338 (DER)", ITU-T Recommendation X.690, 2015. 340 9. Informative References 342 [CURVE25519] 343 Bernstein, D., "Curve25519: new Diffie-Hellman speed 344 records", DOI 10.1007/11745853_14, February 2006, 345 . 347 [CURVE448] Hamburg, M., "Ed448-Goldilocks, a new elliptic curve", 348 June 2015, . 350 [RANDOM] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 351 Requirements for Security", RFC 4086, June 2005. 353 [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 354 (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011. 356 Author's Address 358 Russ Housley 359 918 Spring Knoll Drive 360 Herndon, VA 20170 361 USA 362 housley@vigilsec.com