Loading [MathJax]/jax/output/SVG/jax.js
Wenxiao QIAO, Siwei SUN, and Lei HU, “New Algebraic Attacks on Grendel with the Strategy of Bypassing SPN Steps,” Chinese Journal of Electronics, vol. 33, no. 3, pp. 635–644, 2024. DOI: 10.23919/cje.2023.00.127
Citation: Wenxiao QIAO, Siwei SUN, and Lei HU, “New Algebraic Attacks on Grendel with the Strategy of Bypassing SPN Steps,” Chinese Journal of Electronics, vol. 33, no. 3, pp. 635–644, 2024. DOI: 10.23919/cje.2023.00.127

New Algebraic Attacks on Grendel with the Strategy of Bypassing SPN Steps

More Information
  • Author Bio:

    QIAO Wenxiao: Wenxiao QIAO is a Ph.D. candidate of Institute of Information Engineering, Chinese Academy of Sciences. Her research interests include Symmetric cryptanalysis and Design. (Email: qiaowenxiao@iie.ac.cn)

    SUN Siwei: Siwei SUN received the Ph.D. degree from Chinese Academy of Sciences in 2013. He is a Professor in School of Cryptology, University of Chinese Academy of Sciences, Beijing, China. His research interests include Symmetric cryptanalysis and Design. (Email: siweisun.isaac@gmail.com)

    HU Lei: Lei HU received the Ph.D. degree from Chinese Academy of Sciences in 1994. He is a Professor in Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China. His research interests include basic theory of applications of pseudorandom sequences and arrays, analysis of cryptographic algorithms and theoretical cryptography. (Email: hulei@iie.ac.cn)

  • Corresponding author:

    SUN Siwei, Email: siweisun.isaac@gmail.com

  • Received Date: April 12, 2023
  • Accepted Date: August 06, 2023
  • Available Online: September 11, 2023
  • Published Date: May 04, 2024
  • The rapid development of modern cryptographic applications such as zero-knowledge, secure multi-party computation, fully homomorphic encryption has motivated the design of new so-called arithmetization-oriented symmetric primitives. As designing ciphers in this domain is relatively new and not well-understood, the security of these new ciphers remains to be completely assessed. In this paper, we revisit the security analysis of arithmetization-oriented cipher Grendel. Grendel uses the Legendre symbol as a component, which is tailored specifically for the use in zero-knowledge and efficiently-varifiable proof systems. At FSE 2022, the first preimage attack on some original full GrendelHash instances was proposed. As a countermeasure, the designer adds this attack into the security analysis and updates the formula to derive the secure number of rounds. In our work, we present new algebraic attacks on GrendelHash. For the preimage attack, we can reduce the complexity or attack one more round than previous attacks for some instances. In addition, we present the first collision attack on some round-reduced instances by solving the constrained input/constrained output problem for the underlying permutations.
  • With the rapid development of new applications such as zero-knowledge (ZK), secure multi-party computation (MPC), fully homomorphic encryption (FHE), some efficient symmetric schemes suitable for these scenarios have been proposed in recent years. Different from traditional symmetric ciphers, the design goal of such ciphers is not to reduce execution time, energy consumption, memory footprint, etc. Instead, they optimize the algebraic complexity, i.e., they attempt to minimize the number of non-linear operations in their natural algorithm description. Therefore, they are often referred to as arithmetization-oriented (AO) ciphers.

    Since the cipher LowMC [1] was proposed at Eurocrypt 2015 by Albrecht et al., which is friendly to MPC and FHE, an increasing number of AO symmetric-key primitives have been raised, including FLIP [2], Kreyvrium [3], Rasta [4], MiMC [5], Feistel-MiMC [5], GMiMC [6], Ciminion [7], Poseidon [8], and Neptune [9]. Most of them use low-degree nonlinear functions such as xxd.

    However, for some use cases of ZK proof systems, it is feasible to reach efficiency with high-degree nonlinear functions. In such a use case, the complexity of proving/verifying a given statement y=F(x) for a certain function F is considered. Instead of proving/verifying y=F(x) directly, proving/verifying an equivalent relation G(x,y)=c may be more efficient. This approach is used in Vision [10], Rescue-Prime [11] and Grendel [12]. In Vision, a high-degree function xx1 is used. In Rescue-Prime, a low-degree function xxd and a high-degree function xx1d are used. In Grendel, the nonlinear layer uses the Legendre symbol as a component, which is a function of high degree p12 over an odd prime field Fp.

    On the other side, these AO symmetric primitives propose new challenges for cryptanalysts to analyze their security. And as designing symmetric ciphers in this domain is reasonably new and not well-studied, some fatal errors may be neglected at the design phase. For instance, soon after the publication of LowMC, a higher-order differential cryptanalysis [13] and an optimized interpolation cryptanalysis [14] were given, which made LowMC move to LowMC v2. Later the difference enumeration technique [15] was proposed, which made LowMC v2 move to LowMC v3. However, the recent attacks [16]–[19] have demonstrated that some instances in LowMC v3 are still insecure.

    In order to better evaluate the security of AO hash functions, Ethereum Foundation put forward a challenge 1 to analyze the constrained input/constrained output (CICO) problem for some round-reduced versions of permutations underlying several sponge-based AO hash functions, including Feistel-MiMC, Poseidon, Rescue-Prime and Reinforced Concrete [20]. Later, the work done by Bariant et al. [21] showed that the security cryptanalysis presented by the challenge’s authors or designers of three such primitives (i.e., Feistel-MiMC, Poseidon and Rescue-Prime) was too optimistic.

    In this paper, we evaluate the security of the AO cipher Grendel [12]. Grendel defines a family of permutations, which are used to obtain hash functions by applying the sponge construction [22]–[24]. At FSE 2022, Grassi et al. [25] proposed the first preimage attack on some original full GrendelHash instances. This attack considered the case where the output of GrendelHash consists of one field element. It used the strategy that if let the input state only have one unknown field element (denoted by x) and all Legendre symbols in the scheme be fixed, then the output of GrendelHash can be written as a univariate polynomial in terms of x, of which the degree may be low. As a countermeasure, the designer adds this attack into the security analysis and updates the formula to derive the secure number of rounds.

    Our contributions In our work, we propose three new algebraic attacks on GrendelHash and consider the case where the digest consists of one field element. In the work done by Bariant et al. [21] at FSE 2023, the strategy of bypassing substitution-permutation networks (SPN) steps was used to solve the CICO problem for the cryptographic permutations which are intended for use in a sponge construction to build hash functions. We give a generalization of this strategy such that it can be used to deal with more than just CICO problem. Our results are detailed as follows:

    1) With bypassing one SPN step, we can find a preimage with a lower complexity than previous attacks for some round-reduced instances.

    2) Regarding the special case where the sponge capacity consists of one field element, with bypassing two SPN steps, a) For the preimage attack, the complexity can be reduced further and we can attack one more round than previous attacks for some round-reduced instances; b) By solving the CICO problem for the underlying permutations, we propose the first collision attack on some round-reduced instances.

    The results are summarized in Tables 13. The complexity of original preimage attack is derived from the formula presented in Scetion V in [25]. The complexity of designer’s attack is derived from the formula presented in Table 1 in [12].

    Table  1.  A summary of the attacks on GrendelHash instances with parameters α=2,λ=128,log2(p)256
    Instance (α,m,c,R) N Type Complexity Ref.
    (2,4,1,31) 23 Preimage 2138.34 Original [25]
    2123.05 Designer’s [12]
    2119.64 Section VI.2
    24 Preimage 2143.49 Original [25]
    2128.17 Designer’s [12]
    2124.74 Section VI.2
    24 Collision 2124.74 Section VI.3
    (2,8,1,17) 13 Preimage 2134.35 Original [25]
    2123.40 Designer’s [12]
    2122.50 Section V
    2112.32 Section VI.2
    14 Preimage 2143.61 Original [25]
    2132.61 Designer’s [12]
    2121.50 Section VI.2
    14 Collision 2121.50 Section VI.3
    (2,12,1,12) 9 Preimage 2129.05 Original [25]
    2122.34 Designer’s [12]
    2117.71 Section V
    2103.54 Section VI.2
    10 Preimage 2142.43 Original [25]
    2135.64 Designer’s [12]
    2116.71 Section VI.2
    10 Collision 2116.71 Section VI.3
    Note: The complexity is estimated in field operations. R denotes the secure number of rounds; N denotes the number of attacked rounds; Bold numbers indicate the attacks are valid.
     | Show Table
    DownLoad: CSV
    Table  2.  A summary of the attacks on GrendelHash instances with parameters α=3,λ=128,log2(p)256
    Instance (α,m,c,R) N Type Complexity Ref.
    (3,8,1,16) 12 Preimage 2133.70 Original [25]
    2121.19 Designer’s [12]
    2120.70 Section V
    2109.92 Section VI.2
    13 Preimage 2143.56 Original [25]
    2131 Designer’s [12]
    2119.70 Section VI.2
    13 Collision 2119.70 Section VI.3
    (3,12,1,12) 9 Preimage 2135.94 Original [25]
    2127.60 Designer’s [12]
    2123.29 Section V
    2108.43 Section VI.2
    10 Preimage 2149.90 Original [25]
    2141.49 Designer’s [12]
    2122.29 Section VI.2
    10 Collision 2122.29 Section VI.3
    (3,12,2,12) 9 Preimage 2135.94 Original [25]
    2126.60 Designer’s [12]
    2123.29 Section V
    Note: The complexity is estimated in field operations. R denotes the secure number of rounds; N denotes the number of attacked rounds; Bold numbers indicate the attacks are valid.
     | Show Table
    DownLoad: CSV
    Table  3.  A summary of the attacks on GrendelHash instances with parameters α=5,λ=128,log2(p)256
    Instance (α,m,c,R) N Type Complexity Ref.
    (5,8,1,15) 11 Preimage 2133.24 Original [25]
    2119.46 Designer’s [12]
    2119.06 Section V
    2107.53 Section VI.2
    12 Preimage 2143.87 Original [25]
    2130.03 Designer’s [12]
    2118.06 Section VI.2
    12 Collision 2118.06 Section VI.3
    (5,12,1,11) 8 Preimage 2129.18 Original [25]
    2119.58 Designer’s [12]
    2115.37 Section V
    299.74 Section VI.2
    9 Preimage 2143.91 Original [25]
    2134.24 Designer’s [12]
    2114.37 Section VI.2
    9 Collision 2114.37 Section VI.3
    (5,12,2,11) 8 Preimage 2129.18 Original [25]
    2118.58 Designer’s [12]
    2115.37 Section V
    Note: The complexity is estimated in field operations. R denotes the secure number of rounds; N denotes the number of attacked rounds; Bold numbers indicate the attacks are valid.
     | Show Table
    DownLoad: CSV

    Organization of the paper In Section II, we give some notations and related definitions. Besides, we give a brief description of Grendel and the algorithm for solving univariate system. In Section III, we revisit the original preimage attack on GrendelHash. In Section IV, we give a generalization of the strategy of bypassing SPN steps. In Section V, we introduce our first preimage attack. In Section VI, we introduce our second preimage attack and the first collision attack. The experimental results of our attacks are given in Section VII. Finally, the paper is concluded in Section VIII.

    In this section, we will first give some notations and related definitions. Then, we will give a brief description of Grendel [12]. Finally, we will describe the algorithm [21] for solving univariate system.

    In the following content of this paper, p denotes an odd prime. Fp denotes the finite field with p elements. For x=(x0,,xa1)Fap and y=(y0,,yb1)Fbp, the concatenation of x and y is denoted by xy, i.e., xy=(x0,,xa1,y0,,yb1)Fa+bp.

    Definition 1 The hash function H is λ-bit secure against preimage attack if no algorithm has an expected complexity less than 2λ for finding u given h such that H(u)=h.

    Definition 2 The hash function H is λ-bit secure against collision attack if no algorithm has an expected complexity less than 2λ for finding u1,u2 such that H(u1)=H(u2) and u1u2.

    Definition 3 Let F:FnpFnp be a permutation. Zt is the set of all elements of Fnp such that their last t coordinates are equal to 0. The CICO problem is finding xFnp such that xZt and F(x)Zt.

    Grendel [12] defines a family of permutations with SHARK-like constructions [26]. Based on the Grendel permutation, the Grendel hash function is obtained by applying the sponge construction [22]–[24] and using the primitive as an inner permutation. The different permutations in the family are determined by the triple (p,m,c,λ) representing respectively the size of the field over which the primitive’s operations are defined, the number of field elements in the state, the number of field elements in the sponge capacity and the target security level. The secure number of rounds R can be obtained from these parameters as follows:

    R=max{Rld,Rsub,Rroot,RGr¨o,RGr¨o} (1)

    where

    Rld=min{R1|(2αp)R221.25λ,(4α2p)R221.25λ}Rsub=min{R1|pm+1221.25λ,pm21.25λ}Rroot=min{R1|p21.25λ,2RmcαRR221.25λ}RGr¨o=min{R1|(2Rm2c+1+(Rmc)(α+3)81+(Rmc)(α+3)8)221.25λ}RGr¨o=min{R1|2Rmc(Rmc+1+(Rmc)(α1)91+(Rmc)(α1)9)221.25λ}

    In other words, R is set to the smallest integer such that the complexities of all attacks presented in Table 1 in [12] are at least 21.25λ.

    Grendel permutation uses the Legendre symbol as a component. Therefore we first introduce the definition of the Legendre symbol.

    Definition 4 The Legendre symbol is a function (p):FpFp defined as

    (xp)={0,ifx=01,ifxQRp1,ifxQRp{0}

    where QRp={b2|bFp{0}}.

    Grendel permutation P:FmpFmp (m2) iterates a round function R times. At the i-th (0iR1) round the round function consists of the following operations, as depicted in Figure 1.

    Figure  1.  The Grendel round function.

    1) SboxLayer (SB): A S-box S:FpFp is applied to the m elements of the state in parallel. The S-box is defined as S(x)=xα×(xp), where if p3mod4 then α=2 and if p1mod4 then α3 is the smallest integer such that gcd(α,p1)=1.

    2) LinearLayer (L): The state vector is multiplied with an MDS matrix M of size m×m.

    3) ConstantAddition (AC): The round constant Cim+jFp is added to the j-th element of the state, where j{0,1,,m1}.

    By using the Grendel permutation in a sponge construction, the Grendel hash function is obtained. Specifically, r and c denote the number of field elements in the sponge rate and the sponge capacity respectively. And the number of field elements in the digest is denoted by l. Then for the input consisting of elements of Fp, the procedure for computing its digest consists of the following operations, as depicted in Figure 2.

    Figure  2.  The absorbing and squeezing phases.

    1) Padding: If the input length is variable, then the input is padded as follows: first append a single 1 to the input, and then append zeros until the total length is a multiple of r. If the input length is fixed, then the input does not need to be processed in this phase. Then divide the result into blocks m0,m1,,mk1, where each block mi (0ik1) consists of r elements of Fp.

    2) Initializing: The state is initialized to IV=(0,0,,0)Fmp.

    3) Absorbing: The blocks m0,m1,,mk1 are added into the top r elements of the state, interleaved with applications of the permutation P. When all blocks are processed, switch to the squeezing phase.

    4) Squeezing: First extract min(l,r) elements from the top r elements of the state. If l>r, then apply P to the state and extract min(lr,r) elements from the top r elements of the state. Repeat this process until the number of extracted elements reach l.

    In addition, for the target security level λ-bit, the number of field elements in the sponge capacity c and the number of field elements in the digest l should satisfy clog2(p)2λ and llog2(p)2λ.

    In this part, we will introduce the algorithm [21] for solving univariate system. Let g(x)Fp[x] and d denote the degree of g(x). Our goal is to find the roots of g(x) in Fp. The algorithm consists of the following steps.

    1) Use repeated squaring algorithm [27] in Fp[x]/g(x) to compute q(x)=xpmodg(x).

    2) Compute r(x)=gcd(q(x)x,g(x)).

    3) Factor r(x).

    Complexity evaluation The algorithm’s complexity given in [21] is O(dlog2(d)(log2(d)+log2(p))log2(log2(d))) field operations.

    Specifically, multiplying two polynomials of degree n by using an FFT algorithm needs O(nlog2(n)log2(log2(n))) field operations. O(dlog2(p)log2(d)log2(log2(d))) field operations are needed in step 1); O(d(log2(d))2log2(log2(d))) field operations are needed in step 2). In general, the degree of r(x) is only one or two because g(x) has few roots in Fp. Thus, the complexity of the third step is negligible.

    We note that this algorithm was also used in the original preimage attack [25] and had a different complexity evaluation. However, the complexity given in [21] is sharper, which will be used in our work.

    In this section, we will briefly revisit the original preimage attack [25] on N-round GrendelHash instances, of which the number of field elements in the digest l is 1. And the number of field elements in the sponge rate r2.

    Given a digest hFp, the overall procedure for finding a preimage can be separated into the following steps, as depicted in Figure 3.

    Figure  3.  Introduce the steps of the original preimage attack, where the unknown Legendre symbols are colored in yellow and the known intermediate values are colored in gray.

    1) Choose u=(u1,,ur1)Fr1p randomly. Let the input of GrendelHash be xuFrp, where x is an unknown variable.

    2) Guess the values (only 1 or −1) of the L=1+m(N1) unknown Legendre symbols (i.e., the yellow states in the Figure 3) in the N rounds. Then write the first element in the output state of N-round Grendel permutation P as a polynomial in terms of x, which is denoted by p(x) and has a degree of αN.

    3) Solve the equation p(x)h=0 in Fp. For each solution x, if all computed Legendre symbols equal the guessed ones, then the solution is valid and return xu. If all solutions we find are not valid, then go to step 2) and guess the Legendre symbols with values we have not tried before.

    4) If all possible guesses are traversed and no valid solution is found, then go to step 1) and try again with a different u.

    Success probability For a random uFr1p, it can be expected that there is a value x0Fp such that the digest of x0u equals h. The probability that a Legendre symbol is equal to 1 is p12p, the probability that a Legendre symbol is equal to −1 is p12p, and the probability that a Legendre symbol is equal to 0 is 1p. As for x0, the probability that the L Legendre symbols are different from 0 is (11p)L, which is extremely close to 1 for the parameters considered in the attack. Therefore, the x0 can be found successfully with a high enough probability. In order to increase the success probability of the attack, try twice with different u.

    As a countermeasure, the designer added this attack into the security analysis. The total complexity is estimated as 2NmcαNN2 by the designer in [12].

    In this section, we will give a generalization of the strategy of bypassing SPN steps, which was originally proposed by Bariant et al. [21] to solve the CICO problem (in the case where Zt=Z1).

    Let F=F1F0 be a permutation of Fnp with a SPN construction. Let BFnp and Hbj={(y1,y2,,yn) Fnp|yj=b}, where 1jn and bFp. Our problem is finding xFnp such that xB and F(x)Hbj.

    If we find an affine space W={sβ+γ|sFp} in which β=(β0,,βn1),γ=(γ0,,γn1)Fnp such that F10(W)B, then we will handle the permutation F1 rather than the full permutation F. It could be easier to solve the problem. The detailed procedure can be separated into the following steps, as depicted in Figure 4.

    Figure  4.  Bypass SPN steps.

    1) Let the output state of F0 (i.e., the input state of F1) be zβ+γ=(β0z+γ0,,βn1z+γn1), where z is an unknown variable.

    2) Write the j-th element in the output state of F1 as a polynomial in terms of z, which is denoted by fj1(z).

    3) Find a root z0 in Fp for the polynomial fj1(z)b.

    4) Compute x0=F10(z0β+γ) and return x0.

    In this section, we will introduce our first preimage attack on N-round GrendelHash instances. The number of field elements in the output l=1, the number of field elements in the sponge rate r2, and log2(p)2λ. In the following, each SPN step consists of one round of Grendel.

    Let B1 be the set of all elements of Fmp such that their last c coordinates are equal to 0, i.e., B1={(x0,x1,,xm1)Fmp|xi=0,mcim1}. For a given digest hFp, if we find xFmp such that xB1 and P(x)Hh1, where P is the underlying N-round Grendel permutation, then we will find a preimage. Therefore, we can exploit the strategy of bypassing SPN steps presented in Section IV in this attack.

    Let N-round Grendel permutation be P=PN1P1, where P1 consists of one SPN step of Grendel, i.e., the operations in the 0th round. Let the MDS matrix M be

    M=[a0,0a0,1a0,m1a1,0a1,1a1,m1am1,0am1,1am1,m1]

    Choose w=(w1,,wr1)Fr1p. Let β=(a0,0,a1,0,,am1,0) and γ=(r1i=1a0,iwi+C0,r1i=1a1,iwi+C1,,r1i=1am1,iwi+Cm1). Then the affine space W={sβ+γ|sFp} satisfies P11(W)B1, as depicted in Figure 5.

    Figure  5.  Bypass one SPN step.

    Therefore, the remaining task is to find z0 in Fp such that PN1(z0β+γ)Hh1.

    In the following, we will introduce our first preimage attack in detail. Let the input state of PN1 be zβ+γ, where z is an unknown variable. Denote the first coordinate in PN1(zβ+γ) by f1N1(z). In order to find z0 in Fp such that PN1(z0β+γ)Hh1, instead of solving the equation f1N1(z)=h in Fp directly, we exploit the strategy that was used in the original preimage attack [25].

    Specifically, the procedure for finding a preimage in this attack can be separated into the following steps (as shown in Algorithm 1).

    1) Choose w=(w1,,wr1)Fr1p randomly. Let β=(a0,0,a1,0,,am1,0) and γ=(r1i=1a0,iwi+C0,r1i=1a1,iwi+C1,,r1i=1am1,iwi+Cm1).

    2) Let the input of PN1 be zβ+γ, where z is an unknown variable.

    3) Guess the values (only 1/−1) of the L1=m(N1) unknown Legendre symbols in PN1. And write the first element in the output state of PN1 as a polynomial in terms of z, which is denoted by p1(z).

    4) Solve the equation p1(z)h=0 in Fp. For each solution z, if all computed Legendre symbols equal the guessed ones in the N1 rounds, then the solution is valid and return the first r elements in P11(zβ+γ). If all solutions we find are invalid, then go to step 3) and guess the Legendre symbols with values we have not tried before.

    5) If all possible guesses are traversed and no valid solution is found, then go to step 1) and try again with a different w.

    Algorithm 1 Our first preimage attack on N-Round GrendelHash
    Input: The given digest hFp.
    Output: A preimage.
    1: Choose w=(w1,w2,,wr1)Fr1p randomly;
    2: Let β=(a0,0,a1,0,,am1,0) and γ=(r1i=1a0,iwi+C0,r1i=1a1,iwi+C1,,r1i=1am1,iwi+Cm1);
    3: Let the input of PN1 be zβ+γ, where z is an unknown variable;
    4: for guessed values (only 1 or −1) of L1 Legendre symbols do
    5:  Build the polynomial p1(z) forwards to represent the first element in the output of PN1;
    6:  Solve the equation p1(z)h=0 in Fp;
    7:  for solution z we find do
    8:   if all computed Legendre symbols equal the guessed ones then
    9:     Compute x=P11(zβ+γ);
    10: return x[0:r];
    11: return No valid solution, try again with a different w.

    Success probability For a random wFr1p, it can be expected that there is a value z0 in Fp such that PN1(z0β+γ)Hh1. As for z0, the probability that the L1 Legendre symbols in PN1 are different from 0 is equal to (11p)L1, which is extremely close to 1 for the parameters considered in our attack. Thus, z0 can be found successfully with a high enough probability. Similarly to that in the original preimage attack, we try twice with different w to increase the success probability of the attack.

    Complexity evaluation For each guess, we need to find the roots of the polynomial p1(z)h in Fp and it can be expected that the number of roots in Fp is 1. Since the degree D1 of p1(x)h is αN1, then as shown in Section II.3, the complexity of solving the equation p1(z)h=0 is equal to

    C1sol=D1log2(D1)(log2(D1)+log2(p))log2(log2(D1))

    For the solution, when verifying whether it is valid, we need to compute the Legendre symbols forwards until there is a computed value that do not match the guessed one. The expected number of Legendre symbols that need to be computed is equal to

    i1i2i=2

    In addition, the complexity of computing a Legendre symbol [28] is equal to

    Cver=log2(p)(log2(log2(p)))2log2(log2(log2(p)))

    Hence, the expected complexity of our first preimage attack on N-round GrendelHash is

    C1=2L1+1×(C1sol+2×Cver)

    The results of our first preimage attack on some instances are summarized in Tables 13.

    Remark In our first preimage attack, the reasons for the reduced complexity compared to the original preimage attack [25] are as follows. First, the number of Legendre symbols needed to be guessed is reduced by 1. Second, the degree of univariate polynomial needed to be solved after guessing the values of the unknown Legendre symbols is αN1, which is α times lower than that in the original preimage attack. Third, for the algorithm of solving univariate system, we use the complexity evaluation given in [21] at FSE 2023, which is better than that used in [25].

    In this section, we will introduce our second preimage attack and the first collision attack on some N-round GrendelHash instances. The number of field elements in the output l=1, the number of field elements in the sponge rate r2, the number of field element in the sponge capacity c=1, and log2(p)2λ.

    Let B2 be the set of all elements of Fmp such that their last coordinate is equal to 0, i.e., B2={(x0,x1,,xm1)Fmp|xm1=0}. Let the underlying permutation be P=PN2P2, where P2 consists of two SPN steps of Grendel, i.e., the operations in the 0th round and the 1st round. Let the inverse of M be

    M1=[b0,0b0,1b0,m1b1,0b1,1b1,m1bm1,0bm1,1bm1,m1]

    Let β=(S(A0),S(A1),,S(Am2),0) and γ=(0,0,,0,g), where Ai (0im2) and g are constants in Fp that satisfy the following conditions:

    m2i=0Aibm1,i=0g=S(m1j=0bm1,jCjbm1,m1)=(m1j=0bm1,jCjbm1,m1)α+p12

    And let ˜βT=MβT and ˜γT=MγT+(Cm,Cm+1,,C2m1)T. Then the affine space W1={s˜β+˜γ|sFp} satisfies that P12(W1)B2, as depicted in Figure 6.

    Figure  6.  Bypass two SPN steps.

    In the following, we will describe the steps of our second preimage attack. For a given digest hFp, in order to find z1 in Fp such that PN2(z1˜β+˜γ)Hh1, we also exploit the strategy that was used in the original preimage attack [25].

    Specifically, the procedure for finding a preimage in this attack can be separated into the following steps (as shown in Algorithm 2).

    1) Let the input state of PN2 be z˜β+˜γ, where z is an unknown variable.

    2) Guess the values (only 1/−1) of the L2=m(N2) unknown Legendre symbols in the PN2. And write the first element in the output of PN2 as a polynomial in terms of z, which is denoted by p2(z).

    3) Solve the equation p2(z)h=0 in Fp. For each solution z, if the computed Legendre symbols equal the guessed ones, then the solution is valid and go to step 4). If all solutions are invalid, then go to step 2) and guess the Legendre symbols with values we have not tried before.

    4) Compute x=P12(z˜β+˜γ) and return the first r elements of x.

    Algorithm 2 Our second preimage attack on N-round GrendelHash
    Input: The given digest hFp.
    Output: A preimage.
    1: Let the input of PN2 be z˜β+˜γ, where z is an unknown variable;
    2: for guessed values (only 1 or -1) of L2 Legendre symbols do
    3:  Build the polynomial p2(z) forwards to represent the first element in the output state of PN2;
    4:  Solve the equation p2(z)h=0 in Fp;
    5:  for solution z we find do
    6:   if all computed Legendre symbols equal the guessed ones then
    7:    Compute x=P12(z˜β+˜γ);
    8:  return x[0:r];
    9: return No valid solution.

    Success probability It can be expected that there is a value z1Fp such that the first element in PN2(z1˜β+˜γ) equals the given digest h. As for z1, the probability that the L2 Legendre symbols are different from 0 is equal to (11p)L2, which is extremely close to 1 for the parameters considered in our attack. Therefore, we can find a preimage for a given digest h with a high enough probability.

    Complexity evaluation In this attack, for each guess, the degree D2 of p2(z)h is αN2. Then the complexity of solving the equation p2(z)h=0 is equal to

    C2sol=D2log2(D2)(log2(D2)+log2(p))log2(log2(D2))

    Therefore, the expected complexity of our second preimage attack on N-round GrendelHash is

    C2=2L2×(C2sol+2×Cver) (2)

    The results of our second preimage attack on some instances are summarized in Tables 13.

    In the following, we will present our collision attack by solving the CICO problem (in the case where Zt=Z1) for the underlying permutation P. The procedure for finding a solution to the CICO problem is almost the same as the steps of our second preimage attack. After finding a solution x=(x0,x1,,xr1,0) to the CICO problem, where P(x)=(y0,y1,yr1,0), let m=(x0,x1,,xr1) and m=(x0y0,x1y1,,xr1yr1). Then GrendelHash(m)=GrendelHash(mm).

    Specifically, the procedure for the collision attack can be separated into the following steps (as shown in Algorithm 3).

    1) Let the input state of PN2 be z˜β+˜γ, where z is an unknown variable.

    2) Guess the values (only 1/−1) of the L2=m(N2) unknown Legendre symbols in the PN2. And write the last element in the output of PN2 as a polynomial in terms of z, which is denoted by p3(z).

    3) Solve the equation p3(z)=0 in Fp. For each solution z, if the computed Legendre symbols equal the guessed ones, then the solution is valid and go to step 4). If all solutions are invalid, then go to step 2) and guess the Legendre symbols with values we have not tried before.

    4) Compute x=P12(z˜β+˜γ) and y=PN2(z˜β+˜γ). Denote x=(x0,x1,,xr1, 0) and y=(y0,y1,,yr1,0). Let m=(x0,x1,,xr1) and m=(x0y0,x1y1,,xr1yr1). Return m and mm.

    Algorithm 3 Our collision attack on N-round GrendelHash
    Output: A collision.
    1: Let the input state of PN2 be z˜β+˜γ, where z is an unknown variable;
    2: for guessed values (only 1 or 1) of L2 Legendre symbols do
    3:  Build the polynomial p3(z) forwards to represent the last element in the output state of PN2;
    4:  Solve the equation p3(z)=0 in Fp;
    5:  for solution z we find do
    6:   if all computed Legendre symbols equal the guessed ones then
    7:    Compute x=P12(z˜β+˜γ) and y=PN2(z˜β+˜γ);
    8:    Let m=x[0:r] and m=x[0:r]y[0:r];
    9:  return m, mm.

    We note that the success probability and expected complexity of our collision attack are the same as those of our second preimage attack that presented in Section VI.2. The results of our collision attack on some instances are summarized in Tables 13.

    In order to verify the feasibility of our methods, we made experiments for our three new algebraic attacks on the round-reduced GrendelHash instance with parameters (p,m,r,c,λ)=(26459,3,2,1,32). And the number of attacked round N=6. We provide our code at https://github.com/wxqiao/New-algebraic-attacks-on-Grendel. Let the prime field Fp={0,1,,p1}.

    First, we performed 100 tests for our first preimage attack. By using the Algorithm 1, 83 tests of them can be attacked successfully. For instance, for a given digest h1=4509062438608773474Fp, we found a preimage

    (1856239268434541265,11004345080245978645)F2p

    Second, we performed 1000 tests for our second preimage attack. By using the Algorithm 2, 608 tests of them can be attacked successfully. For instance, for a given digest h2=14681296474556465288Fp, we found a preimage

    (15277210688656701824,1087535840334498627)F2p

    Third, for our collision attack, by using the method presented in Section VI.3, we found a solution x= (3978053920827369818,11054388833269671370,0)F3p to the CICO problem for the underlying Grendel permutation P successfully, where P(x)=(12866554063376284852,7184824262592905636,0)F3p. Let m=(3978053920827369818,11054388833269671370) F2p and

    m=(397805392082736981812866554063376284852,110543888332696713707184824262592905636)=(9558243931160636523,3869564570676765734)F2p

    Then, a collision GrendelHash(m)=GrendelHash(mm) is obtained for this round-reduced GrendelHash instance successfully.

    In this paper, we analyze the security of AO cipher Grendel. We propose three algebraic attacks on some GrendelHash instances. As a result, we can find a preimage with a lower complexity or attack one more round than previous attacks [12], [25] for some GrendelHash instances. In addition, we present the first collision attack on some round-reduced GrendelHash instances by solving the CICO problem for the underlying permutations.

    1It was published on November 1st 2021 at https://www.zkhashbounties.info/.

  • [1]
    M. R. Albrecht, C. Rechberger, T. Schneider, et al., “Ciphers for MPC and FHE,” in Proceedings of the 34th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Sofia, Bulgaria, pp.430–454, 2015.
    [2]
    P. Méaux, A. Journault, F. X. Standaert, et al., “Towards stream ciphers for efficient FHE with low-noise ciphertexts,” in Proceedings of the 35th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Vienna, Austria, pp.311–343, 2016.
    [3]
    A. Canteaut, S. Carpov, C. Fontaine, et al., “Stream ciphers: A practical solution for efficient homomorphic-ciphertext compression,” Journal of Cryptology, vol. 31, no. 3, pp. 885–916, 2018. DOI: 10.1007/s00145-017-9273-9
    [4]
    C. Dobraunig, M. Eichlseder, L. Grassi, et al., “Rasta: A cipher with low ANDdepth and few ANDs per bit,” in Proceedings of the 38th Annual International Cryptology Conference, Santa Barbara, CA, USA, pp.662–692, 2018.
    [5]
    M. Albrecht, L. Grassi, C. Rechberger, et al., “MiMC: Efficient encryption and cryptographic hashing with minimal multiplicative complexity,” in Proceedings of the 22nd International Conference on the Theory and Application of Cryptology and Information Security, Hanoi, Vietnam, pp.191–219, 2016.
    [6]
    M. R. Albrecht, L. Grassi, L. Perrin, et al., “Feistel structures for MPC, and more, ” in Proceedings of the 24th European Symposium on Research in Computer Security, Luxembourg, pp.151–171, 2019.
    [7]
    C. Dobraunig, L. Grassi, A. Guinet, et al., “CIMINION: Symmetric encryption based on toffoli-gates over large finite fields,” in Proceedings of the 40th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, pp. 3–34, 2021.
    [8]
    L. Grassi, D. Khovratovich, C. Rechberger, et al., “Poseidon: A new hash function for zero-knowledge proof systems,” in Proceedings of the 30th USENIX Security Symposium, online, pp.519–535, 2021.
    [9]
    L. Grassi, S. Onofri, M. Pedicini, et al., “Invertible quadratic non-linear layers for MPC-/FHE-/ZK-friendly schemes over Fnp: Application to poseidon,” IACR Transactions on Symmetric Cryptology, vol. 2022, no. 3, pp. 20–72, 2022. DOI: 10.46586/tosc.v2022.i3.20-72
    [10]
    A. Aly, T. Ashur, E. Ben-Sasson, et al., “Design of symmetric-key primitives for advanced cryptographic protocols,” IACR Transactions on Symmetric Cryptology, vol. 2020, no. 3, pp. 1–45, 2020. DOI: 10.13154/tosc.v2020.i3.1-45
    [11]
    A. Szepieniec, T. Ashur, and S. Dhooghe, “Rescue-prime: A standard specification (SoK),” Available at: https://eprint.iacr.org/2020/1143, 2020.)
    [12]
    A. Szepieniec, “On the use of the Legendre symbol in symmetric cipher design, ” Available at: https://eprint.iacr.org/2021/984, 2021.
    [13]
    C. Dobraunig, M. Eichlseder, and F. Mendel, “Higher-order cryptanalysis of LowMC,” in Proceedings of the 18th International Conference, Seoul, South Korea, pp. 87–101, 2016.
    [14]
    I. Dinur, Y. W. Liu, W. Meier, et al., “Optimized interpolation attacks on LowMC,” in Proceedings of the 21st International Conference on the Theory and Application of Cryptology and Information Security, Auckland, New Zealand, pp. 535–560, 2015.
    [15]
    C. Rechberger, H. Soleimany, and T. Tiessen, “Cryptanalysis of low-data instances of full LowMCv2,” IACR Transactions on Symmetric Cryptology, vol. 2018, no. 3, pp. 163–181, 2018. DOI: 10.13154/tosc.v2018.i3.163-181
    [16]
    F. K. Liu, T. Isobe, and W. Meier, “Cryptanalysis of full LowMC and LowMC-M with algebraic techniques,” in Proceedings of the 41st Annual International Cryptology Conference, Virtual Event, pp.368–401, 2021.
    [17]
    I. Dinur, “Cryptanalytic applications of the polynomial method for solving multivariate equation systems over GF(2),” in Proceedings of the 40th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, pp. 374–403, 2021.
    [18]
    F. K. Liu, S. Sarkar, G. L. Wang, et al., “Algebraic meet-in-the-middle attack on LowMC,” in Proceedings of the 28th International Conference on the Theory and Application of Cryptology and Information Security, Taipei, China, pp. 225–255, 2022.
    [19]
    F. K. Liu, W. Meier, S. Sarkar, et al., “New low-memory algebraic attacks on LowMC in the picnic setting,” IACR Transactions on Symmetric Cryptology, vol. 2022, no. 3, pp. 102–122, 2022. DOI: 10.46586/tosc.v2022.i3.102-122
    [20]
    L. Grassi, D. Khovratovich, R. Lüftenegger, et al., “Reinforced concrete: A fast hash function for verifiable computation,” in Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security, Los Angeles, CA, USA, pp. 1323–1335, 2022.
    [21]
    A. Bariant, C. Bouvier, G. Leurent, et al., “Algebraic attacks against some arithmetization-oriented primitives,” IACR Transactions on Symmetric Cryptology, vol. 2022, no. 3, pp. 73–101, 2022. DOI: 10.46586/tosc.v2022.i3.73-101
    [22]
    G. Bertoni, J. Daemen, M. Peeters, et al., “Sponge functions,” Available at: https://keccak.team/files/SpongeFunctions.pdf, 2007.
    [23]
    G. Bertoni, J. Daemen, M. Peeters, et al., “On the indifferentiability of the sponge construction,” in Proceedings of the 27th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Istanbul, Turkey, pp.181–197, 2008.
    [24]
    G. Bertoni, J. Daemen, M. Peeters, et al., “Cryptographic sponge functions,” Available at: https://keccak.team/files/CSF-0.1.pdf, 2011-01-14.
    [25]
    L. Grassi, D. Khovratovich, S. Rønjom, et al., “The Legendre symbol and the modulo-2 operator in symmetric schemes over Fnp: Preimage Attack on Full Grendel,” IACR Transactions on Symmetric Cryptology, vol. 2022, no. 1, pp. 5–37, 2022. DOI: 10.46586/tosc.v2022.i1.5-37
    [26]
    V. Rijmen, J. Daemen, B. Preneel, et al., “The cipher SHARK,” in Proceedings of the 3rd International Workshop on Fast Software Encryption, Cambridge, UK, pp.99–111, 1996.
    [27]
    J. von zur Gathen and J. Gerhard, Modern Computer Algebra, 3rd ed., Cambridge University Press, New York, NY, USA, pp.75-76, 2013.
    [28]
    R. P. Brent and P. Zimmermann, “An O(M(n)logn) algorithm for the Jacobi symbol,” in Proceedings of the 9th International Algorithmic Number Theory Symposium, Nancy, France, pp.83–95, 2010.
  • Related Articles

    [1]Zhang Zhiyu, Li Shun, Sun Siwei, Wang Caibing, Hu Lei. Meet-in-the-Middle Preimage Attack on Round-Reduced Areion256[J]. Chinese Journal of Electronics. DOI: 10.23919/cje.2024.00.043
    [2]Li Yunqiang, Cui Ting. Linear Forgery Attacks on the Authenticated Encryption Cipher ACORN-Like[J]. Chinese Journal of Electronics, 2025, 34(1): 257-265. DOI: 10.23919/cje.2023.00.016
    [3]ZHANG Zhongya, WU Wenling, WANG Bolin. Quantum Differential Collision Distinguishing Attacks on Feistel Schemes[J]. Chinese Journal of Electronics, 2021, 30(6): 1030-1037. DOI: 10.1049/cje.2021.07.026
    [4]XIE Min, TIAN Feng, LI Jiaqi. Differential Fault Attack on GIFT[J]. Chinese Journal of Electronics, 2021, 30(4): 669-675. DOI: 10.1049/cje.2021.05.008
    [5]MA Zhen, TIAN Tian, QI Wenfeng. Differential Fault Attack on the Stream Cipher LIZARD[J]. Chinese Journal of Electronics, 2021, 30(3): 534-541. DOI: 10.1049/cje.2021.04.007
    [6]FENG Guangsheng, LIN Junyu, ZHAO Qian, WANG Huiqiang, LYU Hongwu, ZHAO Xiaoyu, HAN Jizhong, LI Bingyang. A Differential Game Based Approach Against Objective Function Attack in Cognitive Networks[J]. Chinese Journal of Electronics, 2018, 27(4): 879-888. DOI: 10.1049/cje.2017.08.006
    [7]DING Lin, GUAN Jie. Related-Key Chosen IV Attack on K2[J]. Chinese Journal of Electronics, 2011, 20(2): 365-369.
    [8]WU Zhijun and SHI Zhen. Filtering LDoS Attack by FIR Filter[J]. Chinese Journal of Electronics, 2010, 19(2): 275-278.
    [9]GU Haihua, GU Dawu. Extending the GHS Attack of Hyperelliptic Curves[J]. Chinese Journal of Electronics, 2009, 18(4): 741-743.
    [10]ZHOU Yongbin, WU Wenling, XU Nannan, FENG Dengguo. Differential Fault Attack on Camellia[J]. Chinese Journal of Electronics, 2009, 18(1): 13-19.

Catalog

    Figures(6)  /  Tables(6)

    Article Metrics

    Article views (449) PDF downloads (414) Cited by()
    Related

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return