Merkle signature scheme

In hash-based cryptography, the Merkle signature scheme is a digital signature scheme based on Merkle trees (also called hash trees) and one-time signatures such as the Lamport signature scheme. It was developed by Ralph Merkle in the late 1970s[1] and is an alternative to traditional digital signatures such as the Digital Signature Algorithm or RSA. NIST has approved specific variants of the Merkle signature scheme in 2020.[2]

An advantage of the Merkle signature scheme is that it is believed to be resistant against attacks by quantum computers. The traditional public key algorithms, such as RSA and ElGamal would become insecure if an effective quantum computer could be built (due to Shor's algorithm). The Merkle signature scheme, however, only depends on the existence of secure hash functions. This makes the Merkle signature scheme very adjustable and resistant to quantum computer-based attacks. The Merkle signature is a one time signature with finite signing potential. The work of Moni Naor and Moti Yung on signature based one-way permutations and functions (and the invention of universal one-way hash functions) gives a way to extend a Merkle-like signature to a complete signature scheme.[3]

Key generation

The Merkle signature scheme can be used to sign a limited number of messages with one public key pub {\displaystyle {\text{pub}}} . The number of possible messages must be a power of two, so we denote the possible number of messages as N = 2 n {\displaystyle N=2^{n}} .

The first step of generating the public key pub {\displaystyle {\text{pub}}} is to generate N {\displaystyle N} private/public key pairs ( X i , Y i ) {\displaystyle (X_{i},Y_{i})} of some one-time signature scheme (such as the Lamport signature scheme). For each 1 i 2 n {\displaystyle 1\leq i\leq 2^{n}} , a hash value of the public key h i = H ( Y i ) {\displaystyle h_{i}=H(Y_{i})} is computed.

Merkle Tree with 8 leaves

With these hash values h i {\displaystyle h_{i}} a hash tree is built, by placing these 2 n {\displaystyle 2^{n}} hash values as leaves and recursively hashing to form a binary tree. Let a i , j {\displaystyle a_{i,j}} denote the node in the tree with height i {\displaystyle i} and left-right position j {\displaystyle j} . Then, the hash values h i = a 0 , i {\displaystyle h_{i}=a_{0,i}} are the leaves. The value for each inner node of the tree is the hash of the concatenation of its two children. For example, a 1 , 0 = H ( a 0 , 0 | | a 0 , 1 ) {\displaystyle a_{1,0}=H(a_{0,0}||a_{0,1})} and a 2 , 0 = H ( a 1 , 0 | | a 1 , 1 ) {\displaystyle a_{2,0}=H(a_{1,0}||a_{1,1})} . In this way, a tree with 2 n {\displaystyle 2^{n}} leaves and 2 n + 1 1 {\displaystyle 2^{n+1}-1} nodes is built.

The private key of the Merkle signature scheme is the entire set of ( X i , Y i ) {\displaystyle (X_{i},Y_{i})} pairs. A shortcoming with the scheme is that the size of the private key scales linearly with the number of messages to be sent.

The public key pub {\displaystyle {\text{pub}}} is the root of the tree, a n , 0 {\displaystyle a_{n,0}} . The individual public keys Y i {\displaystyle Y_{i}} can be made public without breaking security. However, they are not needed in the public key, so they can be kept secret to minimize the size of the public key.

Signature generation

To sign a message M {\displaystyle M} with the Merkle signature scheme, the signer picks a key pair ( X i , Y i ) {\displaystyle (X_{i},Y_{i})} , signs the message using the one-time signature scheme, and then adds additional information to prove that the key pair used was one of the original key pairs (rather than one newly generated by a forger).

Merkle tree with path A and authentication path for i = 2, n = 3

First, the signer chooses a ( X i , Y i ) {\displaystyle (X_{i},Y_{i})} pair which had not previously been used to sign any other message, and uses the one-time signature scheme to sign the message, resulting in a signature sig {\displaystyle {\text{sig}}'} and corresponding public key Y i {\displaystyle Y_{i}} . To prove to the message verifier that ( X i , Y i ) {\displaystyle (X_{i},Y_{i})} was in fact one of the original key pairs, the signer simply includes intermediate nodes of the Merkle tree so that the verifier can verify h i = a 0 , i {\displaystyle h_{i}=a_{0,i}} was used to compute the public key a n , 0 {\displaystyle a_{n,0}} at the root of the tree. The path in the hash tree from a 0 , i {\displaystyle a_{0,i}} to the root is n + 1 {\displaystyle n+1} nodes long. Call the nodes A 0 , , A n {\displaystyle A_{0},\ldots ,A_{n}} , with A 0 = a 0 , i = H ( Y i ) {\displaystyle A_{0}=a_{0,i}=H(Y_{i})} being a leaf and A n = a n , 0 = pub {\displaystyle A_{n}=a_{n,0}={\text{pub}}} being the root.

A i {\displaystyle A_{i}} is a child of A i + 1 {\displaystyle A_{i+1}} . To let the verifier calculate the next node A i + 1 {\displaystyle A_{i+1}} given the previous, they need to know the other child of A i + 1 {\displaystyle A_{i+1}} , the sibling node of A i {\displaystyle A_{i}} . We call this node auth i {\displaystyle {\text{auth}}_{i}} , so that A i + 1 = H ( A i | | auth i ) {\displaystyle A_{i+1}=H(A_{i}||{\text{auth}}_{i})} . Hence, n {\displaystyle n} nodes auth 0 , , auth n 1 {\displaystyle {\text{auth}}_{0},\ldots ,{\text{auth}}_{n-1}} are needed, to reconstruct A n = a n , 0 = pub {\displaystyle A_{n}=a_{n,0}={\text{pub}}} from A 0 = a 0 , i {\displaystyle A_{0}=a_{0,i}} . An example of an authentication path is illustrated in the figure on the right.

Together, the nodes auth 0 , , auth n 1 {\displaystyle {\text{auth}}_{0},\ldots ,{\text{auth}}_{n-1}} , the Y i {\displaystyle Y_{i}} , and the one-time signature sig {\displaystyle {\text{sig}}'} constitute a signature of M {\displaystyle M} using the Merkle signature scheme: sig = ( sig | | Y i | | auth 0 | | auth 1 | | | | auth n 1 ) {\displaystyle {\text{sig}}=({\text{sig}}'||Y_{i}||{\text{auth}}_{0}||{\text{auth}}_{1}||\ldots ||{\text{auth}}_{n-1})} .

Note that when using the Lamport signature scheme as the one-time signature scheme, sig {\displaystyle {\text{sig}}'} contains a part of the private key X i {\displaystyle X_{i}} .

Signature verification

The receiver knows the public key pub {\displaystyle {\text{pub}}} , the message M {\displaystyle M} , and the signature sig = ( sig | | Y i | | auth 0 | | auth 1 | | | | auth n 1 ) {\displaystyle {\text{sig}}=({\text{sig}}'||Y_{i}||{\text{auth}}_{0}||{\text{auth}}_{1}||\ldots ||{\text{auth}}_{n-1})} . First, the receiver verifies the one-time signature sig {\displaystyle {\text{sig}}'} of the message M {\displaystyle M} using the one-time signature public key Y i {\displaystyle Y_{i}} . If sig {\displaystyle {\text{sig}}'} is a valid signature of M {\displaystyle M} , the receiver computes A 0 = H ( Y i ) {\displaystyle A_{0}=H(Y_{i})} by hashing the public key of the one-time signature. For j = 1 , , n 1 {\displaystyle j=1,\ldots ,n-1} , the nodes of A j {\displaystyle A_{j}} of the path are computed with A j = H ( A j 1 | | auth j 1 ) {\displaystyle A_{j}=H(A_{j-1}||{\text{auth}}_{j-1})} . If A n {\displaystyle A_{n}} equals the public key pub {\displaystyle {\text{pub}}} of the Merkle signature scheme, the signature is valid.

References

  1. ^ Merkle, Ralph (1979). "Secrecy, authentication and public key systems" (PDF). Ph.D. Dissertation: 32–61.
  2. ^ "Stateful Hash-Based Signature Schemes: SP 800-208 | CSRC". 30 October 2020.
  3. ^ Naor, Moni; Yung, Moti (1989). "Universal One-Way Hash Functions and their Cryptographic Applications" (PDF). Symposium on Theory of Computing: 33–43.
  • E. Dahmen, M. Dring, E. Klintsevich, J. Buchmann, L.C. Coronado Garca. "CMSS - an improved merkle signature scheme". Progress in Cryptology – Indocrypt 2006, 2006.
  • E. Klintsevich, K. Okeya, C.Vuillaume, J. Buchmann, E.Dahmen. "Merkle signatures with virtually unlimited signature capacity". 5th International Conference on Applied Cryptography and Network Security - ACNS07, 2007.
  • S. Micali, M. Jakobsson, T. Leighton, M. Szydlo. "Fractal merkle tree representation and traversal". RSA-CT 03, 2003

External links

  • Efficient Use of Merkle Trees - RSA labs explanation of the original purpose of Merkle trees + Lamport signatures, as an efficient one-time signature scheme.
  • An introduction to hash-based signatures and Merkle signatures by Adam Langley.
  • A 4 parts series on hash-based signatures by David Wong.
  • v
  • t
  • e
Public-key cryptography
Algorithms
Integer factorization
Discrete logarithm
Lattice/SVP/CVP/LWE/SIS
Others
Theory
Standardization
Topics
  • v
  • t
  • e
General
Mathematics
  • Category