idnits 2.17.00 (12 Aug 2021) /tmp/idnits38293/draft-housley-cms-mts-hash-sig-03.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 == Line 183 has weird spacing: '...e value conta...' -- The document date (18 October 2015) is 2406 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) == Unused Reference: 'PQC' is defined on line 336, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'ASN1-02' -- Possible downref: Non-RFC (?) normative reference: ref. 'HASHSIG' -- Possible downref: Non-RFC (?) normative reference: ref. 'SHS' Summary: 0 errors (**), 0 flaws (~~), 3 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: Proposed Standard Vigil Security 4 Expires: 20 April 2016 18 October 2015 6 Use of the Hash-based Merkle Tree Signature (MTS) Algorithm 7 in the Cryptographic Message Syntax (CMS) 8 10 Abstract 12 This document specifies the conventions for using the Merkle Tree 13 Signatures (MTS) digital signature algorithm with the Cryptographic 14 Message Syntax (CMS). The MTS algorithm is one form of hash-based 15 digital signature. 17 Status of this Memo 19 This Internet-Draft is submitted to IETF in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF), its areas, and its working groups. Note that 24 other groups may also distribute working documents as Internet- 25 Drafts. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 The list of current Internet-Drafts can be accessed at 33 http://www.ietf.org/1id-abstracts.html 35 The list of Internet-Draft Shadow Directories can be accessed at 36 http://www.ietf.org/shadow.html 38 Copyright and License Notice 40 Copyright (c) 2015 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 56 1.1. MTS Digital Signature Algorithm . . . . . . . . . . . . . 3 57 1.2. LM-OTS One-time Signature Algorithm . . . . . . . . . . . 4 58 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 59 2. Algorithm Identifiers and Parameters . . . . . . . . . . . . . 4 60 3. Signed-data Conventions . . . . . . . . . . . . . . . . . . . 5 61 4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 62 4.1. Implementation Security Considerations . . . . . . . . . . 6 63 4.2. Algorithm Security Considerations . . . . . . . . . . . . 6 64 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 65 6. Normative References . . . . . . . . . . . . . . . . . . . . . 7 66 7. Informative References . . . . . . . . . . . . . . . . . . . . 7 67 Appendix: ASN.1 Module . . . . . . . . . . . . . . . . . . . . . . 8 68 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 1. Introduction 72 This document specifies the conventions for using the Merkle Tree 73 Signatures (MTS) digital signature algorithm with the Cryptographic 74 Message Syntax (CMS) [CMS] signed-data content type. The MTS 75 algorithm is one form of hash-based digital signature that can only 76 be used for a fixed number of signatures. The MTS algorithm is 77 described in [HASHSIG]. The MTS algorithm uses small private and 78 public keys, and it has low computational cost; however, the 79 signatures are quite large. 81 CMS values are generated using ASN.1 [ASN1-02], using the Basic 82 Encoding Rules (BER) and the Distinguished Encoding Rules (DER). 84 1.1. MTS Digital Signature Algorithm 86 Merkle Tree Signatures (MTS) are a method for signing a large but 87 fixed number of messages. An MTS system is an N-time signature 88 system, meaning that the private key can be used to generate at most 89 N signatures. 91 An MTS system uses two cryptographic components: a one-time signature 92 method and a collision-resistant hash function. Each MTS 93 public/private key pair is associated with a k-way tree. Each leaf 94 of the tree can be used to generate a one-time signature (OTS), which 95 can be used to securely sign exactly one message, but cannot securely 96 sign more than one. 98 This specification makes use of the MTS algorithm specified in 99 [HASHSIG], which is the Leighton and Micali adaptation [LM] of the 100 original Lamport-Diffie-Winternitz-Merkle one-time signature system 101 [M1979][M1987][M1989a][M1989b]. It makes use of the LM-OTS one-time 102 signature scheme and the SHA-256 [SHS] one-way hash function. 104 An LMS system has two parameters. The height of the tree, h, which 105 is the number of levels in the tree minus one. The [HASHSIG] 106 specification supports three values for this parameter: h=20; h=10; 107 and h=5. The number of bytes associated with each node in the tree, 108 n, is defined by the hash function. The [HASHSIG] specification 109 supports two hash functions: SHA-256 [SHS], with n=32; and 110 SHA-256-16, which is the same as SHA-256, except that the hash result 111 is truncated to 16 bytes, with n=16. Note that there are 2^h leaves 112 in the tree. 114 Six tree sizes are specified in [HASHSIG]: 115 lms_sha256_n32_h20; 116 lms_sha256_n32_h10; 117 lms_sha256_n32_h5; 118 lms_sha256_n16_h20; 119 lms_sha256_n16_h10; and 120 lms_sha256_n16_h5. 122 An LMS signature consists of three things: a typecode indicating the 123 particular LMS algorithm, an LM-OTS signature, and an array of values 124 that is associated with the path through the tree from the leaf 125 associated with the LM-OTS signature to the root. The array of 126 values contains the siblings of the nodes on the path from the leaf 127 to the root but does not contain the nodes on the path itself. The 128 array for a tree with height h will have h values. The first value 129 is the sibling of the leaf, the next value is the sibling of the 130 parent of the leaf, and so on up the path to the root. 132 1.2. LM-OTS One-time Signature Algorithm 134 Merkle Tree Signatures (MTS) depend on a LM-OTS one-time signature 135 method. An LM-OTS has four parameters. The number of bytes 136 associated with the has function, n, which is the same as the LMS 137 parameter. Again, the [HASHSIG] specification supports two hash 138 functions: SHA-256 [SHS], with n=32; and SHA-256-16, with n=16. The 139 the Winternitz parameter, w. The [HASHSIG] specification supports 140 four values for this parameter: w=1; w=2; w=4; and w=8. The number 141 of n-byte string elements that make up the LM-OTS signature, p. The 142 number of left-shift bits used in the checksum function, ls. The 143 values of p and ls are dependent on the choices of the parameters n 144 and w, as described in Appendix A of [HASHSIG]. 146 Eight LM-OTS variants are defined in [HASHSIG]: 147 LMOTS_SHA256_N32_W1; 148 LMOTS_SHA256_N32_W2; 149 LMOTS_SHA256_N32_W4; 150 LMOTS_SHA256_N32_W8; 151 LMOTS_SHA256_N16_W1; 152 LMOTS_SHA256_N16_W2; 153 LMOTS_SHA256_N16_W4; and 154 LMOTS_SHA256_N16_W8. 156 1.3. Terminology 158 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 159 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 160 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 162 2. Algorithm Identifiers and Parameters 164 The algorithm identifier for an MTS signature is id-alg-mts-hashsig: 166 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 167 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 } 169 id-alg OBJECT IDENTIFIER ::= { id-smime 3 } 171 id-alg-mts-hashsig OBJECT IDENTIFIER ::= { id-alg 17 } 173 When the id-alg-mts-hashsig algorithm identifier is used for a 174 signature, the AlgorithmIdentifier parameters field MUST be absent. 176 The first 4 bytes of the signature value contains the 177 mls_algorithm_type as defined in Section 5.5 of [HASHSIG]. This type 178 tells how to parse the remaining parts of the signature value, which 179 is composed of an LM-OTS signature and an array of values that is 180 associated with the path through the tree from the leaf associated 181 with the LM-OTS signature to the root. 183 The first 4 bytes of the LM-OTS signature value contains the 184 ots_algorithm_type as defined in Section 4.10 of [HASHSIG]. This 185 type is followed by n*p bytes of signature value. 187 The signature format is designed for easy parsing. Each format 188 starts with a 4-byte enumeration value that indicates all of the 189 details of the signature algorithm, indirectly providing all of the 190 information that is needed to parse the value during signature 191 validation. 193 3. Signed-data Conventions 195 digestAlgorithms SHOULD contain the one-way hash function used to 196 compute the message digest on the eContent value. Since the hash- 197 based signature algorithms all depend on SHA-256, it is strongly 198 RECOMMENDED that SHA-256 also be used to compute the message digest 199 on the content. 201 Further, the same one-way hash function SHOULD be used to compute the 202 message digest on both the eContent and the signedAttributes value if 203 signedAttributes exist. Again, since the hash-based signature 204 algorithms all depend on SHA-256, it is strongly RECOMMENDED that 205 SHA-256 be used. 207 signatureAlgorithm MUST contain id-alg-mts-hashsig. The algorithm 208 parameters field MUST be absent. 210 signature contains the single value resulting from the signing 211 operation as specified in [HASHSIG]. 213 4. Security Considerations 215 4.1. Implementation Security Considerations 217 Implementations must protect the private keys. Compromise of the 218 private keys may result in the ability to forge signatures. Along 219 with the private key, the implementation must maintain a counter 220 value that indicates which leaf nodes in the tree have been used. 221 Loss of integrity of this counter can cause an one-time key to be 222 used more than once. As a result, when a private key and an 223 associated counter value are stored on non-volatile media or stored 224 in a virtual machine environment, care must be taken to preserve 225 these properties. 227 An implementation must ensure that a LDWM private key is used only 228 one time, and ensure that the LDWM private key cannot be used for any 229 other purpose. 231 The generation of private keys relies on random numbers. The use of 232 inadequate pseudo-random number generators (PRNGs) to generate these 233 values can result in little or no security. An attacker may find it 234 much easier to reproduce the PRNG environment that produced the keys, 235 searching the resulting small set of possibilities, rather than brute 236 force searching the whole key space. The generation of quality 237 random numbers is difficult. RFC 4086 [RANDOM] offers important 238 guidance in this area. 240 When computing signatures, the same hash function SHOULD be used for 241 all operations. This reduces the number of failure points in the 242 signature process. 244 4.2. Algorithm Security Considerations 246 At Black Hat USA 2013, some researchers gave a presentation on the 247 current sate of public key cryptography. They said: "Current 248 cryptosystems depend on discrete logarithm and factoring which has 249 seen some major new developments in the past 6 months" [BH2013]. 250 They encouraged preparation for a day when RSA and DSA cannot be 251 depended upon. 253 A post-quantum cryptosystem is a system that is secure against 254 quantum computers that have more than a trivial number of quantum 255 bits. It is open to conjecture whether it is feasible to build such 256 a machine. RSA, DSA, and ECDSA are not post-quantum secure. 258 The LM-OTP one-time signature and LMS do not depend on discrete 259 logarithm or factoring, and these algorithms are considered to be 260 post-quantum secure. 262 Today, RSA is often used to digitally sign software updates. This 263 means that the distribution of software updates could be compromised 264 if a significant advance is made in factoring or a quantum computer 265 is invented. The use of MTS signatures to protect software update 266 distribution, perhaps using the format described in [FWPROT], will 267 allow the deployment of software that implements new cryptosystems. 269 5. IANA Considerations 271 {{ RFC Editor: Please remove this section prior to publication. }} 273 This document has no actions for IANA. 275 6. Normative References 277 [ASN1-02] ITU-T, "ITU-T Recommendation X.680, X.681, X.682, and 278 X.683", ITU-T X.680, X.681, X.682, and X.683, 2002. 280 [CMS] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 281 RFC 5652, DOI 10.17487/RFC5652, September 2009, 282 . 284 [HASHSIG] McGrew, D., and M. Curcio, "Hash-Based Signatures", Work 285 in progress. 287 [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate 288 Requirement Levels", BCP 14, RFC 2119, DOI 289 10.17487/RFC2119, March 1997, . 292 [SHS] National Institute of Standards and Technology (NIST), 293 FIPS Publication 180-3: Secure Hash Standard, October 294 2008. 296 7. Informative References 298 [BH2013] Ptacek, T., T. Ritter, J. Samuel, and A. Stamos, "The 299 Factoring Dead: Preparing for the Cryptopocalypse", August 300 2013. 303 [CMSASN1] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 304 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 305 DOI 10.17487/RFC5911, June 2010, . 308 [FWPROT] Housley, R., "Using Cryptographic Message Syntax (CMS) to 309 Protect Firmware Packages", RFC 4108, DOI 310 10.17487/RFC4108, August 2005, . 313 [LM] Leighton, T. and S. Micali, "Large provably fast and 314 secure digital signature schemes from secure hash 315 functions", U.S. Patent 5,432,852, July 1995. 317 [M1979] Merkle, R., "Secrecy, Authentication, and Public Key 318 Systems", Stanford University Information Systems 319 Laboratory Technical Report 1979-1, 1979. 321 [M1987] Merkle, R., "A Digital Signature Based on a Conventional 322 Encryption Function", Lecture Notes in Computer Science 323 crypto87, 1988. 325 [M1989a] Merkle, R., "A Certified Digital Signature", Lecture Notes 326 in Computer Science crypto89, 1990. 328 [M1989b] Merkle, R., "One Way Hash Functions and DES", Lecture Notes 329 in Computer Science crypto89, 1990. 331 [PKIXASN1] Hoffman, P. and J. Schaad, "New ASN.1 Modules for the 332 Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, 333 DOI 10.17487/RFC5912, June 2010, . 336 [PQC] Bernstein, D., "Introduction to post-quantum 337 cryptography", 2009. 338 341 [RANDOM] Eastlake 3rd, D., Schiller, J., and S. Crocker, 342 "Randomness Requirements for Security", BCP 106, RFC 4086, 343 DOI 10.17487/RFC4086, June 2005, . 346 Appendix: ASN.1 Module 348 MTS-HashSig-2013 349 { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) 350 id-smime(16) id-mod(0) id-mod-mts-hashsig-2013(64) } 352 DEFINITIONS EXPLICIT TAGS ::= BEGIN 354 EXPORTS ALL; 356 IMPORTS 357 SIGNATURE-ALGORITHM PUBLIC-KEY 358 FROM AlgorithmInformation-2009 -- RFC 5911 [CMSASN1] 359 { iso(1) identified-organization(3) dod(6) internet(1) 360 security(5) mechanisms(5) pkix(7) id-mod(0) 361 id-mod-algorithmInformation-02(58) } 363 mda-sha256 364 FROM PKIX1-PSS-OAEP-Algorithms-2009 -- RFC 5912 [PKIXASN1] 365 { iso(1) identified-organization(3) dod(6) 366 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 367 id-mod-pkix1-rsa-pkalgs-02(54) } ; 369 -- 370 -- Object Identifiers 371 -- 373 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 374 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 } 376 id-alg OBJECT IDENTIFIER ::= { id-smime 3 } 378 id-alg-mts-hashsig OBJECT IDENTIFIER ::= { id-alg 17 } 380 -- 381 -- Signature Algorithm and Public Key 382 -- 384 sa-MTS-HashSig SIGNATURE-ALGORITHM ::= { 385 IDENTIFIER id-alg-mts-hashsig 386 HASHES { mda-sha256, ... } 387 PUBLIC-KEYS { pk-MTS-HashSig } } 389 pk-MTS-HashSig PUBLIC-KEY ::= { 390 IDENTIFIER id-alg-mts-hashsig 391 KEY MTS-HashSig-PublicKey } 393 MTS-HashSig-PublicKey ::= OCTET STRING 395 HashSignatureAlgs SIGNATURE-ALGORITHM ::= { 396 sa-MTS-HashSig, ... } 398 END 400 Author's Address 402 Russ Housley 403 Vigil Security, LLC 404 918 Spring Knoll Drive 405 Herndon, VA 20170 406 USA 408 EMail: housley@vigilsec.com