idnits 2.17.1 draft-ietf-cose-hash-algs-00.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: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 336 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([I-D.ietf-cose-RFC8152bis-struct]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (11 March 2019) is 1870 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-15) exists of draft-ietf-cose-rfc8152bis-struct-01 == Outdated reference: A later version (-09) exists of draft-ietf-cose-x509-00 Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Schaad 3 Internet-Draft August Cellars 4 Intended status: Informational 11 March 2019 5 Expires: 12 September 2019 7 CBOR Object Signing and Encryption (COSE): Hash Algorithms 8 draft-ietf-cose-hash-algs-00 10 Abstract 12 The CBOR Object Signing and Encryption (COSE) syntax 13 [I-D.ietf-cose-rfc8152bis-struct] does not define any direct methods 14 for using hash algorithms. There are however circumstances where 15 hash algorithms are used: Indirect signatures where the hash of one 16 or more contents are signed. X.509 certificate or other object 17 identification by the use of a thumbprint. This document defines a 18 set of hash algorithms that are identified by COSE Algorithm 19 Identifiers. 21 Contributing to this document 23 The source for this draft is being maintained in GitHub. Suggested 24 changes should be submitted as pull requests at TBD. Editorial 25 changes can be managed in GitHub, but any substantial issues need to 26 be discussed on the COSE mailing list. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on 12 September 2019. 45 Copyright Notice 47 Copyright (c) 2019 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 52 license-info) in effect on the date of publication of this document. 53 Please review these documents carefully, as they describe your rights 54 and restrictions with respect to this document. Code Components 55 extracted from this document must include Simplified BSD License text 56 as described in Section 4.e of the Trust Legal Provisions and are 57 provided without warranty as described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction 62 1.1. Requirements Terminology 63 1.2. Open Issues 64 2. Hash Algorithm Identifiers 65 2.1. SHA-1 Hash Algorithm 66 2.2. SHA-2 Hash Algorithms 67 2.3. SHAKE Algorithms 68 3. IANA Considerations 69 3.1. COSE Algorithm Registry 70 4. Security Considerations 71 5. Normative References 72 6. Informative References 73 Author's Address 75 1. Introduction 77 The CBOR Object Signing and Encryption (COSE) syntax does not define 78 any direct methods for the use of hash algorithms. It also does not 79 define a structure syntax that is used to encode a digested object 80 structure along the lines of the DigestedData ASN.1 structure in 81 [CMS]. This omission was intentional as a structure consisting of 82 jut a digest identifier, the content, and a digest value does not by 83 itself provide any strong security service. Additional, an 84 application is going to be better off defining this type of structure 85 so that it can add any additional data that needs to be hashed as 86 well as methods of obtaining the data. 88 While the above is true, there are some cases where having some 89 standard hash algorithms defined for COSE with a common identifier 90 makes a great deal of sense. Two of the cases where these are going 91 to be used are: 93 * Indirect signing of content, and 95 * Object identification. 97 Indirect signing of content is a paradigm where the content is not 98 directly signed, but instead a hash of the content is computed and 99 that hash value, along with the hash algorithm, is included in the 100 content that will be signed. Doing indirect signing allows for the a 101 signature to be validated without first downloading all of the 102 content associated with the signature. This capability can be of 103 even grater importance in a constrained environment as not all of the 104 content signed may be needed by the device. 106 The use of hashes to identify objects is something that has been very 107 common. One of the primary things that has been identified by a hash 108 function for secure message is a certificate. Two examples of this 109 can be found in [ESS] and the newly defined COSE equivalents in 110 [I-D.ietf-cose-x509]. 112 1.1. Requirements Terminology 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 116 "OPTIONAL" in this document are to be interpreted as described in BCP 117 14 [RFC2119] [RFC8174] when, and only when, they appear in all 118 capitals, as shown here. 120 1.2. Open Issues 122 * Are there additional SHA-2 formulations that need to be added or 123 should some of the ones in this document be removed? 125 * Should additional hash algorithms be added to the document? 127 * Review the Recommended column in all of the tables to make sure 128 that the values are correct. 130 * Are there recommendations that should be provided on what range of 131 identifiers should be used for these algorithms? Inputs would 132 include the expected frequency of use for each algorithm. 134 2. Hash Algorithm Identifiers 136 2.1. SHA-1 Hash Algorithm 138 The SHA-1 hash algorithm [RFC3174] wsa designed by the United States 139 National Security Agenciy and published in 1995. Since that time a 140 large amount of cryptographic analysis has been applied to this 141 algorithm and a successful collision attack has been created 142 ([SHA-1-collision]). The IETF formally started discouraging the use 143 of SHA-1 with the publishing of [RFC6194]. 145 Dispite the above, there are still times where SHA-1 needs to be used 146 and therefore it makes sense to assign a point for the use of this 147 hash algorithm. Some of these situations are with historic HSMs 148 where only SHA-1 is implemented or where the SHA-1 value is used for 149 the purpose of filtering and thus the collision resistance property 150 is not needed. 152 Because of the known issues for SHA-1 and the fact that is should no 153 longer be used, the algorithm will be registered with the 154 recommendation of "Depreciated". 156 +-------+-------+-------------+-----------------+-------------+ 157 | Name | Value | Description | Reference | Recommended | 158 +=======+=======+=============+=================+=============+ 159 | SHA-1 | TBD6 | SHA-1 Hash | [This Document] | Depreciated | 160 +-------+-------+-------------+-----------------+-------------+ 162 Table 1: SHA-1 Hash Algorithm 164 2.2. SHA-2 Hash Algorithms 166 The family of SHA-2 hash algorithms [FIPS-180-4] was designed by the 167 United States National Security Agency and published in 2001. Since 168 that time some additional algorithms have been added to the original 169 set to deal with length extension attacks and some performance 170 issues. While the SHA-3 hash algorithms has been published since 171 that time, the SHA-2 algorithms are still broadly used. 173 There are a number of different parameters for the SHA-2 hash 174 functions. The set of hash functions which have been chosen for 175 inclusion in this document are based on those different parameters 176 and some of the trade-offs involved. 178 * *SHA-256/64* provides a truncated hash. The length of the 179 truncation is designed to allow for smaller transmission size. 180 The trade-off is that the odds that a collision will occur 181 increase proportionally. Locations that use this hash function 182 need either to analysis the potential problems with having a 183 collision occur, or where the only function of the hash is to 184 narrow the possible choices. 186 The latter is the case for [I-D.ietf-cose-x509], the hash value is 187 used to select possible certificates and, if there are multiple 188 choices then, each choice can be tested by using the public key. 190 * *SHA-256* is probably the most common hash function used 191 currently. SHA-256 is the most efficient hash algorithm for 192 32-bit hardware. 194 * *SHA-384* and *SHA-512* hash functions are more efficient when run 195 on 64-bit hardware. 197 * *SHA-512/256* provides a hash function that runs more efficiently 198 on 64-bit hardware, but offers the same security levels as SHA- 199 256. 201 +-------------+-------+----------------+-----------+-------------+ 202 | Name | Value | Description | Reference | Recommended | 203 +=============+=======+================+===========+=============+ 204 | SHA-256/64 | TBD1 | SHA-2 256-bit | [This | No | 205 | | | Hash truncated | Document] | | 206 | | | to 64-bits | | | 207 +-------------+-------+----------------+-----------+-------------+ 208 | SHA-256 | TBD2 | SHA-2 256-bit | [This | Yes | 209 | | | Hash | Document] | | 210 +-------------+-------+----------------+-----------+-------------+ 211 | SHA-384 | TBD3 | SHA-2 384-bit | [This | Yes | 212 | | | Hash | Document] | | 213 +-------------+-------+----------------+-----------+-------------+ 214 | SHA-512 | TBD4 | SHA-2 512-bit | [This | Yes | 215 | | | Hash | Document] | | 216 +-------------+-------+----------------+-----------+-------------+ 217 | SHA-512/256 | TBD5 | SHA-2 512-bit | [This | Yes | 218 | | | Hash truncated | Document] | | 219 | | | to 256-bits | | | 220 +-------------+-------+----------------+-----------+-------------+ 222 Table 2: SHA-2 Hash Algorithms 224 2.3. SHAKE Algorithms 226 The family SHA-3 hash algorithms [FIPS-180-4] was the result of a 227 competition run by NIST. The pair of algorithms known as SHAKE-128 228 and SHAKE-256 are the instances of SHA-3 that are currently being 229 standardized in the IETF. 231 The SHA-3 hash algorithms have a significantly different structure 232 than the SHA-3 hash algorithms. One of the benefits of this 233 differences is that when computing a truncated SHAKE hash value, the 234 value is not a prefix of a longer version of the same value. 236 MAYBE TEXT: Might not need to define truncated versions of this hash 237 algorithm because the length of the resulting value is always going 238 to generate a unique value since you cannot just truncate it like you 239 can with SHA-1 and SHA-2. 241 +----------+-------+---------------+-----------------+-------------+ 242 | Name | Value | Description | Reference | Recommended | 243 +==========+=======+===============+=================+=============+ 244 | SHAKE128 | TBD10 | 128-bit SHAKE | [This Document] | Yes | 245 +----------+-------+---------------+-----------------+-------------+ 246 | SHAKE256 | TBD11 | 256-bit SHAKE | [This Document] | Yes | 247 +----------+-------+---------------+-----------------+-------------+ 249 Table 3: SHAKE Hash Functions 251 3. IANA Considerations 253 3.1. COSE Algorithm Registry 255 IANA is requested to register the following algorithms in the "COSE 256 Algorithms" registry. 258 * The SHA-1 hash function found in Table 1. 260 * The set of SHA-2 hash functions found in Table 2. 262 * The set of SHAKE hash functions found in Table 3. 264 Many of the hash values produced are relatively long and as such the 265 use of a two byte algorithm identifier seems reasonable. SHA-1 is 266 tagged as deprecated and thus a longer algorithm identifier is 267 appropriate even though it is a shorter hash value. 269 4. Security Considerations 271 There are security considerations: 273 5. Normative References 275 [FIPS-180-4] 276 National Institute of Standards and Technology, "Secure 277 Hash Standard", FIPS PUB 180-4, August 2015. 279 [I-D.ietf-cose-rfc8152bis-struct] 280 Schaad, J., "CBOR Object Signing and Encryption (COSE) - 281 Structures and Process", draft-ietf-cose-rfc8152bis- 282 struct-01 (work in progress), 14 February 2019, 283 . 286 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 287 Requirement Levels", BCP 14, RFC 2119, 288 DOI 10.17487/RFC2119, March 1997, 289 . 291 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 292 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 293 May 2017, . 295 6. Informative References 297 [CMS] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 298 RFC 5652, DOI 10.17487/RFC5652, September 2009, 299 . 301 [ESS] Hoffman, P., Ed., "Enhanced Security Services for S/MIME", 302 RFC 2634, DOI 10.17487/RFC2634, June 1999, 303 . 305 [I-D.ietf-cose-x509] 306 Schaad, J., "CBOR Object Signing and Encryption (COSE): 307 Headers for carrying and referencing X.509 certificates", 308 draft-ietf-cose-x509-00 (work in progress), 29 January 309 2019, 310 . 312 [RFC3174] Eastlake 3rd, D. and P. Jones, "US Secure Hash Algorithm 1 313 (SHA1)", RFC 3174, DOI 10.17487/RFC3174, September 2001, 314 . 316 [RFC6194] Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security 317 Considerations for the SHA-0 and SHA-1 Message-Digest 318 Algorithms", RFC 6194, DOI 10.17487/RFC6194, March 2011, 319 . 321 [SHA-1-collision] 322 Stevens, M., Bursztein, E., Karpman, P., Albertini, A., 323 and Y. Markov, "The first collision for full SHA-1", 324 February 2017, 325 . 327 Author's Address 329 Jim Schaad 330 August Cellars 332 Email: ietf@augustcellars.com