Hash chain

From HandWiki

A hash chain is the successive application of a cryptographic hash function to a piece of data. In computer security, a hash chain is a method used to produce many one-time keys from a single key or password. For non-repudiation, a hash function can be applied successively to additional pieces of data in order to record the chronology of data's existence.

Definition

A hash chain is a successive application of a cryptographic hash function [math]\displaystyle{ h }[/math] to a string [math]\displaystyle{ x }[/math].

For example,

[math]\displaystyle{ h(h(h(h(x)))) }[/math] gives a hash chain of length 4, often denoted [math]\displaystyle{ h^{4}(x) }[/math]

Applications

Leslie Lamport[1] suggested the use of hash chains as a password protection scheme in an insecure environment. A server which needs to provide authentication may store a hash chain rather than a plain text password and prevent theft of the password in transmission or theft from the server. For example, a server begins by storing [math]\displaystyle{ h^{1000}(\mathrm{password}) }[/math] which is provided by the user. When the user wishes to authenticate, they supply [math]\displaystyle{ h^{999}(\mathrm{password}) }[/math] to the server. The server computes [math]\displaystyle{ h(h^{999}(\mathrm{password})) = h^{1000}(\mathrm{password}) }[/math] and verifies this matches the hash chain it has stored. It then stores [math]\displaystyle{ h^{999}(\mathrm{password}) }[/math] for the next time the user wishes to authenticate.

An eavesdropper seeing [math]\displaystyle{ h^{999}(\mathrm{password}) }[/math] communicated to the server will be unable to re-transmit the same hash chain to the server for authentication since the server now expects [math]\displaystyle{ h^{998}(\mathrm{password}) }[/math]. Due to the one-way property of cryptographically secure hash functions, it is infeasible for the eavesdropper to reverse the hash function and obtain an earlier piece of the hash chain. In this example, the user could authenticate 1000 times before the hash chain were exhausted. Each time the hash value is different, and thus cannot be duplicated by an attacker.

Binary hash chains

Binary hash chains are commonly used in association with a hash tree. A binary hash chain takes two hash values as inputs, concatenates them and applies a hash function to the result, thereby producing a third hash value.

Hash tree and hash chain

The above diagram shows a hash tree consisting of eight leaf nodes and the hash chain for the third leaf node. In addition to the hash values themselves the order of concatenation (right or left 1,0) or "order bits" are necessary to complete the hash chain.

Winternitz chains

Winternitz chains (also known as function chains[2]) are used in hash-based cryptography. The chain is parameterized by the Winternitz parameter w (number of bits in a "digit" d) and security parameter n (number of bits in the hash value, typically double the security strength,[3] 256 or 512). The chain consists of [math]\displaystyle{ 2^w }[/math] values that are results of repeated application of a one-way "chain" function F to a secret key sk: [math]\displaystyle{ sk, F(sk), F(F(sk)), ..., F^{2^{w-1}}(sk) }[/math]. The chain function is typically based on a standard cryptographic hash, but needs to be parameterized ("randomized"[4]), so it involves few invocations of the underlying hash.[5] In the Winternitz signature scheme a chain is used to encode one digit of the m-bit message, so the Winternitz signature uses approximately [math]\displaystyle{ mn/w }[/math] bits, its calculation takes about [math]\displaystyle{ 2^wm/w }[/math] applications of the function F.[3] Note that some signature standards (like Extended Merkle signature scheme, XMSS) define w as the number of possible values in a digit, so [math]\displaystyle{ w=16 }[/math] in XMSS corresponds to [math]\displaystyle{ w=4 }[/math] in standards (like Leighton-Micali Signature, LMS) that define w in the same way as above - as a number of bits in the digit.[6]

Hash chain vs. blockchain

A hash chain is similar to a blockchain, as they both utilize a cryptographic hash function for creating a link between two nodes. However, a blockchain (as used by Bitcoin and related systems) is generally intended to support distributed agreement around a public ledger (data), and incorporates a set of rules for encapsulation of data and associated data permissions.

See also

References

  1. L. Lamport, “Password Authentication with Insecure Communication”, Communications of the ACM 24.11 (November 1981), pp 770-772. [1]
  2. Hülsing 2013b, pp. 18-20.
  3. 3.0 3.1 Buchmann et al. 2011, p. 2.
  4. Hülsing 2013b.
  5. RFC 8391
  6. NIST SP 800-208, Recommendation for Stateful Hash-Based Signature Schemes, p. 5

Sources