Hash-based cryptography

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Hash-based cryptography is the generic term for constructions of cryptographic primitives based on the security of hash functions. So far, hash-based cryptography is limited to digital signatures schemes such as the Merkle signature scheme. Hash-based signature schemes combine a one-time signature scheme with a Merkle tree structure. Since a one-time signature scheme key can only sign a single message securely, it is practical to combine many such keys within a single, larger structure. A Merkle tree structure is used to this end. In this hierarchical data structure, a hash function and concatenation are used repeatedly to compute tree nodes. Lamport signatures are an example of a one-time signature scheme that can be combined with a Merkle tree structure. Hash-based cryptography is a type of post-quantum cryptography.


Ralph Merkle invented hash-based signatures in 1979. The XMSS (eXtended Merkle Signature Scheme)[1] and SPHINCS[2][3] hash-based signature schemes were introduced in 2011 and 2015, respectively. XMSS is based both on Merkle's seminal scheme and on the 2007 Generalized Merkle Signature Scheme (GMSS)[4]. A multi-tree variant of XMSS, XMSSMT, was described in 2013.[5]

One-time signature schemes[edit]

Hash-based signature schemes use one-time signature schemes as their building block. A given one-time signing key can only be used to sign a single message securely. Indeed, signatures reveal part of the signing key. The security of (hash-based) one-time signature schemes relies exclusively on the security of an underlying hash function.

Commonly used one-time signature schemes include the Lamport-Diffie scheme, the Winternitz scheme[6] and its improvements, such as the W-OTS+ scheme[7]. Unlike the seminal Lamport-Diffie scheme, the Winternitz scheme and variants can sign many bits at once. The number of bits to be signed at once is determined by a value: the Winternitz parameter. The existence of this parameter provides a trade-off between size and speed. Large values of the Winternitz parameter yield short signatures and keys, at the price of slower signing and verifying. In practice, a typical value for this parameter is 16.

In the case of stateless hash-based signatures, few-time signature schemes are used. Such schemes allow security to decrease gradually in case a few-time key is used more than once. HORST is an example of a few-time signature scheme.

Combining many one-time key pairs into a hash-based signature scheme[edit]

The central idea of hash-based signature schemes is to combine a larger number of one-time key pairs into a single structure to obtain a practical way of signing more than once (yet a limited number of times). This is done using a Merkle tree structure, with possible variations. One public and one private key are constructed from the numerous public and private keys of the underlying one-time scheme. The global public key is the single node at the very top of the Merkle tree. Its value is an output of the selected hash function, so a typical public key size is 32 bytes. The validity of this global public key is related to the validity of a given one-time public key using a sequence of tree nodes. This sequence is called the authentication path. It is stored as part of the signature, and allows a verifier to reconstruct the node path between those two public keys.

The global private key is generally handled using a pseudo-random number generator. It is then sufficient to store a seed value. One-time secret keys are derived successively from the seed value using the generator. With this approach, the global private key is also very small, e.g. typically 32 bytes.

The problem of tree traversal is critical to signing performance. Increasingly efficient approaches have been introduced, dramatically speeding up signing time.

Some hash-based signature schemes use multiple layers of tree, offering faster signing at the price of larger signatures. In such schemes, only the lowest layer of trees is used to sign messages, while all other trees sign root values of lower trees.

The Naor-Yung work [8] shows the pattern by which to transfer a limited time signature of the Merkle type family into an unlimited (regular) signature scheme.

Properties of hash-based signature schemes[edit]

Hash-based signature schemes rely on security assumptions about the underlying hash function, but any hash function fulfilling these assumptions can be used. As a consequence, each adequate hash function yields a different corresponding hash-based signature scheme. Even if a given hash function becomes insecure, it is sufficient to replace it by a different, secure one to obtain a secure instantiation of the hash-based signature scheme under consideration. Some hash-based signature schemes (such as XMSS with pseudorandom key generation) are forward secure, meaning that previous signatures remain valid if a secret key is compromised.

The minimality of security assumptions is another characteristic of hash-based signature schemes. Generally, these schemes only require a secure (for instance in the sense of second preimage resistance) cryptographic hash function to guarantee the overall security of the scheme. This kind of assumption is necessary for any digital signature scheme; however, other signature schemes require additional security assumptions, which is not the case here.

Because of their reliance on an underlying one-time signature scheme, hash-based signature schemes can only sign a fixed number of messages securely. In the case of the Merkle and XMSS schemes, a maximum of messages can be signed securely, with the total Merkle tree height.

Examples of hash-based signature schemes[edit]

Since Merkle's initial scheme, numerous hash-based signature schemes with performance improvements have been introduced. Recent ones include the XMSS scheme, the Leighton-Micali (LMS) and the SPHINCS scheme. Most hash-based signature schemes are stateful, meaning that signing requires updating the secret key, unlike conventional digital signature schemes. For stateful hash-based signature schemes, signing requires keeping state of the used one-time keys and making sure they are never reused. The XMSS and LMS schemes are stateful, while the SPHINCS scheme is stateless. SPHINCS signatures are larger than XMSS and LMS signatures. Additionally to the WOTS+ one-time signature scheme[7], SPHINCS also uses a few-time (hash-based) signature scheme called HORST. HORST is an improvement of an older few-time signature scheme, HORS (Hash to Obtain Random Subset).[9]

The stateful hash-based schemes XMSS and XMSSMT are specified in RFC 8391 (XMSS: eXtended Merkle Signature Scheme) [10]. An IRTF Internet Draft on LMS is currently active.[11] Practical improvements have been proposed in the literature that alleviate the concerns introduced by stateful schemes.[12] Hash functions appropriate for these schemes include SHA-2, SHA-3 and BLAKE.


The XMSS, GMSS and SPHINCS schemes are available in the Java Bouncy Castle cryptographic APIs.[13] SPHINCS is implemented in the SUPERCOP benchmarking toolkit.[14] Optimised[15] and unoptimised[16] reference implementations of the XMSS RFC exist. The LMS scheme has been implemented in Python[17] and in C[18] following its Internet-Draft.


  1. ^ Buchmann, Johannes; Dahmen, Erik; Hülsing, Andreas (2011). "XMSS - A Practical Forward Secure Signature Scheme Based on Minimal Security Assumptions". Lecture Notes in Computer Science. 7071 (Post-Quantum Cryptography. PQCrypto 2011): 117–129. CiteSeerX doi:10.1007/978-3-642-25405-5_8. ISSN 0302-9743.
  2. ^ Bernstein, Daniel J.; Hopwood, Daira; Hülsing, Andreas; Lange, Tanja; Niederhagen, Ruben; Papachristodoulou, Louiza; Schneider, Michael; Schwabe, Peter; Wilcox-O’Hearn, Zooko (2015). Oswald, Elisabeth; Fischlin, Marc, eds. SPHINCS: practical stateless hash-based signatures. Lecture Notes in Computer Science. 9056. Springer Berlin Heidelberg. pp. 368–397. CiteSeerX doi:10.1007/978-3-662-46800-5_15. ISBN 9783662467992.
  3. ^ "SPHINCS: Introduction".
  4. ^ Buchmann, Johannes; Dahmen, Erik; Klintsevich, Elena; Okeya, Katsuyuki; Vuillaume, Camille (2007). "Merkle Signatures with Virtually Unlimited Signature Capacity". Lecture Notes in Computer Science. 4521 (Applied Cryptography and Network Security): 31–45. doi:10.1007/978-3-540-72738-5_3.
  5. ^ Hülsing, Andreas; Rausch, Lea; Buchmann, Johannes (2013). Optimal Parameters for XMSSMT. Lecture Notes in Computer Science. 8128. p. 194–208. doi:10.1007/978-3-642-40588-4_14. ISBN 978-3-642-40587-7.
  6. ^ Dods, C.; Smart, N. P.; Stam, M. (2005). "Hash Based Digital Signature Schemes". Lecture Notes in Computer Science. 3796 (Cryptography and Coding): 96–115. doi:10.1007/11586821_8.
  7. ^ a b Hülsing, Andreas (2013). W-OTS+ — Shorter Signatures for Hash-Based Signature Schemes. Lecture Notes in Computer Science. 7918. pp. 173–188. doi:10.1007/978-3-642-38553-7_10. ISBN 978-3-642-38552-0.
  8. ^ M. Naor, M. Yung. "Universal One-Way Hash Functions and their Cryptographic Applications". STOC 1989. [1]
  9. ^ Reyzin, Leonid; Reyzin, Natan (2002). Better than BiBa: Short One-Time Signatures with Fast Signing and Verifying. Lecture Notes in Computer Science. 2384. p. 144–153. CiteSeerX doi:10.1007/3-540-45450-0_11. ISBN 978-3-540-43861-8.
  10. ^ Hülsing, Andreas; Butin, Denis; Gazdag, Stefan; Rijneveld, Joost; Mohaisen, Aziz. "RFC 8391 - XMSS: eXtended Merkle Signature Scheme". tools.ietf.org. IETF.
  11. ^ McGrew, David; Curcio, Michael; Fluhrer, Scott. "draft-mcgrew-hash-sigs-11 - Hash-Based Signatures". datatracker.ietf.org. IETF.
  12. ^ McGrew, David; Kampanakis, Panos; Fluhrer, Scott; Gazdag, Stefan-Lukas; Butin, Denis; Buchmann, Johannes (2016). "State Management for Hash-Based Signatures" (PDF). Lecture Notes in Computer Science. 10074 (Security Standardisation Research): 244–260. doi:10.1007/978-3-319-49100-4_11.
  13. ^ "bcgit/bc-java". GitHub. 2018-12-18.
  14. ^ "SUPERCOP".
  15. ^ "Code". Andreas Hülsing.
  16. ^ "squareUP > Publications". www.pqsignatures.org.
  17. ^ David, McGrew (2018-05-29). "The hash-sigs package: an implementation of the Leighton-Micali Hierarchical Signature System (HSS)". GitHub.
  18. ^ David, McGrew (2018-11-22). "A full-featured implementation of the LMS and HSS Hash Based Signature Schemes from draft-mcgrew-hash-sigs-07". GitHub.
  • T. Lange. "Hash-Based Signatures". Encyclopedia of Cryptography and Security, Springer US, 2011. [2]
  • F. T. Leighton, S. Micali. "Large provably fast and secure digital signature schemes based one secure hash functions". US Patent 5,432,852, [3] 1995.
  • G. Becker. "Merkle Signature Schemes, Merkle Trees and Their Cryptanalysis", seminar 'Post Quantum Cryptology' at the Ruhr-University Bochum, Germany, 2008. [4]
  • E. Dahmen, M. Dring, E. Klintsevich, J. Buchmann, L.C. Coronado Garcia. "CMSS — An Improved Merkle Signature Scheme". Progress in Cryptology - Indocrypt 2006. [5]
  • R. Merkle. "Secrecy, authentication and public key systems / A certified digital signature". Ph.D. dissertation, Dept. of Electrical Engineering, Stanford University, 1979. [6]
  • S. Micali, M. Jakobsson, T. Leighton, M. Szydlo. "Fractal Merkle Tree Representation and Traversal". RSA-CT 03. [7]
  • P. Kampanakis, S. Fluhrer. "LMS vs XMSS: A comparison of the Stateful Hash-Based Signature Proposed Standards". Cryptology ePrint Archive, Report 2017/349. [8]
  • D. Naor, A. Shenhav, A. Wool. "One-Time Signatures Revisited: Practical Fast Signatures Using Fractal Merkle Tree Traversal". IEEE 24th Convention of Electrical and Electronics Engineers in Israel, 2006. [9]

External links[edit]

  • [10] A commented list of literature about hash-based signature schemes.
  • [11] Another list of references (uncommented).