idnits 2.17.1 draft-housley-suit-cose-hash-sig-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: ---------------------------------------------------------------------------- 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 (30 May 2018) is 2151 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: '0' on line 221 -- Looks like a reference, but probably isn't: '1' on line 180 -- Looks like a reference, but probably isn't: '2' on line 137 == Missing Reference: 'Nspk-2' is mentioned on line 139, but not defined == Missing Reference: 'Nspk-1' is mentioned on line 140, but not defined == Missing Reference: 'Nspk' is mentioned on line 140, but not defined == Unused Reference: 'PQC' is defined on line 408, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'HASHSIG' ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 INTERNET-DRAFT R. Housley 3 Intended Status: Proposed Standard Vigil Security 4 Expires: 30 November 2018 30 May 2018 6 Use of the Hash-based Signature Algorithm with 7 CBOR Object Signing and Encryption (COSE) 8 10 Abstract 12 This document specifies the conventions for using the Leighton-Micali 13 Signature (LMS) algorithm for digital signatures with the CBOR Object 14 Signing and Encryption (COSE) syntax. 16 Status of this Memo 18 This Internet-Draft is submitted to IETF in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF), its areas, and its working groups. Note that 23 other groups may also distribute working documents as Internet- 24 Drafts. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 The list of current Internet-Drafts can be accessed at 32 http://www.ietf.org/1id-abstracts.html 34 The list of Internet-Draft Shadow Directories can be accessed at 35 http://www.ietf.org/shadow.html 37 Copyright and License Notice 39 Copyright (c) 2018 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 3. LMS Digital Signature Algorithm Overview . . . . . . . . . . . 3 57 3.1. Hierarchical Signature System (HSS) . . . . . . . . . . . 3 58 3.2. Leighton-Micali Signature (LMS) . . . . . . . . . . . . . 4 59 3.3. Leighton-Micali One-time Signature Algorithm (LM-OTS) . . 5 60 4. Hash-based Signature Algorithm Identifiers . . . . . . . . . . 6 61 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 62 5.1. Implementation Security Considerations . . . . . . . . . . 6 63 5.2. Algorithm Security Considerations . . . . . . . . . . . . 7 64 6. Operational Considerations . . . . . . . . . . . . . . . . . . 7 65 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 66 7.1. COSE Algorithms Registry Entry . . . . . . . . . . . . . . 8 67 7.2. COSE Key Types Registry Entry . . . . . . . . . . . . . . 8 68 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 9 69 8.1. Normative References . . . . . . . . . . . . . . . . . . . 9 70 8.2. Informative References . . . . . . . . . . . . . . . . . . 9 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 10 73 1. Introduction 75 This document specifies the conventions for using the Leighton-Micali 76 Signature (LMS) algorithm [HASHSIG] for digital signatures with the 77 CBOR Object Signing and Encryption (COSE) [RFC8152] syntax. The LMS 78 algorithm is one form of hash-based digital signature; it can only be 79 used for a fixed number of signatures. The LMS algorithm uses small 80 private and public keys, and it has low computational cost; however, 81 the signatures are quite large. 83 2. Terminology 85 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 86 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 87 "OPTIONAL" in this document are to be interpreted as described in BCP 88 14 [RFC2119] [RFC8174] when, and only when, they appear in all 89 capitals, as shown here. 91 3. LMS Digital Signature Algorithm Overview 93 This specification makes use of the hash-based signature algorithm 94 specified in [HASHSIG], which is the Leighton and Micali adaptation 95 [LM] of the original Lamport-Diffie-Winternitz-Merkle one-time 96 signature system [M1979][M1987][M1989a][M1989b]. 98 The hash-based signature algorithm has three major components: 100 o Hierarchical Signature System (HSS) -- see Section 3.1; 102 o Leighton-Micali Signature (LMS) -- see Section 3.2; and 104 o Leighton-Micali One-time Signature Algorithm (LM-OTS) -- see 105 Section 3.3. 107 As implied by the name, the hash-based signature algorithm depends on 108 a collision-resistant hash function, and this specification makes use 109 of the SHA-256 one-way hash function [SHS]. 111 3.1. Hierarchical Signature System (HSS) 113 The hash-based signature algorithm specified in [HASHSIG] uses a 114 hierarchy of trees. The Hierarchical Signature System (HSS) allows 115 subordinate trees to be generated when needed by the signer. 116 Otherwise, generation of the entire tree might take weeks or longer. 118 An HSS signature as specified in [HASHSIG] carries the number of 119 signed public keys (Nspk), followed by that number of signed public 120 keys, followed by the LMS signature as described in Section 3.2. 122 Each signed public key is represented by the hash value at the root 123 of the tree, and the signature over that public key is an LMS 124 signature as described in Section 3.2. 126 The elements of the HSS signature value for a stand-alone tree can be 127 summarized as: 129 u32str(0) || 130 lms_signature_on_message 132 The elements of the HSS signature value for a tree with Nspk levels 133 can be summarized as: 135 u32str(Nspk) || 136 lms_signature_on_public_key[0] || public_key[1] || 137 lms_signature_on_public_key[1] || public_key[2] || 138 ... 139 lms_signature_on_public_key[Nspk-2] || public_key[Nspk-1] || 140 lms_signature_on_public_key[Nspk-1] || public_key[Nspk] || 141 lms_signature_on_message 143 3.2. Leighton-Micali Signature (LMS) 145 Each tree in the hash-based signature algorithm specified in 146 [HASHSIG] uses the Leighton-Micali Signature (LMS) system. LMS 147 systems have two parameters. The first parameter is the height of 148 the tree, h, which is the number of levels in the tree minus one. 149 The hash-based signature algorithm supports five values for this 150 parameter: h=5; h=10; h=15; h=20; and h=25. Note that there are 2^h 151 leaves in the tree. The second parameter is the number of bytes 152 output by the hash function, m, which is the amount of data 153 associated with each node in the tree. This specification supports 154 only SHA-256, with m=32. 156 The hash-based signature algorithm supports five tree sizes: 158 LMS_SHA256_M32_H5; 159 LMS_SHA256_M32_H10; 160 LMS_SHA256_M32_H15; 161 LMS_SHA256_M32_H20; and 162 LMS_SHA256_M32_H25. 164 An LMS signature consists of four elements: a typecode indicating the 165 particular LMS algorithm, the number of the leaf associated with the 166 LM-OTS signature, an LM-OTS signature as described in Section 3.3, 167 and an array of values that is associated with the path through the 168 tree from the leaf associated with the LM-OTS signature to the root. 169 The array of values contains the siblings of the nodes on the path 170 from the leaf to the root but does not contain the nodes on the path 171 itself. The array for a tree with height h will have h values. The 172 first value is the sibling of the leaf, the next value is the sibling 173 of the parent of the leaf, and so on up the path to the root. 175 The four elements of the LMS signature value can be summarized as: 177 u32str(q) || 178 ots_signature || 179 u32str(type) || 180 path[0] || path[1] || ... || path[h-1] 182 3.3. Leighton-Micali One-time Signature Algorithm (LM-OTS) 184 The hash-based signature algorithm depends on a one-time signature 185 method. This specification makes use of the Leighton-Micali One-time 186 Signature Algorithm (LM-OTS) [HASHSIG]. An LM-OTS has five 187 parameters: 189 n - The number of bytes output by the hash function. This 190 specification supports only SHA-256 [SHS], with n=32. 192 H - A preimage-resistant hash function that accepts byte strings 193 of any length, and returns an n-byte string. This 194 specification supports only SHA-256 [SHS]. 196 w - The width in bits of the Winternitz coefficients. [HASHSIG] 197 supports four values for this parameter: w=1; w=2; w=4; and 198 w=8. 200 p - The number of n-byte string elements that make up the LM-OTS 201 signature. 203 ls - The number of left-shift bits used in the checksum function, 204 which is defined in Section 4.5 of [HASHSIG]. 206 The values of p and ls are dependent on the choices of the parameters 207 n and w, as described in Appendix A of [HASHSIG]. 209 The hash-based signature algorithm supports four LM-OTS variants: 211 LMOTS_SHA256_N32_W1; 212 LMOTS_SHA256_N32_W2; 213 LMOTS_SHA256_N32_W4; and 214 LMOTS_SHA256_N32_W8. 216 Signing involves the generation of C, which is an n-byte random 217 value. 219 The LM-OTS signature value can be summarized as: 221 u32str(type) || C || y[0] || ... || y[p-1] 223 4. Hash-based Signature Algorithm Identifiers 225 The CBOR Object Signing and Encryption (COSE) [RFC8152] supports two 226 signature algorithm schemes. This specification makes use of the 227 signature with appendix scheme for hash-based signatures. 229 The signature value is a large byte string. The byte string is 230 designed for easy parsing, and it includes a counter and type codes 231 that indirectly provide all of the information that is needed to 232 parse the byte string during signature validation. The first four 233 bytes of the signature value contains the number of signed public 234 keys (Nspk) in the HSS. The first four bytes of each LMS signature 235 value contains type code, which tells how to parse the remaining 236 parts of the LMS signature value. The first four bytes of each LM- 237 OTS signature value contains type code, which tells how to parse the 238 remaining parts of the LM-OTS signature value. 240 When using a COSE key for this algorithm, the following checks are 241 made: 243 o The 'kty' field MUST be present, and it MUST be 'HSIG'. 245 o If the 'alg' field is present, and it MUST be 'HSIG'. 247 o If the 'key_ops' field is present, it MUST include 'sign' when 248 creating a hash-based signature. 250 o If the 'key_ops' field is present, it MUST include 'verify' 251 when verifying a hash-based signature. 253 5. Security Considerations 255 5.1. Implementation Security Considerations 257 Implementations must protect the private keys. Compromise of the 258 private keys may result in the ability to forge signatures. Along 259 with the private key, the implementation must keep track of which 260 leaf nodes in the tree have been used. Loss of integrity of this 261 tracking data can cause an one-time key to be used more than once. 262 As a result, when a private key and the tracking data are stored on 263 non-volatile media or stored in a virtual machine environment, care 264 must be taken to preserve confidentiality and integrity. 266 An implementation must ensure that a LM-OTS private key is used to 267 generate a signature only one time, and ensure that it cannot be used 268 for any other purpose. 270 The generation of private keys relies on random numbers. The use of 271 inadequate pseudo-random number generators (PRNGs) to generate these 272 values can result in little or no security. An attacker may find it 273 much easier to reproduce the PRNG environment that produced the keys, 274 searching the resulting small set of possibilities, rather than brute 275 force searching the whole key space. The generation of quality 276 random numbers is difficult. [RFC4086] offers important guidance in 277 this area. 279 5.2. Algorithm Security Considerations 281 At Black Hat USA 2013, some researchers gave a presentation on the 282 current sate of public key cryptography. They said: "Current 283 cryptosystems depend on discrete logarithm and factoring which has 284 seen some major new developments in the past 6 months" [BH2013]. 285 They encouraged preparation for a day when RSA and DSA cannot be 286 depended upon. 288 A post-quantum cryptosystem is a system that is secure against 289 quantum computers that have more than a trivial number of quantum 290 bits. It is open to conjecture when it will be feasible to build 291 such a machine. RSA, DSA, and ECDSA are not post-quantum secure. 293 The LM-OTP one-time signature, LMS, and HSS do not depend on discrete 294 logarithm or factoring, as a result these algorithms are considered 295 to be post-quantum secure. 297 Today, RSA is often used to digitally sign software updates. This 298 means that the distribution of software updates could be compromised 299 if a significant advance is made in factoring or a quantum computer 300 is invented. The use of hash-based signatures to protect software 301 update distribution will allow the deployment of software that 302 implements new cryptosystems. 304 6. Operational Considerations 306 The public key for the hash-based signature is the ke at the root of 307 Hierarchical Signature System (HSS). In the absence of a public key 308 infrastructure [RFC5280], this public key is a trust anchor, and the 309 number of signatures that can be generated is bounded by the size of 310 the overall HSS set of trees. When all of the LM-OTS signatures have 311 been used to produce a signature, then the establishment of a new 312 trust anchor is required. 314 To ensure that none of tree nodes are used to generate more than one 315 signature, the signer maintains state across different invocations of 316 the signing algorithm. Section 12.2 of [HASHSIG] offers some 317 practical implementation approaches around this statefulness. In 318 some of these approaches, nodes are sacrificed to ensure that none 319 are used more than once. As a result, the total number of signatures 320 that can be generated might be less than the overall HSS set of 321 trees. 323 7. IANA Considerations 325 IANA is requested to add entries for hash-based signatures in the 326 "COSE Algorithms" registry and hash-based public keys in the "COSE 327 Key Types" registry. 329 7.1. COSE Algorithms Registry Entry 331 The new entry in the "COSE Algorithms" registry has the following 332 columns: 334 Name: HASHSIG 336 Value: TBD (Value to be assigned by IANA) 338 Description: Hash-based digital signatures 340 Reference: This document (Number to be assigned by RFC Editor) 342 Recommended: Yes 344 7.2. COSE Key Types Registry Entry 346 The new entry in the "COSE Key Types" registry has the following 347 columns: 349 Name: HASHSIG 351 Value: TBD (Value to be assigned by IANA) 353 Description: Hash-based digital signature public key 355 Reference: This document (Number to be assigned by RFC Editor) 357 8. References 359 8.1. Normative References 361 [HASHSIG] McGrew, D., M. Curcio, and S. Fluhrer, "Hash-Based 362 Signatures", Work in progress. 365 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 366 Requirement Levels", BCP 14, RFC 2119, DOI 367 10.17487/RFC2119, March 1997, . 370 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 371 RFC 8152, DOI 10.17487/RFC8152, July 2017, 372 . 374 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in 375 RFC 2119 Key Words", BCP 14, RFC 8174, DOI 376 10.17487/RFC8174, May 2017, . 379 [SHS] National Institute of Standards and Technology (NIST), 380 FIPS Publication 180-3: Secure Hash Standard, October 381 2008. 383 8.2. Informative References 385 [BH2013] Ptacek, T., T. Ritter, J. Samuel, and A. Stamos, "The 386 Factoring Dead: Preparing for the Cryptopocalypse", August 387 2013. 390 [LM] Leighton, T. and S. Micali, "Large provably fast and 391 secure digital signature schemes from secure hash 392 functions", U.S. Patent 5,432,852, July 1995. 394 [M1979] Merkle, R., "Secrecy, Authentication, and Public Key 395 Systems", Stanford University Information Systems 396 Laboratory Technical Report 1979-1, 1979. 398 [M1987] Merkle, R., "A Digital Signature Based on a Conventional 399 Encryption Function", Lecture Notes in Computer Science 400 crypto87, 1988. 402 [M1989a] Merkle, R., "A Certified Digital Signature", Lecture Notes 403 in Computer Science crypto89, 1990. 405 [M1989b] Merkle, R., "One Way Hash Functions and DES", Lecture Notes 406 in Computer Science crypto89, 1990. 408 [PQC] Bernstein, D., "Introduction to post-quantum 409 cryptography", 2009. 410 413 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 414 "Randomness Requirements for Security", BCP 106, RFC 4086, 415 DOI 10.17487/RFC4086, June 2005, . 418 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 419 Housley, R., and W. Polk, "Internet X.509 Public Key 420 Infrastructure Certificate and Certificate Revocation List 421 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 422 . 424 Author's Address 426 Russ Housley 427 Vigil Security, LLC 428 918 Spring Knoll Drive 429 Herndon, VA 20170 430 USA 432 EMail: housley@vigilsec.com