Very smooth hash

From HandWiki
Short description: Cryptographic hash function
Very Smooth Hash (VSH)
General
DesignersScott Contini, Arjen K. Lenstra, Ron Steinfeld
First published2005
SuccessorsVSH*
Detail
Digest sizes1024 bits and up

In cryptography, Very Smooth Hash (VSH) is a provably secure cryptographic hash function invented in 2005 by Scott Contini, Arjen Lenstra and Ron Steinfeld.[1] Provably secure means that finding collisions is as difficult as some known hard mathematical problem. Unlike other provably secure collision-resistant hashes, VSH is efficient and usable in practice. Asymptotically, it only requires a single multiplication per log(n) message-bits and uses RSA-type arithmetic. Therefore, VSH can be useful in embedded environments where code space is limited.

Two major variants of VSH were proposed. For one, finding a collision is provably as difficult as finding a nontrivial modular square root of a very smooth number modulo n. The other one uses a prime modulus p (with no trapdoor), and its security proof relies on the hardness of finding discrete logarithms of very smooth numbers modulo p. Both versions have similar efficiency.

VSH is not suitable as a substitute for a random oracle, but can be used to build a provably secure randomized trapdoor hash function. This function can replace the trapdoor function used in the Cramer–Shoup signature scheme, maintaining its provable security while speeding up verification time by about 50%.

VSN and VSSR

All cryptographic hash functions that are now widely used are not based on hard mathematical problems. Those few functions that are constructed on hard mathematical problems are called provably secure. Finding collisions is then known to be as hard as solving the hard mathematical problem. For the basic version of Very Smooth Hash function, this hard problem is to find modular square roots (VSSR) of certain special numbers (VSN).[1] This is assumed to be as hard as factoring integers.

For a fixed constant c and n an integer m is a Very Smooth Number (VSN) if the largest prime factor of m is at most (log n)c.

An integer b is a Very Smooth Quadratic Residue' modulo n if the largest prime in bs factorization is at most (log n)c and there exists an integer x such that [math]\displaystyle{ b \equiv x^2 \mod n }[/math]. The integer x is said to be a Modular Square Root of b.

We are interested only in non-trivial square roots, those where x2n. If x2 < n, the root can be easily computed using algorithms from fields of characteristics 0, such as real field. Therefore, they are not suitable in cryptographic primitives.

Very Smooth Number Nontrivial Modular Square Root (VSSR) is the following problem: Let n be the product of two unknown primes of approximately the same size and let [math]\displaystyle{ k\le(\log n)^c }[/math]. Let [math]\displaystyle{ p_1 = 2, p_2 = 3, p_3 = 5,\dots }[/math] be the sequence of primes. VSSR is the following problem: Given n, find [math]\displaystyle{ x \in \mathbb{Z}^*_n }[/math] such that [math]\displaystyle{ \textstyle x^2 \equiv \prod_{i=0}^k p_i^{e_i} }[/math] and at least one of e0,...,ek is odd.

The VSSR assumption is that there is no probabilistic polynomial (in [math]\displaystyle{ \log n }[/math]) time algorithm which solves VSSR with non-negligible probability. This is considered a useless assumption for practice because it does not tell for what size of moduli VSSR is computationally hard. Instead The computational VSSR assumption is used. It says that solving VSSR is assumed to be as hard as factoring a hard-to-factor [math]\displaystyle{ s }[/math] bit modulus, where [math]\displaystyle{ s }[/math] is somewhat smaller than the size of [math]\displaystyle{ n }[/math].

Examples of VSN and VSSR

Let the parameters be fixed as follows: [math]\displaystyle{ c=5 }[/math] and [math]\displaystyle{ n=31 }[/math].

Then [math]\displaystyle{ m_1 = 35 = 5 \cdot 7 }[/math] is a Very Smooth Number with respect to these parameters because [math]\displaystyle{ (\log 31)^5~\dot{=}~7.37 }[/math] is greater than all [math]\displaystyle{ m_1 }[/math]'s prime factors. On the other hand, [math]\displaystyle{ m_2 = 55 = 5\cdot 11 }[/math] is not a VSN under [math]\displaystyle{ c=5 }[/math] and [math]\displaystyle{ n=31 }[/math].

The integer [math]\displaystyle{ b_1 = 9 }[/math] is Very Smooth Quadratic Residue modulo [math]\displaystyle{ n }[/math] because it is Very Smooth Number (under [math]\displaystyle{ c, n }[/math]) and we have [math]\displaystyle{ x_1 = 3 }[/math] such that [math]\displaystyle{ x_1^2 = b_1 }[/math] (mod [math]\displaystyle{ n }[/math]). This is a trivial modular square root, because [math]\displaystyle{ 3^2 \not\geq n }[/math] and so the modulus is not involved when squaring.

The integer [math]\displaystyle{ b_2 = 15 }[/math] is also Very Smooth Quadratic Residue modulo [math]\displaystyle{ n }[/math]. All prime factors are smaller than 7.37 and the Modular Square Root is [math]\displaystyle{ x_2 = 20 }[/math] since [math]\displaystyle{ 20^2 = 400 \equiv 15 }[/math] (mod [math]\displaystyle{ n }[/math]). This is thus a non-trivial root. The VSSR problem is to find [math]\displaystyle{ x_2 }[/math] given [math]\displaystyle{ b_2 }[/math] and [math]\displaystyle{ n }[/math]. And we suppose that this is computationally as hard as factoring [math]\displaystyle{ n }[/math].

VSH algorithm, basic versions

Let [math]\displaystyle{ n }[/math] be a large RSA composite and let [math]\displaystyle{ p_1 = 2, p_2 = 3, \ldots }[/math] the sequence of primes. Let [math]\displaystyle{ k }[/math], the block length, be the largest integer such that [math]\displaystyle{ \textstyle \prod_{i = 1}^k p_i \lt n }[/math]. Let [math]\displaystyle{ m }[/math] be an [math]\displaystyle{ \ell }[/math]-bit message to be hashed consisting of bits [math]\displaystyle{ (m_1,\ldots,m_{\ell}) }[/math] and assume that [math]\displaystyle{ \ell \lt 2^k }[/math]. To compute the hash of [math]\displaystyle{ m }[/math]:

  1. x0 = 1
  2. Let [math]\displaystyle{ L }[/math], the smallest integer greater or equal to [math]\displaystyle{ l/k }[/math], be the number of blocks. Let [math]\displaystyle{ m_i = 0 }[/math] for [math]\displaystyle{ l \lt i \leq Lk }[/math] (padding)
  3. Let [math]\displaystyle{ \textstyle \ell = \sum_{i=1}^k l_i 2^{i-1} }[/math] with [math]\displaystyle{ \ell_i \in \{0, 1\} }[/math] be the binary representation of the message length [math]\displaystyle{ \ell }[/math] and define [math]\displaystyle{ m_{Lk+i}= \ell_i }[/math] for [math]\displaystyle{ 1 \leq i \leq k }[/math].
  4. for j = 0, 1,..., L in succession compute [math]\displaystyle{ x_{j+1} = x_j^2 \prod_{i=1}^k p_i^{m_{jk+i}}\mod n }[/math]
  5. return xL + 1.

The function in step 4 is called the compression function.

Properties of VSH

  • The message length does not need to be known in advance.
  • Finding a collision in VSH is as hard as solving VSSR. Thus VSH is (strongly) collision-resistant, which also implies second preimage resistance. VSH has not been proven to be preimage-resistant.
  • The compression function is not collision-resistant. Nonetheless, the hash function VSH is collision-resistant based on the VSSR assumption. An altered version of VSH, called VSH*, uses a collision-resistant compression function and is about 5 times quicker when hashing short messages.
  • Since the output length of VSH is the length of a secure RSA modulus, VSH seems quite suitable in practice for constructing "hash-then-sign" RSA signatures for arbitrarily long messages. However, such a signature must be designed carefully to ensure its security. The naive approach could be easily broken under CPA (chosen-plaintext attack).
  • Efficiency: The cost of each iteration is less than the cost of 3 modular multiplications. The basic version of VSH altogether requires single multiplication per [math]\displaystyle{ \Omega(\log n/\log\log n) }[/math] message bits.

Variants of VSH

Several improvements, speedups and more efficient variants of VSH have been proposed.[1] None of them changes the underlying concept of the function. These improvements are called:

  • Cubing VSH (instead of squaring).
  • VSH with increased number of small primes.
  • VSH with precomputed products of primes.
  • Fast VSH.
  • Fast VSH with increased block length.

VSDL and VSH-DL variant

The VSH-DL is a discrete logarithm variant of VSH that has no trapdoor, its security depends on the difficulty of finding discrete logarithm modulo a prime p.[1]

Very Smooth Number Discrete Logarithm (VSDL) is a problem where given a very smooth number, we want to find its discrete logarithm modulo some number n.

Similarly as in previous section, by [math]\displaystyle{ p_i }[/math] we denote the [math]\displaystyle{ i }[/math]-th prime. Let furthermore [math]\displaystyle{ c }[/math] be a fixed constant and [math]\displaystyle{ p }[/math], [math]\displaystyle{ q }[/math] be primes with [math]\displaystyle{ p = 2q + 1 }[/math] and let [math]\displaystyle{ k \leq (\log p)^c }[/math]. VSDL is the following problem: given [math]\displaystyle{ p }[/math], find integers [math]\displaystyle{ e_1,...,e_k }[/math] such that [math]\displaystyle{ 2^{e_1} \equiv \prod_{i=2}^k p_i^{e_i} \mod p }[/math] with [math]\displaystyle{ |e_i| \lt q }[/math] for [math]\displaystyle{ i = 1,...,k }[/math] and at least one of [math]\displaystyle{ e_1,...,e_k }[/math] non-zero.

The VSDL assumption is that there is no probabilistic polynomial (in [math]\displaystyle{ \log p }[/math]) time algorithm which solves VSDL with non-negligible probability. There is a strong connection between the hardness of VSDL and the hardness of computing discrete logarithm modulo [math]\displaystyle{ p }[/math], which is reminiscent of, but somewhat weaker than, the connection between VSSR and integer factorization.

Security of VSH

Strong collision resistance is the only property proven for VSH. This does not imply preimage-resistance or other important hash function properties, and the authors state that "VSH should not be used to model random oracles," and cannot be substituted into constructions that depend upon them (RSA signatures, some MACs).[1] VSH should not be considered a general-purpose hash function as usually understood in security engineering.

Multiplicative property

VSH is multiplicative: Let x, y, and z be three bit strings of equal length, where z consists only of zero bits and the strings satisfy x AND y = z. It is easy to see that H(z)H(x OR y) ≡ H(x)H(y) (mod n). As a result, VSH succumbs to a classical time-memory trade-off attack that applies to multiplicative and additive hashes.

This fact can be used to construct a preimage attack against VSH of [math]\displaystyle{ \ell }[/math] bits which has [math]\displaystyle{ 2^{\ell/2} }[/math] complexity rather than [math]\displaystyle{ 2^\ell }[/math] as expected.

Attack against truncated version

VSH produces a very long hash (typically 1024 bits). There are no indications that a truncated VSH hash offers security that is commensurate with the hash length.

There exists a partial collision attack on VSH truncated to least significant l bits.[2]

The complexity of this attack against VSH is:

  • Pre-computing the table offline: [math]\displaystyle{ 2^{\ell/3} }[/math] time and space.
  • Finding collisions: [math]\displaystyle{ 2^{\ell/3} }[/math] iterations.
  • Total cost: roughly [math]\displaystyle{ 2^{\ell/3} }[/math], rather than [math]\displaystyle{ 2^{\ell/2} }[/math] as expected from a hash function with good pseudorandomness properties.

This probably rules out the applicability of VSH in digital signature schemes which produce signatures shorter than the VSH hash result, such as elliptic-curve signature schemes.

See also

  • Cryptographic hash functions
  • Provably secure cryptographic hash function

References

  1. 1.0 1.1 1.2 1.3 1.4 Contini, S.; Lenstra, A.; Steinfeld, R. (2005-06-23), VSH, an Efficient and Provable Collision-Resistant Hash Function., https://eprint.iacr.org/2005/193 
  2. Saarinen, M.-J. O. (2006), "Security of VSH in the real world", Progress in Cryptology - INDOCRYPT 2006, Lecture Notes in Computer Science, 4329, pp. 95–103, doi:10.1007/11941378_8, ISBN 978-3-540-49767-7, http://www.tcs.hut.fi/~mjos/doc/saarinen_vsh.pdf [|permanent dead link|dead link}}]