Very smooth hash

{{Short description|Cryptographic hash function}}

{{Infobox cryptographic hash function

| name = Very Smooth Hash (VSH)

| image =

| caption =

| designers = Scott Contini, Arjen K. Lenstra, Ron Steinfeld

| publish date = 2005

| series =

| derived from =

| derived to = VSH*

| related to =

| certification =

| digest size = 1024 bits and up

| structure =

| rounds =

| cryptanalysis =

}}

In cryptography, Very Smooth Hash (VSH) is a {{not a typo|provably}} secure cryptographic hash function invented in 2005 by Scott Contini, Arjen Lenstra, and Ron Steinfeld.{{Citation

| last1 = Contini

| first1 = S.

| last2 = Lenstra

| first2 = A.

| last3 = Steinfeld

| first3 = R.

| title = VSH, an Efficient and Provable Collision-Resistant Hash Function.

| date = 2005-06-23

| url = https://eprint.iacr.org/2005/193}}

Provably secure means that finding collisions is as difficult as some known hard mathematical problem. Unlike other {{not a typo|provably}} secure collision-resistant hashes, VSH is efficient and usable in practice. Asymptotically, it only requires a single multiplication per {{Math|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 {{not a typo|provably}} as difficult as finding a nontrivial modular square root of a very smooth number modulo {{Mvar|n}}. The other one uses a prime modulus {{Mvar|p}} (with no trapdoor), and its security proof relies on the hardness of finding discrete logarithms of very smooth numbers modulo {{Mvar|p}}. Both versions have similar efficiency.

VSH is not suitable as a substitute for a random oracle, but can be used to build a {{not a typo|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{{When|date=August 2024}} 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, this hard problem is to find modular square roots (VSSR) of certain special numbers (VSN). This is assumed to be as hard as factoring integers.

For fixed constants {{Mvar|c}} and {{Mvar|n}}, an integer {{Mvar|m}} is a Very Smooth Number (VSN) if the largest prime factor of {{Mvar|m}} is at most {{Math|log(n)c}}.

An integer {{Mvar|b}} is a Very Smooth Quadratic Residue modulo {{Mvar|n}} if the largest prime in {{Mvar|b}}'s factorization is at most {{Math|log(n)c}} and there exists an integer {{Mvar|x}} such that {{Math|bx2 (mod n)}}. The integer {{Mvar|x}} is then said to be a modular square root of {{Mvar|b}}.

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

Very Smooth Number Nontrivial Modular Square Root (VSSR) is the following problem: Let {{Mvar|n}} be the product of two unknown primes of approximately the same size, let {{Math|k ≤ (log(n))c}}, and let {{Math|1=(p1,p2,p3,…) = (2,3,5,…)}} be the sequence of primes. Given {{Mvar|n}}, find an integer {{Mvar|x}} coprime to {{Mvar|n}} such that \textstyle x^2 \equiv \prod_{i=0}^k p_i^{e_i} \pmod{n} and at least one of {{Math|e0,…,ek}} is odd.

The VSSR assumption is that there is no probabilistic polynomial (in {{Math|log(n)}}) time algorithm which solves VSSR with non-negligible probability. This is considered a useless assumption in 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 {{Mvar|s}}-bit modulus, where {{Mvar|s}} is somewhat smaller than the size of {{Mvar|n}}.

=Examples of VSN and VSSR=

Let the parameters be fixed as {{Math|1=c = 5}} and {{Math|1=n = 31}}.

Then {{Math|1=m1 = 35 = 5 · 7}} is a Very Smooth Number with respect to these parameters because {{Math|log(31)5 ≈ 7.37}} is greater than all of {{Math|m1}}'s prime factors. On the other hand, {{Math|1=m2 = 55 = 5 · 11}} is not a VSN under these parameters.

The integer {{Math|9}} is a Very Smooth Quadratic Residue modulo {{Mvar|n}} because it is a Very Smooth Number (under {{Math|c,n}}), and {{Math|32 ≡ 9 (mod n)}}. This is a trivial modular square root, because {{Math|9 < n}} and so the modulus is not involved when squaring.

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

The integer {{Math|1=b = 15}} is also a Very Smooth Quadratic Residue modulo {{Mvar|n}}. All of its prime factors are smaller than 7.37, and the modular square root is {{Math|1=x = 20}}, since {{Math|1=202 = 400 ≡ 15 (mod n)}}. This is thus a non-trivial square root. The VSSR problem is to find {{Mvar|x}} given {{Mvar|b}} and {{Mvar|n}}. This is believed to be computationally as hard as factoring {{Mvar|n}}.

VSH algorithm, basic versions

Let {{Mvar|n}} be a large RSA composite and let {{Math|1=(p1,p2,p3,…) = (2,3,5,…)}} be the sequence of primes. Let {{Mvar|k}}, the block length, be the largest integer such that \textstyle \prod_{i = 1}^k p_i < n. Let {{Mvar|m}} be an {{Mvar|ℓ}}-bit message to be hashed consisting of bits {{Math|(m1,…,m)}} and assume that {{Math|ℓ < 2k}}. To compute the hash of {{Mvar|m}}:

  1. Set {{Math|1=x0 = 1}}.
  2. Let {{Mvar|L}}, the smallest integer greater than or equal to {{Math|ℓ/k}}, be the number of blocks.
  3. Let {{Math|1=mi = 0}} for {{Math|ℓ < i < Lk}} (padding).
  4. Let \textstyle \ell = \sum_{i=1}^k l_i 2^{i-1} with {{Math|ℓi ∈ {{mset|0,1}}}} be the binary representation of the message length {{Mvar|ℓ}} and define {{Math|1=mLk+i = ℓi}} for {{Math|1 ≤ ik}}.
  5. For {{Math|1=j = 0, 1, …, L}} in succession, compute x_{j+1} = x_j^2 \prod_{i=1}^k p_i^{m_{jk+i}}\mod n
  6. Return {{Math|xL+1}}.

The function in step 5 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 naïve approach could be easily broken under a chosen-plaintext attack.
  • The cost of each iteration is less than the cost of 3 modular multiplications. The basic version of VSH altogether requires one multiplication per {{Math|Ω(log(n) / log(log(n)))}} message bits.

Variants of VSH

Several improvements, speedups, and more efficient variants of VSH have been proposed. 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 logarithms modulo a prime {{Mvar|p}}.

Very Smooth Number Discrete Logarithm (VSDL) is a problem where, given a very smooth number, the task is to find its discrete logarithm modulo some number {{Mvar|n}}.

As in previous section, {{Math|pi}} denotes the {{Mvar|i}}th prime. Let furthermore {{Mvar|c}} be a fixed constant and {{Math|p,q}} be primes with {{Math|1=p = 2q + 1}} and let {{Math|k ≤ (log p)c}}. VSDL is the following problem: given {{Mvar|p}}, find integers {{Math|e1,…,ek}} such that 2^{e_1} \equiv \prod_{i=2}^k p_i^{e_i} \pmod p with {{Math|{{abs|ei}} < q}} for {{Math|1=i = 1, …, k}} and at least one of {{Math|e1,…,ek}} is non-zero.

The VSDL assumption is that there is no probabilistic polynomial (in {{Math|log(p)}}) 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 logarithms modulo {{Mvar|p}}, 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). VSH should not be considered a general-purpose hash function as usually understood in security engineering.

=Multiplicative property=

VSH is multiplicative: Let {{Mvar|x}}, {{Mvar|y}}, and {{Mvar|z}} be three bitstrings of equal length, where {{Mvar|z}} consists only of zero bits and the strings satisfy {{Math|1=x AND y = z}}. Then {{Math|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 {{Mvar|ℓ}} bits which has {{Math|2ℓ/2}} complexity rather than {{Math|2}} 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 {{Mvar|ℓ}} least significant bits.{{Citation

| last1 = Saarinen

| first1 = M.-J. O.

| title = Progress in Cryptology - INDOCRYPT 2006

| chapter = Security of VSH in the real world

| series = Lecture Notes in Computer Science

| year = 2006

| volume = 4329

| pages = 95–103

| doi = 10.1007/11941378_8

| isbn = 978-3-540-49767-7

| chapter-url = http://www.tcs.hut.fi/~mjos/doc/saarinen_vsh.pdf

| url-status = }}{{deadlink|date=September 2023}}

The complexity of this attack against VSH is:

  • Pre-computing the table offline: {{Math|2ℓ/3}} time and space.
  • Finding collisions: {{Math|2ℓ/3}} iterations.
  • Total cost: roughly {{Math|2ℓ/3}}, rather than {{Math|2ℓ/2}} as expected from a hash function with good pseudorandomness properties.

This probably{{According to whom|date=August 2024}} 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

References

{{reflist}}

{{Cryptography navbox | hash}}

Category:Cryptographic hash functions