idnits 2.17.00 (12 Aug 2021) /tmp/idnits42414/draft-housley-cms-mts-hash-sig-04.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 191 has weird spacing: '...e value conta...' -- The document date (21 March 2016) is 2251 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 345, 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: 21 September 2016 21 March 2016 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. 137 n - The number of bytes associated with the hash function, which 138 is the same as the LMS parameter. The [HASHSIG] 139 specification supports two hash functions: SHA-256 [SHS], 140 with n=32; and SHA-256-16, with n=16. 142 w - The the Winternitz parameter. The [HASHSIG] specification 143 supports four values for this parameter: w=1; w=2; w=4; and 144 w=8. 146 p - The number of n-byte string elements that make up the LM-OTS 147 signature. 149 ls - The number of left-shift bits used in the checksum function. 151 The values of p and ls are dependent on the choices of the parameters 152 n and w, as described in Appendix A of [HASHSIG]. 154 Eight LM-OTS variants are defined in [HASHSIG]: 155 LMOTS_SHA256_N32_W1; 156 LMOTS_SHA256_N32_W2; 157 LMOTS_SHA256_N32_W4; 158 LMOTS_SHA256_N32_W8; 159 LMOTS_SHA256_N16_W1; 160 LMOTS_SHA256_N16_W2; 161 LMOTS_SHA256_N16_W4; and 162 LMOTS_SHA256_N16_W8. 164 1.3. Terminology 166 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 167 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 168 document are to be interpreted as described in RFC 2119 [KEYWORDS]. 170 2. Algorithm Identifiers and Parameters 172 The algorithm identifier for an MTS signature is id-alg-mts-hashsig: 174 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 175 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 } 177 id-alg OBJECT IDENTIFIER ::= { id-smime 3 } 179 id-alg-mts-hashsig OBJECT IDENTIFIER ::= { id-alg 17 } 181 When the id-alg-mts-hashsig algorithm identifier is used for a 182 signature, the AlgorithmIdentifier parameters field MUST be absent. 184 The first 4 bytes of the signature value contains the 185 mls_algorithm_type as defined in Section 5.5 of [HASHSIG]. This type 186 tells how to parse the remaining parts of the signature value, which 187 is composed of an LM-OTS signature and an array of values that is 188 associated with the path through the tree from the leaf associated 189 with the LM-OTS signature to the root. 191 The first 4 bytes of the LM-OTS signature value contains the 192 ots_algorithm_type as defined in Section 4.10 of [HASHSIG]. This 193 type is followed by n*p bytes of signature value. 195 The signature format is designed for easy parsing. Each format 196 starts with a 4-byte enumeration value that indicates all of the 197 details of the signature algorithm, indirectly providing all of the 198 information that is needed to parse the value during signature 199 validation. 201 3. Signed-data Conventions 203 digestAlgorithms SHOULD contain the one-way hash function used to 204 compute the message digest on the eContent value. Since the hash- 205 based signature algorithms all depend on SHA-256, it is strongly 206 RECOMMENDED that SHA-256 also be used to compute the message digest 207 on the content. 209 Further, the same one-way hash function SHOULD be used to compute the 210 message digest on both the eContent and the signedAttributes value if 211 signedAttributes exist. Again, since the hash-based signature 212 algorithms all depend on SHA-256, it is strongly RECOMMENDED that 213 SHA-256 be used. 215 signatureAlgorithm MUST contain id-alg-mts-hashsig. The algorithm 216 parameters field MUST be absent. 218 signature contains the single value resulting from the signing 219 operation as specified in [HASHSIG]. 221 4. Security Considerations 223 4.1. Implementation Security Considerations 225 Implementations must protect the private keys. Compromise of the 226 private keys may result in the ability to forge signatures. Along 227 with the private key, the implementation must maintain a counter 228 value that indicates which leaf nodes in the tree have been used. 229 Loss of integrity of this counter can cause an one-time key to be 230 used more than once. As a result, when a private key and an 231 associated counter value are stored on non-volatile media or stored 232 in a virtual machine environment, care must be taken to preserve 233 these properties. 235 An implementation must ensure that a LDWM private key is used only 236 one time, and ensure that the LDWM private key cannot be used for any 237 other purpose. 239 The generation of private keys relies on random numbers. The use of 240 inadequate pseudo-random number generators (PRNGs) to generate these 241 values can result in little or no security. An attacker may find it 242 much easier to reproduce the PRNG environment that produced the keys, 243 searching the resulting small set of possibilities, rather than brute 244 force searching the whole key space. The generation of quality 245 random numbers is difficult. RFC 4086 [RANDOM] offers important 246 guidance in this area. 248 When computing signatures, the same hash function SHOULD be used for 249 all operations. This reduces the number of failure points in the 250 signature process. 252 4.2. Algorithm Security Considerations 254 At Black Hat USA 2013, some researchers gave a presentation on the 255 current sate of public key cryptography. They said: "Current 256 cryptosystems depend on discrete logarithm and factoring which has 257 seen some major new developments in the past 6 months" [BH2013]. 259 They encouraged preparation for a day when RSA and DSA cannot be 260 depended upon. 262 A post-quantum cryptosystem is a system that is secure against 263 quantum computers that have more than a trivial number of quantum 264 bits. It is open to conjecture whether it is feasible to build such 265 a machine. RSA, DSA, and ECDSA are not post-quantum secure. 267 The LM-OTP one-time signature and LMS do not depend on discrete 268 logarithm or factoring, and these algorithms are considered to be 269 post-quantum secure. 271 Today, RSA is often used to digitally sign software updates. This 272 means that the distribution of software updates could be compromised 273 if a significant advance is made in factoring or a quantum computer 274 is invented. The use of MTS signatures to protect software update 275 distribution, perhaps using the format described in [FWPROT], will 276 allow the deployment of software that implements new cryptosystems. 278 5. IANA Considerations 280 {{ RFC Editor: Please remove this section prior to publication. }} 282 This document has no actions for IANA. 284 6. Normative References 286 [ASN1-02] ITU-T, "ITU-T Recommendation X.680, X.681, X.682, and 287 X.683", ITU-T X.680, X.681, X.682, and X.683, 2002. 289 [CMS] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 290 RFC 5652, DOI 10.17487/RFC5652, September 2009, 291 . 293 [HASHSIG] McGrew, D., and M. Curcio, "Hash-Based Signatures", Work 294 in progress. 296 [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate 297 Requirement Levels", BCP 14, RFC 2119, DOI 298 10.17487/RFC2119, March 1997, . 301 [SHS] National Institute of Standards and Technology (NIST), 302 FIPS Publication 180-3: Secure Hash Standard, October 303 2008. 305 7. Informative References 307 [BH2013] Ptacek, T., T. Ritter, J. Samuel, and A. Stamos, "The 308 Factoring Dead: Preparing for the Cryptopocalypse", August 309 2013. 312 [CMSASN1] Hoffman, P. and J. Schaad, "New ASN.1 Modules for 313 Cryptographic Message Syntax (CMS) and S/MIME", RFC 5911, 314 DOI 10.17487/RFC5911, June 2010, . 317 [FWPROT] Housley, R., "Using Cryptographic Message Syntax (CMS) to 318 Protect Firmware Packages", RFC 4108, DOI 319 10.17487/RFC4108, August 2005, . 322 [LM] Leighton, T. and S. Micali, "Large provably fast and 323 secure digital signature schemes from secure hash 324 functions", U.S. Patent 5,432,852, July 1995. 326 [M1979] Merkle, R., "Secrecy, Authentication, and Public Key 327 Systems", Stanford University Information Systems 328 Laboratory Technical Report 1979-1, 1979. 330 [M1987] Merkle, R., "A Digital Signature Based on a Conventional 331 Encryption Function", Lecture Notes in Computer Science 332 crypto87, 1988. 334 [M1989a] Merkle, R., "A Certified Digital Signature", Lecture Notes 335 in Computer Science crypto89, 1990. 337 [M1989b] Merkle, R., "One Way Hash Functions and DES", Lecture Notes 338 in Computer Science crypto89, 1990. 340 [PKIXASN1] Hoffman, P. and J. Schaad, "New ASN.1 Modules for the 341 Public Key Infrastructure Using X.509 (PKIX)", RFC 5912, 342 DOI 10.17487/RFC5912, June 2010, . 345 [PQC] Bernstein, D., "Introduction to post-quantum 346 cryptography", 2009. 347 350 [RANDOM] Eastlake 3rd, D., Schiller, J., and S. Crocker, 351 "Randomness Requirements for Security", BCP 106, RFC 4086, 352 DOI 10.17487/RFC4086, June 2005, . 355 Appendix: ASN.1 Module 357 MTS-HashSig-2013 358 { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) 359 id-smime(16) id-mod(0) id-mod-mts-hashsig-2013(64) } 361 DEFINITIONS EXPLICIT TAGS ::= BEGIN 363 EXPORTS ALL; 365 IMPORTS 366 SIGNATURE-ALGORITHM PUBLIC-KEY 367 FROM AlgorithmInformation-2009 -- RFC 5911 [CMSASN1] 368 { iso(1) identified-organization(3) dod(6) internet(1) 369 security(5) mechanisms(5) pkix(7) id-mod(0) 370 id-mod-algorithmInformation-02(58) } 372 mda-sha256 373 FROM PKIX1-PSS-OAEP-Algorithms-2009 -- RFC 5912 [PKIXASN1] 374 { iso(1) identified-organization(3) dod(6) 375 internet(1) security(5) mechanisms(5) pkix(7) id-mod(0) 376 id-mod-pkix1-rsa-pkalgs-02(54) } ; 378 -- 379 -- Object Identifiers 380 -- 382 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 383 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 } 385 id-alg OBJECT IDENTIFIER ::= { id-smime 3 } 387 id-alg-mts-hashsig OBJECT IDENTIFIER ::= { id-alg 17 } 389 -- 390 -- Signature Algorithm and Public Key 391 -- 393 sa-MTS-HashSig SIGNATURE-ALGORITHM ::= { 394 IDENTIFIER id-alg-mts-hashsig 395 HASHES { mda-sha256, ... } 396 PUBLIC-KEYS { pk-MTS-HashSig } } 398 pk-MTS-HashSig PUBLIC-KEY ::= { 399 IDENTIFIER id-alg-mts-hashsig 400 KEY MTS-HashSig-PublicKey } 402 MTS-HashSig-PublicKey ::= OCTET STRING 404 HashSignatureAlgs SIGNATURE-ALGORITHM ::= { 405 sa-MTS-HashSig, ... } 407 END 409 Author's Address 411 Russ Housley 412 Vigil Security, LLC 413 918 Spring Knoll Drive 414 Herndon, VA 20170 415 USA 417 EMail: housley@vigilsec.com