Use of the HSS/LMS Hash-Based Signature Algorithm in the Cryptographic Message Syntax (CMS)Vigil Security, LLC516 Dranesville RoadHerndonVA20170United States of Americahousley@vigilsec.com
This document specifies the conventions for using the Hierarchical
Signature System (HSS) / Leighton-Micali Signature (LMS) hash-based
signature algorithm with the Cryptographic Message Syntax (CMS). In
addition, the algorithm identifier and public key syntax are
provided. The HSS/LMS algorithm is one form of hash-based digital
signature; it is described in RFC 8554.Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by
the Internet Engineering Steering Group (IESG). Further
information on Internet Standards is available in Section 2 of
RFC 7841.
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
.
Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
() in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with
respect to this document. Code Components extracted from this
document must include Simplified BSD License text as described in
Section 4.e of the Trust Legal Provisions and are provided without
warranty as described in the Simplified BSD License.
Table of Contents
Introduction
This document specifies the conventions for using the Hierarchical
Signature System (HSS) / Leighton-Micali Signature (LMS) hash-based
signature algorithm with the Cryptographic Message Syntax (CMS)
signed-data content type. The LMS system provides a one-time digital
signature that is a variant of Merkle Tree Signatures (MTS). The HSS
is built on top of the LMS system to efficiently scale for a larger
numbers of signatures. The HSS/LMS algorithm is one form of hash-based digital signature, and it is described in . The
HSS/LMS signature algorithm can only be used for a fixed number of
signing operations with a given private key, and the number of
signing operations depends upon the size of the tree. The HSS/LMS
signature algorithm uses small public keys, and it has low
computational cost; however, the signatures are quite large. The
HSS/LMS private key can be very small when the signer is willing to
perform additional computation at signing time; alternatively, the
private key can consume additional memory and provide a faster
signing time. The HSS/LMS signatures are currently defined
to exclusively use SHA-256 .ASN.1
CMS values are generated using ASN.1 , using the Basic
Encoding Rules (BER) and the Distinguished Encoding Rules (DER)
.Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14
when, and only when, they appear in all capitals, as shown here.
Motivation
Recent advances in cryptanalysis and progress in the
development of quantum computers pose a threat to widely
deployed digital signature algorithms. As a result, there is a need
to prepare for a day when cryptosystems such as RSA and DSA that
depend on discrete logarithms and factoring cannot be depended upon.
If large-scale quantum computers are ever built, these computers will
be able to break many of the public key cryptosystems currently in
use. A post-quantum cryptosystem is a system that is secure
against quantum computers that have more than a trivial number of
quantum bits (qubits). It is open to conjecture when it will be
feasible to build such computers; however, RSA, DSA, Elliptic Curve Digital
Signature Algorithm (ECDSA), and Edwards-curve Digital Signature Algorithm (EdDSA)
are all vulnerable if large-scale quantum computers are ever developed.
Since the HSS/LMS signature algorithm does not depend on the
difficulty of discrete logarithms or factoring, the HSS/LMS signature
algorithm is considered to be post-quantum secure. One use of post-quantum-secure signatures is the protection of software updates,
perhaps using the format described in , to enable deployment
of software that implements new cryptosystems.HSS/LMS Hash-Based Signature Algorithm Overview
Merkle Tree Signatures (MTS) are a method for signing a large but
fixed number of messages. An MTS system depends on a one-time
signature method and a collision-resistant hash function.
This specification makes use of the hash-based algorithm specified in
, which is the Leighton and Micali adaptation of the
original Lamport-Diffie-Winternitz-Merkle one-time signature system
.
As implied by the name, the hash-based signature algorithm depends on
a collision-resistant hash function. The hash-based signature
algorithm specified in uses only the SHA-256 one-way hash
function , but it establishes an IANA registry to
permit the registration of additional one-way hash functions in the
future.Hierarchical Signature System (HSS)
The MTS system specified in uses a hierarchy of trees. The
N-time Hierarchical Signature System (HSS) allows subordinate trees
to be generated when needed by the signer. Otherwise, generation of
the entire tree might take weeks or longer.
An HSS signature as specified in carries the number of
signed public keys (Nspk), followed by that number of signed public
keys, followed by the LMS signature as described in . The
public key for the topmost LMS tree is the public key of the HSS
system. The LMS private key in the parent tree signs the LMS public
key in the child tree, and the LMS private key in the bottom-most
tree signs the actual message. The signature over the public key and
the signature over the actual message are LMS signatures as described
in .
The elements of the HSS signature value for a standalone tree (a top
tree with no children) can be summarized as:
u32str(0) ||
lms_signature /* signature of message */
where, u32str() and || are used as defined in .
The elements of the HSS signature value for a tree with Nspk signed
public keys can be summarized as:
u32str(Nspk) ||
signed_public_key[0] ||
signed_public_key[1] ||
...
signed_public_key[Nspk-2] ||
signed_public_key[Nspk-1] ||
lms_signature /* signature of message */
where, as defined in , the signed_public_key
structure contains the lms_signature over the public key, followed by
the public key itself. Note that Nspk is the number of levels in the
hierarchy of trees minus 1.Leighton-Micali Signature (LMS)
Each tree in the system specified in uses the Leighton-Micali Signature (LMS) system. LMS systems have two parameters. The
first parameter is the height of the tree, h, which is the number of
levels in the tree minus one. The specification supports
five values for this parameter: h=5, h=10, h=15, h=20, and h=25.
Note that there are 2^h leaves in the tree. The second parameter, m,
is the number of bytes output by the hash function, and it is the
amount of data associated with each node in the tree. The
specification supports only the SHA-256 hash function , with
m=32. As a result, the specification supports five tree
sizes; they are identified as:
LMS_SHA256_M32_H5
LMS_SHA256_M32_H10
LMS_SHA256_M32_H15
LMS_SHA256_M32_H20
LMS_SHA256_M32_H25
The specification establishes an IANA registry
to permit the registration of additional hash functions and
additional tree sizes in the future.
As specified in , the LMS public key consists of four
elements: the lms_algorithm_type from the list above, the otstype to
identify the Leighton-Micali One-Time Signature (LM-OTS) type as discussed in , the private key
identifier (I) as described in , and the m-byte string associated with the root node of the tree (T[1]).
The LMS public key can be summarized as:
u32str(lms_algorithm_type) || u32str(otstype) || I || T[1]
As specified in ,
an LMS signature consists of four
elements: the number of the leaf (q) associated with the LM-OTS
signature value, an LM-OTS signature value as described in
, a
typecode indicating the particular LMS algorithm, and an array of
values that is associated with the path through the tree from the
leaf associated with the LM-OTS signature value to the root. The array of
values contains the siblings of the nodes on the path from the leaf
to the root but does not contain the nodes on the path itself. The
array for a tree with height h will have h values. The first value
is the sibling of the leaf, the next value is the sibling of the
parent of the leaf, and so on up the path to the root.
The four elements of the LMS signature value can be summarized as:
u32str(q) ||
ots_signature ||
u32str(type) ||
path[0] || path[1] || ... || path[h-1]
Leighton-Micali One-Time Signature (LM-OTS) Algorithm
Merkle Tree Signatures (MTS) depend on a one-time signature method,
and specifies the use of the LM-OTS, which has five
parameters:
n:
The length in bytes of the hash function output. supports only SHA-256 , with n=32.
H:
A preimage-resistant hash function that accepts byte strings of any length and returns an n-byte string.
w:
The width in bits of the Winternitz coefficients. supports four values for this parameter: w=1, w=2, w=4, and w=8.
p:
The number of n-byte string elements that make up the LM-OTS signature value.
ls:
The number of bits that are left-shifted in the final step of
the checksum function, which is defined in .
The values of p and ls are dependent on the choices of the parameters
n and w, as described in .
The specification supports four LM-OTS variants:
LMOTS_SHA256_N32_W1
LMOTS_SHA256_N32_W2
LMOTS_SHA256_N32_W4
LMOTS_SHA256_N32_W8
The specification establishes an IANA registry
to permit the registration of additional variants in the future.
Signing involves the generation of C, an n-byte random value.
The LM-OTS signature value can be summarized as the identifier of the
LM-OTS variant, the random value, and a sequence of hash values (y[0]
through y[p-1]) that correspond to the elements of the public key, as
described in :
u32str(otstype) || C || y[0] || ... || y[p-1]
Algorithm Identifiers and Parameters
The algorithm identifier for an HSS/LMS hash-based signature is:
id-alg-hss-lms-hashsig OBJECT IDENTIFIER ::= { iso(1)
member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
smime(16) alg(3) 17 }
When this object identifier is used for an HSS/LMS signature, the
AlgorithmIdentifier parameters field MUST be absent (that is, the
parameters are not present, and the parameters are not set to NULL).
The signature value is a large OCTET STRING, as described in
of this document. The signature format is designed for easy parsing.
The HSS, LMS, and LM-OTS components of the signature value each
include a counter and a typecode that indirectly provide all of the
information
that is needed to parse the value during signature validation.
The signature value identifies the hash function used in the HSS/LMS
tree. uses only the SHA-256 hash function , but it
establishes an IANA registry to permit the registration of
additional hash functions in the future.HSS/LMS Public Key Identifier
The AlgorithmIdentifier for an HSS/LMS public key uses the id-alg-hss-lms-hashsig object identifier, and the parameters field MUST be
absent.
When this AlgorithmIdentifier appears in the SubjectPublicKeyInfo
field of an X.509 certificate , the certificate key usage
extension MAY contain digitalSignature, nonRepudiation, keyCertSign,
and cRLSign; however, it MUST NOT contain other values.
pk-HSS-LMS-HashSig PUBLIC-KEY ::= {
IDENTIFIER id-alg-hss-lms-hashsig
KEY HSS-LMS-HashSig-PublicKey
PARAMS ARE absent
CERT-KEY-USAGE
{ digitalSignature, nonRepudiation, keyCertSign, cRLSign } }
HSS-LMS-HashSig-PublicKey ::= OCTET STRING
Note that the id-alg-hss-lms-hashsig algorithm identifier is also
referred to as id-alg-mts-hashsig. This synonym is based on the
terminology used in an early draft version of the document that became
.
The public key value is an OCTET STRING. Like the signature format,
it is designed for easy parsing. The value is the number of levels
in the public key, L, followed by the LMS public key.
The HSS/LMS public key value can be described as:
u32str(L) || lms_public_key
Note that the public key for the topmost LMS tree is the public key
of the HSS system. When L=1, the HSS system is a single tree.Signed-Data Conventions
As specified in , the digital signature is produced from the
message digest and the signer's private key. The signature is
computed over different values depending on whether signed attributes
are absent or present.
When signed attributes are absent, the HSS/LMS signature is computed
over the content. When signed attributes are present, a hash is
computed over the content using the same hash function that is used
in the HSS/LMS tree, then a message-digest attribute is constructed with
the hash of the content, and then the HSS/LMS
signature is computed over the DER-encoded set of signed attributes
(which MUST include a content-type attribute and a message-digest
attribute). In summary:
IF (signed attributes are absent)
THEN HSS_LMS_Sign(content)
ELSE message-digest attribute = Hash(content);
HSS_LMS_Sign(DER(SignedAttributes))
When using , the fields in the SignerInfo are used as
follows:
digestAlgorithm MUST contain the one-way hash function used in the
HSS/LMS tree. In , SHA-256 is the only supported hash
function, but other hash functions might be registered in the
future. For convenience, the AlgorithmIdentifier for SHA-256
from is repeated here:
signatureAlgorithm MUST contain id-alg-hss-lms-hashsig, and the
algorithm parameters field MUST be absent.
signature contains the single HSS signature value resulting from
the signing operation as specified in .
Security Considerations
Implementations MUST protect the private keys. Compromise of the
private keys may result in the ability to forge signatures. Along
with the private key, the implementation MUST keep track of which
leaf nodes in the tree have been used. Loss of integrity of this
tracking data can cause a one-time key to be used more than once. As
a result, when a private key and the tracking data are stored on non-volatile media or in a virtual machine environment, failed
writes, virtual machine snapshotting or cloning, and other
operational concerns must be considered to ensure confidentiality and
integrity.
When generating an LMS key pair, an implementation MUST generate each
key pair independently of all other key pairs in the HSS tree.
An implementation MUST ensure that an LM-OTS private key is used to
generate a signature only one time and ensure that it cannot be used
for any other purpose.
The generation of private keys relies on random numbers. The use of
inadequate pseudorandom number generators (PRNGs) to generate these
values can result in little or no security. An attacker may find it
much easier to reproduce the PRNG environment that produced the keys,
searching the resulting small set of possibilities, rather than brute-force searching the whole key space. The generation of quality
random numbers is difficult, and offers important guidance
in this area.
The generation of hash-based signatures also depends on random
numbers. While the consequences of an inadequate pseudorandom
number generator (PRNG) to generate these values is much less severe
than in the generation of private keys, the guidance in
remains important.
When computing signatures, the same hash function SHOULD be used to
compute the message digest of the content and the signed attributes, if they are present.IANA Considerations
In the "SMI Security for S/MIME Module Identifier (1.2.840.113549.1.9.16.0)"
registry, IANA has updated the reference for value 64 to point to this
document.
In the "SMI Security for S/MIME Algorithms (1.2.840.113549.1.9.16.3)"
registry, IANA has updated the description for value 17 to
"id-alg-hss-lms-hashsig" and updated the reference to point to this
document.
IANA has also added the following note to the "SMI Security for S/MIME
Algorithms (1.2.840.113549.1.9.16.3)" registry:
Value 17, "id-alg-hss-lms-hashsig", is also referred to as
"id-alg-mts-hashsig".
ReferencesNormative ReferencesInformation technology -- Abstract Syntax Notation One (ASN.1): Specification of basic notationITU-TInformation technology -- ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)ITU-TCryptographic Message Syntax (CMS)This document describes the Cryptographic Message Syntax (CMS). This syntax is used to digitally sign, digest, authenticate, or encrypt arbitrary message content. [STANDARDS-TRACK]Leighton-Micali Hash-Based SignaturesThis note describes a digital-signature system based on cryptographic hash functions, following the seminal work in this area of Lamport, Diffie, Winternitz, and Merkle, as adapted by Leighton and Micali in 1995. It specifies a one-time signature scheme and a general signature scheme. These systems provide asymmetric authentication without using large integer mathematics and can achieve a high security level. They are suitable for compact implementations, are relatively simple to implement, and are naturally resistant to side-channel attacks. Unlike many other signature systems, hash-based signatures would still be secure even if it proves feasible for an attacker to build a quantum computer.This document is a product of the Crypto Forum Research Group (CFRG) in the IRTF. This has been reviewed by many researchers, both in the research group and outside of it. The Acknowledgements section lists many of them.Key words for use in RFCs to Indicate Requirement LevelsIn many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) ProfileThis memo profiles the X.509 v3 certificate and X.509 v2 certificate revocation list (CRL) for use in the Internet. An overview of this approach and model is provided as an introduction. The X.509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms. Standard certificate extensions are described and two Internet-specific extensions are defined. A set of required certificate extensions is specified. The X.509 v2 CRL format is described in detail along with standard and Internet-specific extensions. An algorithm for X.509 certification path validation is described. An ASN.1 module and examples are provided in the appendices. [STANDARDS-TRACK]Ambiguity of Uppercase vs Lowercase in RFC 2119 Key WordsRFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.Secure Hash Standard (SHS)National Institute of Standards and Technology (NIST)Informative ReferencesThe Factoring Dead: Preparing for the CryptopocalypseNew ASN.1 Modules for Cryptographic Message Syntax (CMS) and S/MIMEThe Cryptographic Message Syntax (CMS) format, and many associated formats, are expressed using ASN.1. The current ASN.1 modules conform to the 1988 version of ASN.1. This document updates those ASN.1 modules to conform to the 2002 version of ASN.1. There are no bits-on-the-wire changes to any of the formats; this is simply a change to the syntax. This document is not an Internet Standards Track specification; it is published for informational purposes.Additional New ASN.1 Modules for the Cryptographic Message Syntax (CMS) and the Public Key Infrastructure Using X.509 (PKIX)The Cryptographic Message Syntax (CMS) format, and many associated formats, are expressed using ASN.1. The current ASN.1 modules conform to the 1988 version of ASN.1. This document updates some auxiliary ASN.1 modules to conform to the 2008 version of ASN.1; the 1988 ASN.1 modules remain the normative version. There are no bits- on-the-wire changes to any of the formats; this is simply a change to the syntax. This document is not an Internet Standards Track specification; it is published for informational purposes.Using Cryptographic Message Syntax (CMS) to Protect Firmware PackagesThis document describes the use of the Cryptographic Message Syntax (CMS) to protect firmware packages, which provide object code for one or more hardware module components. CMS is specified in RFC 3852. A digital signature is used to protect the firmware package from undetected modification and to provide data origin authentication. Encryption is optionally used to protect the firmware package from disclosure, and compression is optionally used to reduce the size of the protected firmware package. A firmware package loading receipt can optionally be generated to acknowledge the successful loading of a firmware package. Similarly, a firmware package load error report can optionally be generated to convey the failure to load a firmware package. [STANDARDS-TRACK]Leighton-Micali Signatures (LMS)IANALarge provably fast and secure digital signature schemes based on secure hash functionsSecrecy, Authentication, and Public Key SystemsA Digital Signature Based on a Conventional Encryption FunctionAdvances in Cryptology -- CRYPTO '87 ProceedingsLecture Notes in Computer Science Vol. 293A Certified Digital SignatureAdvances in Cryptology -- CRYPTO '89 ProceedingsLecture Notes in Computer Science Vol. 435One Way Hash Functions and DESAdvances in Cryptology -- CRYPTO '89 ProceedingsLecture Notes in Computer Science Vol. 435Quantum Computing: Progress and ProspectsNational Academies of Sciences, Engineering, and MedicineThe National Academies PressNew ASN.1 Modules for the Public Key Infrastructure Using X.509 (PKIX)The Public Key Infrastructure using X.509 (PKIX) certificate format, and many associated formats, are expressed using ASN.1. The current ASN.1 modules conform to the 1988 version of ASN.1. This document updates those ASN.1 modules to conform to the 2002 version of ASN.1. There are no bits-on-the-wire changes to any of the formats; this is simply a change to the syntax. This document is not an Internet Standards Track specification; it is published for informational purposes.Introduction to post-quantum cryptographyRandomness Requirements for SecuritySecurity systems are built on strong cryptographic algorithms that foil pattern analysis attempts. However, the security of these systems is dependent on generating secret quantities for passwords, cryptographic keys, and similar quantities. The use of pseudo-random processes to generate secret quantities can result in pseudo-security. A sophisticated attacker may find it easier to reproduce the environment that produced the secret quantities and to search the resulting small set of possibilities than to locate the quantities in the whole of the potential number space.Choosing random quantities to foil a resourceful and motivated adversary is surprisingly difficult. This document points out many pitfalls in using poor entropy sources or traditional pseudo-random number generation techniques for generating such quantities. It recommends the use of truly random hardware techniques and shows that the existing hardware on many systems can be used for this purpose. It provides suggestions to ameliorate the problem when a hardware solution is not available, and it gives examples of how large such quantities need to be for some applications. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.ASN.1 Module
<CODE STARTS>
MTS-HashSig-2013
{ iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
id-smime(16) id-mod(0) id-mod-mts-hashsig-2013(64) }
DEFINITIONS IMPLICIT TAGS ::= BEGIN
EXPORTS ALL;
IMPORTS
PUBLIC-KEY, SIGNATURE-ALGORITHM, SMIME-CAPS
FROM AlgorithmInformation-2009 -- RFC 5911 [CMSASN1]
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-algorithmInformation-02(58) } ;
--
-- Object Identifiers
--
id-alg-hss-lms-hashsig OBJECT IDENTIFIER ::= { iso(1)
member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
smime(16) alg(3) 17 }
id-alg-mts-hashsig OBJECT IDENTIFIER ::= id-alg-hss-lms-hashsig
--
-- Signature Algorithm and Public Key
--
sa-HSS-LMS-HashSig SIGNATURE-ALGORITHM ::= {
IDENTIFIER id-alg-hss-lms-hashsig
PARAMS ARE absent
PUBLIC-KEYS { pk-HSS-LMS-HashSig }
SMIME-CAPS { IDENTIFIED BY id-alg-hss-lms-hashsig } }
pk-HSS-LMS-HashSig PUBLIC-KEY ::= {
IDENTIFIER id-alg-hss-lms-hashsig
KEY HSS-LMS-HashSig-PublicKey
PARAMS ARE absent
CERT-KEY-USAGE
{ digitalSignature, nonRepudiation, keyCertSign, cRLSign } }
HSS-LMS-HashSig-PublicKey ::= OCTET STRING
--
-- Expand the signature algorithm set used by CMS [CMSASN1U]
--
SignatureAlgorithmSet SIGNATURE-ALGORITHM ::=
{ sa-HSS-LMS-HashSig, ... }
--
-- Expand the S/MIME capabilities set used by CMS [CMSASN1]
--
SMimeCaps SMIME-CAPS ::=
{ sa-HSS-LMS-HashSig.&smimeCaps, ... }
END
<CODE ENDS>
Acknowledgements
Many thanks to , , , , , , ,
, ,
, , and for their careful review and
comments.Author's AddressVigil Security, LLC516 Dranesville RoadHerndonVA20170United States of Americahousley@vigilsec.com