Collision Resistance of the JH Hash Function Jooyoung Lee and Deukjo Hong
Total Page:16
File Type:pdf, Size:1020Kb
1 Collision Resistance of the JH Hash Function Jooyoung Lee and Deukjo Hong Abstract—In this paper, we analyze collision resistance of the Merkle-Damgard˚ Transform: Let JH hash function in the ideal primitive model. The JH hash [1 function is one of the five SHA-3 candidates accepted for the ¤ mi final round of evaluation. The JH hash function uses a mode of pad : f0; 1g ! f0; 1g operation based on a permutation, while its security has been i=1 elusive even in the random permutation model. One can find a collision for the JH compression function only be an injective padding. With this padding scheme and a with two backward queries to the basing primitive. However, the predetermined constant IV 2 f0; 1g2n, the Merkle-Damgard˚ security is significantly enhanced in iteration. For c · n=2, we transform produces a variable-input-length function MD[F ]: prove that the JH hash function using an ideal n-bit permutation f0; 1g¤ ! f0; 1g2n from a fixed-input-length function F : and producing c-bit outputs by truncation is collision resistant 2n m 2n ¤ c=2 f0; 1g £ f0; 1g ! f0; 1g . For M 2 f0; 1g such that up to O(2 ) queries. jpad(M)j = lm, MD[F ](M) is computed as follows. Index Terms—hash function, collision resistance. Function MD[F ](M) I. INTRODUCTION u[0] à IV Break pad(M) = M[1]jj ::: jjM[l + 1] into m-bit blocks As many hash functions, including those most common in for i à 1 to l + 1 do practical applications, have started to exhibit serious security u[i] à F (u[i ¡ 1];M[i]) weaknesses [2]–[9], the US National Institute for Standards return u[l + 1] and Technology (NIST) has opened a public competition to develop a new cryptographic hash function. Currently, the Collision Resistance: We review the definition of collision final candidates to replace SHA-2 has been announced, which resistance in the information-theoretic model. Given a function are BLAKE, Grøstl, JH, Keccak and Skein. In this paper, H = H[P] and an information-theoretic adversary A both we analyze collision resistance for the JH hash function in with oracle access to an ideal primitive P, the collision the ideal primitive model. The JH compression function is resistance of H against A is estimated by the following illustrated in Fig. 1, where ¼ is a certain permutation. The experiment. JH hash function is obtained by feeding the compression Experiment Expcol function to the Merkle-Damgard˚ transform [10]. The only A known result for the security of the JH hash function is A updates Q by making oracle queries to P 0 0 its indifferentiability from a random oracle guaranteed up to if 9 M 6= M and u s.t. u = HQ(M) = HQ(M ) then 2n=6 query complexity [1]. This translates into the collision output 1 resistance of the JH hash function up to 2n=6 query complexity, else which is far from optimal. output 0 Even if ¼ is a truly random function, one can find a collision This experiment records every query-response pair that A for the JH compression function only with two backward obtains by oracle queries into a query history Q. We write queries to the basing primitive. In this paper, however, we u = HQ(M) if Q contains all the query-response pairs show that the security is significantly enhanced in iteration. required to compute u = H(M). At the end of the experiment, For c · n=2, we prove that the JH hash function using A would like to find two distinct evaluations yielding a an ideal n-bit permutation and producing c-bit outputs by collision. The collision-finding advantage of A is defined to truncation is collision resistant up to O(2c=2) queries. This be h i bound implies that the JH hash function provides the optimal Advcol(A) = Pr Expcol = 1 : collision resistance in the random permutation model. H A II. PRELIMINARIES The probability is taken over the random choice of P and col A’s coins (if any). For q > 0, we define AdvH (q) as the maximum of Advcol(A) over all adversaries A making at General Notation: For two bitstrings x and y, xjjy denotes H most q queries. the concatenation of x and y. Given x 2 f0; 1gn for an n even integer n, xL and xR denote 2 -bit strings such that x = xLjjxR. III. DESCRIPTION OF THE JH HASH FUNCTION J. Lee is with the Attached Institute of Electronics and Telecommunications Research Institute, Daejeon, Korea (e-mail: [email protected]). n D. Hong is with the Attached Institute of Electronics and Telecommunica- Let ¼ be a permutation on f0; 1g for an even integer n. tions Research Institute, Daejeon, Korea (e-mail: [email protected]). Then the JH compression function F = F [¼] is defined as 2 follows. birthday bound. The next step is to show that the probability of collision is small without the occurrence of Rcol . We begin n n=2 n q F : f0; 1g £ f0; 1g ¡! f0; 1g with the following proposition. (u; z) 7¡! v; Proposition 1: Without the occurrence of Rcoli, jUij · i+1 for i = 0; : : : ; q. where Proof: Note that U0 = fIV g. If jUij > i + 1 for some v = ¼ (u © (zjj0)) © (0jjz): i = 1; : : : ; q, then a certain query, say the j-th query, would produce two distinct orderly reachable nodes, say w and w0. The pictorial representation is given in Fig. 1. n c In this case, we have two paths For c · n=2, let chopc : f0; 1g ! f0; 1g be the function j1 j2 js¡1 js that chops off the (n ¡ c) leftmost bits of its input string, i.e., P1 : IV ! u[1] ! ¢ ¢ ¢ ! u[s ¡ 1] ! w n¡c chopc(x) = x2 if x = x1jjx2 for some x1 2 f0; 1g and c and x2 2 f0; 1g . Then the c-bit JH hash function is defined by 0 0 j0 0 j1 j2 t¡1 jt 0 JHc = chopc ± MD[F ]. In the original submission, n = 1024 P2 : IV ! v[1] ! ¢ ¢ ¢ ! v[t ¡ 1] ! w and c 2 f224; 256; 384; 512g. where the labels are strictly increasing and Since the padding is injective, we can simplify our collision j = j0 = j · i: analysisS by assuming that the domain of the JH hash function s t is 1 f0; 1gni=2 (and ignore the padding scheme). In the i=1 Since w 6= w0 and j = j0 = j · i, u[s ¡ 1] and v[t ¡ 1] are following section, we will prove collision resistance for the s t distinct orderly reachable nodes in U such that chop (u[s ¡ JH hash function assuming ¼ is an ideal random permutation. i c 1]) = chopc(v[t¡1]). This contradicts the condition of :Rcoli. z n/2 Proposition 2: Suppose that an adversary A makes q queries to a random permutation ¼ and its inverse ¼¡1. For u v n=2 L n/2 L N = 2 and q < N, 㼩 q(q + 1) u v Pr [Rcol ] · : R n/2 R q 2(N ¡ 1) Proof: Since Fig. 1. JH compression function. Xq Pr [Rcolq] · Pr [Rcoli ^ :Rcoli¡1] i=1 Xq IV. COLLISION RESISTANCE OF THE JH HASH FUNCTION · Pr [Rcolij:Rcoli¡1] ; (1) Suppose that an information-theoretic adversary A adap- i=1 tively makes q forward or backward queries to an ideal random (where Rcol = ;), we will focus on the estimation of i i 0 permutation ¼, and records a query history Q = f(x ; y ) 2 Pr [Rcol j:Rcol ] for i = 1; : : : ; q. Note that U contains n i i i i¡1 i¡1 f0; 1g : 1 · i · qg. Here ¼(x ) = y and A’s i-th query is at most i nodes without the occurrence of event Rcol by i ¡1 i i¡1 either ¼(x ) or ¼ (y ) for 1 · i · q. Proposition 1. We define a direct graph G on f0; 1gn where a direct edge ¤ ¤ Suppose that A makes a forward query ¼(xLjjxR) = from u to v labeled i is added to G when the i-th query- (y jjy ). Since there are at most one orderly reachable node i i L R response pair (x ; y ) determines an evaluation F [¼](u; z) = v u 2 U such that u = x¤ , the i-th query determines at i i¡1 R R for some z 2 f0; 1gn=2. We will denote such an edge by u ! ¤ most one orderly reachable node v = (yLjj(uL © xL © yR)). v. We note that each query ¼(x jjx ) = (y jjy ) generates ¤ L R L R The probability that uL © xL © yR = wR for some w 2 Ui¡1 n=2 2 edges from ((xL © z)jjxR) to (yLjj(yR © z)) where z 2 is at most iN=(N 2 ¡ q). When A makes a backward query f0; 1gn=2. ¡1 ¤ ¤ ¼ (yLjjyR) = (xLjjxR), the probability that xR = wR for n 2 Definition 1: u 2 f0; 1g is called an orderly reachable some w 2 Ui¡1 is also at most iN=(N ¡ q). Therefore we node if there exists a direct path conclude that i i it¡1 i iN IV !1 u[1] !2 ¢ ¢ ¢ ! u[t ¡ 1] !t u; Pr [Rcol j:Rcol ] · ; i i¡1 N 2 ¡ q such that i1 < i2 < : : : < it¡1 < it. By convention, IV is an and by (1), orderly reachable node. Xq For i = 1; : : : ; q, let Ui be the set of orderly reachable nodes iN q(q + 1) Pr [Rcolq] · · : determined by the first i queries, and let Rcol be the event N 2 ¡ q 2(N ¡ 1) i i=1 that Ui contains a collision in the right-half bits.