A quantum algorithm for finding collision-inducing disturbance vectors in SHA-1 2
1. Introduction
Cryptographic hash functions appeared at the end of the twentieth century and became
one of the most significant concepts in key derivation, password hashing, and digital
signatures which were popularized since 1990s [1]. The most ubiquitous cryptographic
hash functions belong to the secure hash algorithm (SHA) family [2], which includes
the variants SHA-0 up to SHA-3. The SHA function converts input messages into
quasi-unique and orderless strings of a fixed length. Since this length is much shorter
than the lengths of original messages, collisions are doomed to occur due to the pigeon-
hole principle, where two or more messages are converted to the same hash value. The
careful design of the SHA family, however, mandates that similar messages lead to
vastly distinct hash values, let alone messages of different lengths. It was believed that
hash collisions would never occur such that authentication systems would be protected
from fake signatures from malware. The course took a sudden change in 2005 when the
first practical collision attack of SHA-1 was proposed by employing a differential path
method [3, 4]. Since then, more collision attacks have been found with relatively low
algorithmic complexities. Constructing differential paths essentially reduces the time
complexity of finding collision-inducing messages from brute-force method and the
introduction of disturbance vectors (DV) further simplifies this construction [5, 6, 7, 8].
Hence, finding the DVs becomes the key to finding the collision attacks on SHA-1 [9].
Despite the reduction in complexity, finding DV still remains a computationally
daunting task in a practice sense and often seeking a collision relies on heuristic
approaches. Quantum algorithms, nevertheless, poses unparalleled advantage over
classical algorithms in tackling specific computational problems. The use of quantum
computers would render some classically improbable tasks tangible, granting the
programmer quantum supremacy [10]. Two particularly well-known problems falling
in this category are the factorization of large integers, solved by Shor’s algorithm
[11], and the searching in unsorted list, solved by Grover’s algorithm [12]. The latter
has been applied in numerous works to enhance computation efficacy [13, 14, 15].
Therefore, it is only natural to take advantage of quantum parallelism to improve the
efficacy of seeking SHA-1 collisions but, to our knowledge, scarcely have such quantum
approaches been attempted. A quantum collision search that elevates from classical
semi-free-start collisions [16, 17] on reduced SHA-256 and SHA-512 was proposed last
year [18].
Here, we propose a quantum algorithm for seeding DVs against SHA-1, which
combines diffusion and inversion gating from Grover’s algorithm, quantum phase
gating, diffusion gating, and information feedback from classical computing machinery,
to greatly reduce the overall computation complexity. The algorithm runs on a
quantum machine of two n= 16λqubit-long registers RCand RW, where λis the
bit weight of the candidate DVs. While the control register RCstores the addresses
of the DVs, the work register RWcarries the hash computation related information.
The principles of the algorithm apply to other SHA and MD5 hashing protocols as
well, only that the qubit length would vary. The concurrency of searching permitted
by the entanglement between R1and R2significantly reduces the query complexity
to O(2n/2), translating to a total temporal complexity of O(2n/2+1). Beginning with
qubit initialization, the algorithm first uses Hadamard gates to equally distribute
probability among all DV addresses on R1. It is followed by phase gating, diffusion
gating, and data for DV validation to store corresponding entangled computation
states on R2. Grover search then follows by performing the “inversion about average”