Todo Et Al. - 2018 - Cube Attacks On Non-Blackbox Polynomials Based On Division Property-Annotated
Todo Et Al. - 2018 - Cube Attacks On Non-Blackbox Polynomials Based On Division Property-Annotated
Abstract. The cube attack is a powerful cryptanalytic technique and is especially powerful
against stream ciphers. Since we need to analyze the complicated structure of a stream cipher in
the cube attack, the cube attack basically analyzes it by regarding it as a blackbox. Therefore,
the cube attack is an experimental attack, and we cannot evaluate the security when the size
of cube exceeds an experimental range, e.g., 40. In this paper, we propose cube attacks on
non-blackbox polynomials. Our attacks are developed by using the division property, which
is recently applied to various block ciphers. The clear advantage is that we can exploit large
cube sizes because it never regards the cipher as a blackbox. We apply the new cube attack
to Trivium, Grain128a, ACORN and Kreyvium. As a result, the secret keys of 832-round
Trivium, 183-round Grain128a, 704-round ACORN and 872-round Kreyvium are recovered.
These attacks are the current best key-recovery attack against these ciphers.
Keywords: Cube attack, Stream cipher, Division property, Higher-order differential crypt-
analysis, MILP, Trivium, Grain128a, ACORN, Kreyvium
1 Introduction
Cube attack is one of general cryptanalytic techniques against symmetric-key cryptosystems pro-
posed by Dinur and Shamir [DS09]. Especially, the cube attack has been successfully applied to
various stream ciphers [ADMS09,DS11,FV13,DMP+ 15,SBD+ 16]. Let x and v be secret and public
variables of stream ciphers, respectively, and let f (x, v) be the first bit of key stream. Some bits in
v are active, where they take all possible combinations of values. The set of these values is denoted
as a cube, and the sum of f (x, v) over all values of the cube is evaluated. Then, this sum is also
represented as a polynomial whose inputs are x and v, and the polynomial is denoted as a superpoly
of the cube. The superpoly is more simplified than the original f (x, v), and secret variables x are
recovered by analyzing this simplified polynomial. Unfortunately, it is really difficult to analyze the
structure of the superpoly. Therefore, the target stream cipher f (x, v) is normally regarded as a
blackbox polynomial in the cube attack, and this blackbox polynomial is experimentally evaluated.
In the original paper of the cube attack [DS09], the authors introduced a linearity test to reveal the
structure of the superpoly. If the linearity test always passes, the Algebraic Normal Form (ANF) of
the superpoly is recovered by assuming that the superpoly is linear. Moreover, a quadraticity test
was introduced in [MS12], and the ANF of the superpoly is similarly recovered. The quadraticity test
was also used in the current best key-recovery attack against Trivium [FV13]. Note that they are
experimental cryptanalysis, and it is possible that cube attacks do not actually work. For example, if
the superpoly is a highly unbalanced function for specific variables, we cannot ignore the probability
that the linearity and quadraticity tests fail.
The difference between the cube attack and higher-order differential attack has been often dis-
cussed. The higher-order differential attack was proposed by Lai [Lai94]. Assuming the algebraic
2 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
degree of f is at most d, Lai showed that the algebraic degree of the ith order difference is at most
d − i. Then, Knudsen showed the effectiveness of the higher-order differential attack on toy block
ciphers [Knu94]. Nowadays, many advanced techniques similar to the higher-order differential attack
have been developed to analyze block ciphers, e.g., integral attack [DKR97,Luc01,KW02].
The cube attack can in some way be seen as a type of higher-order differential attacks because it
also evaluates the behavior of higher-order difference. However, the most major difference between
the cube attack and common higher-order differential attack is whether or not secret variables are
directly recovered from the characteristic, and understanding this difference is very important to
consider key-recovery attacks against stream ciphers. When a block cipher is analyzed, attackers
first evaluate the algebraic degree of the reduced-round block cipher and construct a higher-order
differential characteristic, where the (d + 1)st order difference is always 0 if the degree is at most d.
Then, the key recovery is independently appended after the higher-order differential characteristic.
Namely, attackers guess round keys used in last several rounds and compute the (d + 1)th order
difference of ciphertexts of the reduced-round block cipher. If the correct round key is guessed, the
(d + 1)th order difference is always 0. In other words, if the (d + 1)st order difference is not 0, guessed
round keys are incorrect.
Note that we cannot use this strategy for the key-recovery attack against many stream ciphers
because the secret key is generally used during the initialization phase and is not involved when
generating a keystream, i.e. even if there is a distinguisher in the keystream, it cannot be directly
utilized for key recovery attacks by appending key recovery rounds in the key generation phase,
unlike key recovery attacks of block ciphers. To execute the key-recovery attack of stream ciphers,
we have to recover the secret key by using only key streams that attackers can observe. Therefore,
more advanced and complicated analyses are required than the simple degree estimation of the
common higher-order differential attack or square, saturation, and integral characteristics. In the
context of the cube attack, we have to analyze the ANF of the superpoly. It is unlikely to well
analyze because symmetric-key cryptosystems are complicated. Therefore, stream ciphers have been
experimentally analyzed in the cube attack.
Another important related work to understand this paper is the division property, which is a new
method to construct higher-order differential (integral) characteristics [Tod15b]. The division prop-
erty is the generalization of the integral property [KW02] that can also exploit the algebraic degree
at the same time, and it allows us to evaluate more accurate higher-order differential characteristics.
Moreover, the bit-based division property was introduced in [TM16], and three propagation rules for
basic operations, and, xor, and copy are shown. While arbitrary block ciphers are evaluated by using
the bit-based division property, it requires much time and memory complexity [TM16]. Therefore,
the application is first limited to block ciphers with small block length, like Simon32 or Simeck32.
In [XZBL16], Xiang et al. showed how to model the propagation of the bit-based division property
by using the mixed integer linear programming (MILP). Moreover, they showed that MILP solvers
can efficiently evaluate the propagation. To demonstrate the effectiveness, accurate propagations of
the bit-based division property for six lightweight block ciphers including Simon128 were shown.
Our Contribution. The most important step in a cube attack is the superpoly recovery. If the
superpoly is more efficiently recovered than the brute-force search, it brings some vulnerability of
symmetric-key ciphers. Superpolys are experimentally recovered in the conventional cube attack.
The advantage of such approach is that we do not need to analyze the structure of f in detail. On
the other hand, there are significant drawbacks in the experimental analysis.
– The size of a cube is limited to the experimental range because we have to compute the sum
of f over a cube. It may be possible that we try a cube whose size is at most 40 in current
computers, but it requires incredible effort in the aspect to both money and time. Therefore, it
is practically infeasible to execute the cube attack when the cube size exceeds 40.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 3
Table 1. Summary of results. The time complexity in this table shows the time complexity to recover the
superpoly of a cube.
† 18 cubes whose size is from 32 to 37 are used, where the most efficient cube is shown to recover one bit of
the secret key.
‡ The attack against 477 rounds is mainly described for the practical attack in [SBD+ 16]. However, when
the goal is the superpoly recovery and to recover one bit of the secret key, 503 rounds are attacked.
– The prediction of the true security of target stream ciphers is an important motivation of crypt-
analyses. Since the evaluation is limited to the experimental range, it is difficult to predict the
impact of the cube attack under future high-performance computers.
– Since the stream cipher is regarded as a blackbox, the feedback to designers is limited.
Our new cube attack recovers the secret key of Trivium with 832 initialization rounds. Grain128a
is a member of Grain family of stream ciphers and is standardized by ISO/IEC 29167-13 [ISO15].
The initialization is 256 rounds. The conditional differential cryptanalysis was applied to Grain128a,
and a distinguishing attack against Grain128a with 177 initialization rounds was shown under the
single-key setting [LM12]. On the other hand, the key-recovery attack is not known. Our new cube
attack recovers the secret key of Grain128a with 183 initialization rounds. Unfortunately, when
we applied our technique to practical cube attack, i.e., the cube size is small, we could not find
balanced superpoly. In such case, the size of recovered bit of information is smaller than 1 bit. Since
we cannot say that balanced superpoly is efficiently found in the large cube size, the feasibility of
the key recovery is speculative. However, 183 rounds are at least vulnerable because the superpoly
recovery is more efficient than the brute-force search. ACORN is an authenticated encryption and
one of the 3rd round candidates in CAESAR competition [cae14]. The structure is based on non-
linear feedback shift register (NLFSR) like Trivium and Grain. Before the output of key streams,
the secret key and initialization vector (iv) are sequentially XORed with the NLFSR, and then
associated data is sequentially XORed. In the nonce-respecting setting, we cannot select cube bits
from the associated data. Therefore, the initialization is regarded as 2048 rounds when there is no
associated data. The cube attack was applied in [SBD+ 16], and the secret key of ACORN with
503 initialization is recovered. Our new cube attack recovers the secret key of ACORN with 704
initialization rounds.
Update from Conference Version. The initial version of this work was presented at CRYPTO
2017 [TIHM17]. In this full version, we newly added the following contents.
– We newly applied our technique to Kreyvium [CCF+ 16]. As a result, we show a key recovery
attack against 872-round Kreyvium, which is currently the best key recovery attack. Please see
Sect. 5.4 in detail.
– We show a new method exploiting cube whose non-zero cube bits are filled up with 0. Let us
consider the and of two bits, i.e., x ∧ y = z, and assume that the division property of (x, y)
12 1
is represented as Da,b . Then there is a propagation such that the output bit z has Dd(a+b)/2e
1
normally. However, if either x or y is 0, the output z must be 0 and cannot have Dd(a+b)/2e . We
first evaluate 0-fixed state without using the division property, and then 0-fixed state is fed back
to the propagation of the division property. Namely, if either value a or b is 0, the propagation
is restricted. This technique is shown in Sect. 6 in detail.
– We compare our technique and Liu’s method [Liu17]. In the cube used in [Liu17], all non-cube
bits are filled up with 0. Therefore, for the fair comparison, we also use such cube. As a result,
we verified zero-sum distinguishers on 837-round Trivium and 872-round Kreyvium, which were
shown in [Liu17], by using our method.
Moreover, inspired by Liu’s cube, we also evaluated zero-sum distinguisher whose number of
cube bits is small and non-cube bits are fixed to 0. In the application to Trivium, we found that
there is a 838-round zero-sum distinguisher when there are 38 cube bits. Moreover, we found a
873-round zero-sum distinguisher of Kreyvium when the cube has 62 bits.
These results are shown in Sect. 6.1 and 6.2 in detail.
– By controlling values of non-cube bits, we can evaluate the property of the cube more accurately.
To show the effect, we apply this technique to Grain128a and reduce the time complexity for
182-round attack. This result is shown in Sect. 6.3 in detail.
– Liu evaluated the number of rounds on zero-sum distinguishers when all iv bits are chosen as
cube bits. Therefore, we also evaluated such cube by our method. While Liu showed that 793-
round Trivium has such zero-sum distinguishers, our method can show 839-round Trivium
has such zero-sum distinguisher. Moreover, the number of rounds on zero-sum distinguisher for
Kreyvium is improved from 862 to 897. This result implies that our method is more accurate
than Liu’s method. This result is shown in Sect. 7.4 in detail.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 5
– We show a few techniques to accelerate the solving time of MILP. This result is shown in Sect. 7.5
in detail.
2 Preliminaries
2.1 Mixed Integer Linear Programming
The deployment of the mixed integer linear programming (MILP) to cryptanalysis was shown by
Mouha et al. in [MWGP11]. Then, the MILP has been applied to search for differential [SHW+ 14b,SHW+ 14a],
linear [SHW+ 14a], impossible differential [CJF+ 16,ST16], zero-correlation linear [CJF+ 16], and inte-
gral characteristics with division property [XZBL16]. The use of MILP for the integral characteristic
with division property is expanded in this paper.
The MILP problem is an optimization or feasibility program where variables are restricted to
integers. We create an MILP model M, which consists of variables M.var, constraints M.con, and
an objective function M.obj. As an example, let us consider the following optimization program.
Example 1.
M.var ← x, y, z as binary.
M.con ← x + 2y + 3z ≤ 4
M.con ← x + y ≥ 1
M.obj ← maximize x + y + 2z
The answer of the model M is 3, where (x, y, z) = (1, 0, 1).
MILP solver can solve such optimization problem, and it returns infeasible if there is no feasible
solution. Moreover, if there is no objective function, the MILP solver only evaluates whether this
model is feasible or not.
We used Gurobi optimization as the solver in our experiments [Inc15].
= p(x, v).
6 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
The first term is reduced to p(x, v) because tI becomes 1 for only one case in CI . The second term
is always canceled out because q(x, v) misses at least one variable from {vi1 , vi2 , . . . , vi|I| }. Then,
p(x, v) is called the superpoly of the cube CI .
Blackbox Analysis. If the cube is appropriately chosen such that the superpoly is enough sim-
plified to recover secret variables, the cube attack succeeds. However, f (x, v) in real symmetric-key
cryptosystems is too complicated. Therefore, the cube attack regards f as a blackbox polynomial.
In the preprocessing phase, attackers first try out various cubes, change values of public and
secret variables, and analyze the feature of the superpoly. The goal of this phase is to reveal the
structure of p(x, v). Especially, the original cube attack searches for linear superpoly p(x, 0) by the
summation over the chosen cube. If the superpoly is linear,
always holds for arbitrary x and x0 . By repeating this linearity test enough, attackers can know
that the superpoly is linear with high probability, and the Algebraic Normal Form (ANF) of the
superpoly is recovered by assuming its linearity.
In the online phase, attackers query to an encryption oracle by controlling only public variables
and recover secret variables. Attackers evaluate the sum of f (x, v) over all values of the cube CI .
Since the sum is right hand side of the superpoly, the part of secret variables is recovered. Please
refer to [DS09] and [ADMS09] to well understand the principle of the cube attack.
Division Property. At 2015, the division property, which is an improved technique to find higher-
order differential (integral) characteristics for iterated ciphers, was proposed in [Tod15b]. Then, the
bit-based variant was introduced in [TM16], and it is defined as follows5 .
Definition 1 ((Bit-Based) Division Property). Let X be a multiset whose elements take a value
of Fn2 . Let K be a set whose elements take an n-dimensional bit vector. When the multiset X has the
1n
division property DK , it fulfils the following conditions:
(
M
u unknown if there exist k ∈ K s.t. u k,
x =
x∈X
0 otherwise,
Qn
where u k if ui ≥ ki for all i, and xu = i=1 xui i .
We first evaluate the division property of the set of chosen plaintexts and then evaluate the division
property of the set of corresponding ciphertexts by evaluating the propagation for every round
function.
5
Two kinds of bit-based division property are proposed in [TM16]. In this paper, we only focus on the
conventional bit-based division property.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 7
Some propagation rules for the division property are proven in [Tod15b,TM16]. Attackers deter-
mine indices I = {i1 , i2 , . . . , i|I| } ⊂ {1, 2, . . . , n} and prepare 2|I| chosen plaintexts where variables
indexed by I are taking all possible combinations of values. The division property of such chosen
n
plaintexts is Dk1 , where ki = 1 if i ∈ I and ki = 0 otherwise. Then, the propagation of the division
n
property from Dk1 is evaluated as
def
{k} = K0 → K1 → K2 → · · · → Kr ,
where DKi is the division property after i-round propagation. If the division property Kr does not
have an unit vector ei whose only ith element is 1, the ith bit of r-round ciphertexts is balanced.
Propagation of Division Property with MILP. Evaluating the propagation of the division
property is not easy because the size of Ki extremely increases. At ASIACRYPT 2016, Xiang et al.
showed that the propagation is efficiently evaluated by using MILP [XZBL16]. First, they introduced
the division trail as follows.
def
Definition 2 (Division Trail). Let us consider the propagation of the division property {k} =
K0 → K1 → K2 → · · · → Kr . Moreover, for any vector k∗i+1 ∈ Ki+1 , there must exist a vector k∗i ∈
Ki such that k∗i can propagate to k∗i+1 by the propagation rule of the division property. Furthermore,
for (k0 , k1 , . . . , kr ) ∈ (K0 × K1 × · · · × Kr ) if ki can propagate to ki+1 for all i ∈ {0, 1, . . . , r − 1},
we call (k0 → k1 → · · · → kr ) an r-round division trail.
k E
Let Ek be the target r-round iterated cipher. Then, if there are division trails k0 −−→ k r = ei ,
attackers cannot know whether the ith bit of r-round ciphertexts is balanced or not. On the other
Ek
hand, if we can prove that there is no division trail k0 −−→ ei , the ith bit of r-round ciphertexts is
always balanced. Therefore, we have to evaluate all possible division trails to verify whether each bit
of ciphertexts is balanced or not. In [Tod15b], [Tod15a], and [TM16], all possible division trails are
evaluated by using a breadth-first search. Unfortunately, such a search requires enormous memory
and time complexity. Therefore, it is practically infeasible to apply this method to iterated ciphers
whose block length is not small.
MILP can efficiently solve this problem. We generate an MILP model that covers all division
trails, and the solver evaluates the feasibility whether there are division trails from the input division
property to the output one or not. If the solver guarantees that there is no division trail, higher-order
differential (integral) characteristics are found.
Let copy, xor, and and be three fundamental operations, where 1 bit is copied into m bits in
copy, the xor of m bits is computed in xor, and the and of m bits is computed in and. Note that
MILP models for copy, xor, and and are sufficient to represent any circuit.
COP Y
Proposition 1 (MILP Model for COPY). Let a −−−−→ (b1 , b2 , . . . , bm ) be a division trail of
COPY. The following inequalities are sufficient to describe the propagation of the division property
for copy.
(
M.var ← a, b1 , b2 , . . . , bm as binary.
M.con ← a = b1 + b2 + · · · + bm
XOR
Proposition 2 (MILP Model for XOR). Let (a1 , a2 , . . . , am ) −−−→ b be a division trail of XOR.
The following inequalities are sufficient to describe the propagation of the division property for xor.
(
M.var ← a1 , a2 , . . . , am , b as binary.
M.con ← a1 + a2 + · · · + am = b
8 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
AN D
Proposition 3 (MILP Model for AND). Let (a1 , a2 , . . . , am ) −−−→ b be a division trail of AND.
The following inequalities are sufficient to describe the propagation of the division property for and.
(
M.var ← a1 , a2 , . . . , am , b as binary.
M.con ← b ≥ ai for all i ∈ {1, 2, . . . , m}
To accept multiple inputs and outputs, three propositions are generalized from the original
ones shown in [XZBL16]. Moreover, Propositions 1 and 2 are also introduced in [SWW16]. Note
that Proposition 3 includes redundant propagations of the division property, but they do not affect
obtained characteristics.
Zero-Sum Integral Distinguisher. The trivial application is to find zero-sum integral distin-
guishers. Let us consider f (x, v) as a stream cipher, where x and v denote the secret and public
variables, respectively, and f is designed by using iterative structure. For a cube CI where the vari-
ables in {vi1 , vi2 , . . . , vi|I| } are taking all possible combinations of values, the propagation of the
division property enables us to evaluate whether or not the sum of f (x, v) over all values of the cube
CI is balanced. Therefore, if the goal of attackers is to find zero-sum integral distinguishers, we can
trivially use the division property.
Analysis of ANF Coefficients. Even if we can find a zero-sum integral distinguisher on stream
ciphers, it is nontrivial to recover secret variables unlike block ciphers. Therefore, new techniques
are required for the extension to the key-recovery attack.
We propose a novel application of the division property, where the division property is not used
to find zero-sum integral distinguishers but used to analyze the ANF coefficients of f . Since our
goal is to analyze the ANF coefficients, we do not need to distinguish public variables from secret
ones. For the simplicity of notation, we consider f (x) instead of f (x, v), and the ANF of f (x) is
represented as follows.
M
f (x) = afu · xu ,
u∈Fn
2
where afu ∈ F2 denotes the ANF coefficients. Then, the following Lemma is derived.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 9
Lemma 1. Let f (x) be a polynomial from Fn2 to F2 and afu ∈ F2 (u ∈ Fn2 ) be the ANF coefficients.
f
→ 1, afu
Let k be an n-dimensional bit vector. Then, assuming there is no division trail such that k −
is always 0 for u k.
f
Assume that there is no division trail such that k − → 1. Then, no division trail guarantees that the
sum of f (x) over all values of the cube CI is always balanced independent of xi (i ∈ {1, 2, . . . , n}−I).
Namely,
M M M
f (x) = xk · afu · xu⊕k
CI CI u∈Fn
2 |uk
M
= afu · xu⊕k = 0
u∈Fn
2 |uk
holds independent of xi (i ∈ {1, 2, . . . , n} − I). It holds only if afu is always 0 for all u such that
u k. t
u
The most important part of a cube attack is to recover the superpoly, and we simply call it the
superpoly recovery in this paper. Since public variables v are known and chosen for attackers, the
ANF of pv (x) = p(v, x) is evaluated, and the goal is to recover pv (x) whose v is fixed. Once the
superpoly pv (x) is recovered, attackers query the cube to an encryption oracle and compute the
sum of f (x, v) over the cube. Then, attackers can get one polynomial about secret variables, and
the secret variables are recovered from the polynomial.
The size of secret variables recovered from one superpoly depends on the structure of the su-
perpoly pv (x). If a balanced superpoly is used, one bit of information in involved secret variables
is always recovered. If an unbalanced superpoly is used, the size of recovered secret variables is less
than 1 bit but some information of secret variables is leaked to attackers. Moreover, it is possible
to recover more bits of information in secret variables by exploiting multiple cubes. As an extreme
case, if the superpoly is constant function, no secret variable is recovered, but it trivially implies
constant-sum integral distinguishers. Therefore, the superpoly recovery directly brings vulnerability
of symmetric-key cryptosystems, and some information of secret variables is always recovered unless
the superpoly is constant function.
Previous Method to Recover Superpoly. The previous cube attack experimentally recovered
the superpoly of a cube whose size is feasible for current computer. Therefore, not every superpoly
can be evaluated. Linearity and quadraticity tests are repeated, and the superpoly is regarded as the
linear or quadratic polynomial if these tests are sufficiently passes. Then, assuming the superpoly is
linear or quadratic, the superpoly is recovered.
10 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
Analyze ANF Coefficients of Superpoly by Division Property. Lemma 1 implies that the
division property can be used as a tool to analyze ANF coefficients of the superpoly. The following
proposition is shown from Lemma 1 and is useful to evaluate the upper bound of the complexity to
recover the ANF of the superpoly.
Proposition 4. Let f (x, v) be a polynomial, where x and v denote the secret and public variables,
respectively. For a set of indices I = {i1 , i2 , . . . , i|I| } ⊂ {1, 2, . . . , m}, let CI be a set of 2|I| values
where the variables in {vi1 , vi2 , . . . , vi|I| } are taking all possible combinations of values. Let kI be
an m-dimensional bit vector such that v kI = tI = vi1 vi2 · · · vi|I| , i.e. ki = 1 if i ∈ I and ki = 0
f
otherwise. Assuming there is no division trail such that (ej , kI ) −
→ 1, xj is not involved in the
superpoly of the cube CI .
where afu ∈ F2 denotes the ANF coefficients. The polynomial f (x, v) is decomposed into
M u
M u
f (x, v) = afu · (xkv) ⊕ afu · (xkv)
u∈Fn+m
2 |u(0kkI ) u∈Fn+m
2 |u6(0kkI )
u⊕(0kkI ) (0ku)
M M
= tI · afu · (xkv) ⊕ afu · (xkv)
u∈Fn+m
2 |u(0kkI ) u∈Fn+m
2 |u6(0kkI )
f
→ 1, afu = 0 for u (ej kkI ) because of Lemma 1. Therefore,
If there is no division trail (ej kkI ) −
M
p(x, v) = afu · (xkv)u⊕(0kkI ) .
u∈Fn+m
2 |u(0kkI ),uj =0
We can evaluate which secret variables are involved to the superpoly of a given cube, and Algo-
rithm 1 shows the algorithm supported by MILP. The input M is an MILP model, where the target
stream cipher is represented by the context of the division property. How to construct M for each
specific stream cipher is shown in each application in Sect. 5. First, we pick MILP variables x and v
from M, where x and v correspond to MILP variables for secret and public variables, respectively.
As an example, in Algorithm 2 for Trivium, let x = (s01 , s02 , . . . , s080 ) and v = (s093 , s094 , . . . , s0172 ).
Then, to represent the input division property, elements of v indexed by I are constrained by 1,
and the others are constrained by 0. Since at least one element in secret variables is additionally
constrained to 1 in our cube attack, the sum of x is constrained to 1. Next, we solve this MILP
model
L by using the solver. If M is infeasible, there is no involved secret variables in superpoly and
CI f (x, v) = p(x, v) is always constant. If M is feasible, we can get a satisfying division trail and
pick an index j ∈ {1, 2, . . . , n} such that xj = 1 in the division trail. Then, xj is involved to the
superpoly and the index j is stored to a set J. Once we detect that xj is involved, we additionally
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 11
constrain xj = 0. By repeating this procedure, we can get the set J whose elements are an index of
secret variables involved to the superpoly.
After the analysis of the superpoly by using Algorithm 1, we know that only xj (j ∈ J) are
involved to the superpoly of the cube CI . Attackers choose a value in constant part of iv and
prepare the cube CI by flipping bits in I. They then recover the superpoly by trying out all possible
combinations of secret variables {xj1 , xj2 , . . . , xj|J| }. The time complexity to recover the superpoly
is 2|I|+|J| . Therefore, if |I| + |J| is smaller than the security bit level, we can efficiently recover the
superpoly.
The time complexity to recover the superpoly is estimated in Sect. 3. As described in Sect. 3, the
superpoly recovery directly brings vulnerability of stream ciphers. On the other hand, if our goal is
to recover secret variables, we have to find a preferable superpoly that is close to balancedness for
secret variables. Under the condition that we already get the cube index I and index of involved
secret variables J by using Algorithm 1, our attack strategy to recover secret variables consists of
three phases: offline phase, online phase, and brute-force search phase.
1. Offline phase. The goal of this phase is to find a preferable superpoly. Attackers choose a
value in the constant part of iv, and prepare a cube by flipping bits in I. They then compute
L
CI f (x, v) = pv (x) in local, where all possible combinations of secret variables {xj1 , xj2 , . . . , xj|J| }
are tried out, and the superpoly is recovered. Finally, we search for the preferable superpoly by
changing the constant part of iv.
2. Online phase. The goal of this phase is to recover the part of secret variables by using the
preferable superpoly. After the balanced superpoly is given, attackers query the cube CI to
encryption oracle and get one bit pv (x). Then, we get one polynomial about involved secret
variables, and the half of values in involved secret variables is discarded because the superpoly
is balanced.
3. Brute-force search phase. Attackers guess the remaining secret variables to recover the entire
value in secret variables.
We cannot know whether the superpoly is balanced or not unless it is actually recovered, and
the actual superpoly recovery requires 2|I|+|J| time complexity. Therefore, if |I| + |J| exceeds the
12 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
However, this paper only focuses on the case that only one cube is exploited for the simplicity. Note
that the detection of one cube brings at least cryptographic vulnerability.
5 Applications
We apply our general attack method to four NLFSE-based ciphers. The first target is Trivium
[CP06], which is one of eSTREAM portfolio [est08] and one of the most analyzed stream ciphers.
Another target is Grain128a [ÅHJM11], which is standardized by ISO/IEC 29167-13 [ISO15]. The
3rd application is ACORN [Wu16], which is one of the 3rd round CAESAR candidates [cae14], and
its design is based on stream ciphers. The final application is Kreyvium [CCF+ 16], a stream cipher
proposed at FSE’16 sharing many similarities with Trivium.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 13
zi
Specification. Trivium is an NLFSR-based stream cipher, and the internal state is represented
by 288-bit state (s1 , s2 , . . . , s288 ). Figure 1 shows the state update function of Trivium. The 80-bit
key is loaded to the first register, and the 80-bit iv is loaded to the second register. The other state
bits are set to 0 except the least three bits in the third register. Namely, the initial state bits are
represented as
(s1 , s2 , . . . , s93 ) = (K1 , K2 , . . . , K80 , 0, . . . , 0),
(s94 , s95 , . . . , s177 ) = (IV1 , IV2 , . . . , IV80 , 0, . . . , 0),
(s178 , s279 , . . . , s288 ) = (0, 0, . . . , 0, 1, 1, 1).
The pseudo code of the update function is given as follows.
t1 ← s66 ⊕ s93
t2 ← s162 ⊕ s177
t3 ← s243 ⊕ s288
z ← t1 ⊕ t2 ⊕ t3
t1 ← t1 ⊕ s91 · s92 ⊕ s171
t2 ← t2 ⊕ s175 · s176 ⊕ s264
t3 ← t3 ⊕ s286 · s287 ⊕ s69
(s1 , s2 , . . . , s93 ) ← (t3 , s1 , . . . , s92 )
(s94 , s95 , . . . , s177 ) ← (t1 , s94 , . . . , s176 )
(s178 , s279 , . . . , s288 ) ← (t2 , s178 , . . . , s287 )
Here z denotes the 1-bit key stream. First, in the initialization, the state is updated 4 × 288 = 1152
times without producing an output. After the initialization, one bit key stream is produced by every
update function.
MILP Model. TriviumEval in Algorithm 2 generates MILP model M as the input of Algorithm 1,
and the model M can evaluate all division trails for Trivium whose initialization rounds are reduced
14 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
14: return M
15: end procedure
to R. TriviumCore in Algorithm 2 generates MILP variables and constraints for each update function
of register. Since one TriviumCore creates 10 MILP variables and 7 constraints, one update function
creates 30 MILP variables and 21 constraints. Therefore, generated MILP model M consists of
288 + 30R MILP variables and 21R + 282 + 1 MILP constraints. Note that constraints by the input
division property are operated by Algorithm 1.
Experimental Verification. We implemented the MILP model M for the propagation of the
division property on Trivium and evaluated involved secret variables by using Algorithm 1, where
Gurobi optimizer [Inc15] was used as the solver of MILP. Before the theoretical evaluation, we verify
our attack and implementation by using small cube as I = {1, 11, 21, 31, 41, 51, 61, 71}. Table 2
summarizes involved secret variables from 576 to 594 rounds.
Example 2 (Verification of Our Attack against 590-round Trivium). We actually execute the offline
phase against 590-round Trivium, and only K60 is involved to the superpoly. We randomly chose 100
superpolys by changing the constant part of iv and evaluated the sum of the cube. As a result, the
sum is always 0 independent of K60 in 42 superpolys, where 0x00CA6124DE5F12043D62 is its example
of the constant part of iv. Moreover, the sum corresponds to the value of K60 in 22 superpolys, where
0x2F0881B93B251C7079F2 is its example. Then, the ANF of the superpoly is represented as
pv (x) = x60 .
Finally, the sum corresponds to the value of K60 ⊕1 in 36 superpolys, where 0x5745A1944411D1374828
is its example. Then, the ANF of the superpoly is represented as
pv (x) = x60 ⊕ 1.
Balanced superpolys are preferable, and we found 22 + 36 = 58 such superpolys. Therefore, the
required number of trials for finding preferable superpolys is about k = 2.
Example 3 (Verification of Our Attack against 591-round Trivium). We execute the offline phase
against 591-round Trivium, and K23 , K24 , K25 , K66 , K67 are involved to the superpoly. Similarly
to the attack against 590 rounds, we randomly chose 100 superpolys by changing the constant part
of iv and evaluated the sum of the given cube. As a result, the sum is always 0 independent of 5
involved secret variables in 64 superpolys, where 0x39305FDD295BDACD2FBE is its example of the
constant part of iv. There are 11 superpolys such that the sum is 1 only when
K23 kK24 kK25 kK66 kK67 ∈ {00, 05, 08, 0D, 10, 15, 19, 1C}
as the hexadecimal notation, where 0x03CC37748E34C601ADF5 is its example of the constant part
of iv. Then, the ANF of the superpoly is represented as
pv (x) = (x66 ⊕ 1)(x23 x24 ⊕ x25 ⊕ x67 ⊕ 1).
There are 9 superpolys such that the sum is 1 when
K23 kK24 kK25 kK66 kK67 ∈ {02, 07, 0A, 0F, 12, 17, 1B, 1E}
as the hexadecimal notation, where 0x78126459CB2384E6CCCE is its example of the constant part
of iv. Then, the ANF of the superpoly is represented as
pv (x) = x66 (x23 x24 ⊕ x25 ⊕ x67 ⊕ 1).
Moreover, there are 16 superpolys such that the sum is 1 when the value of K23 kK24 kK25 kK66 kK67
belongs to
{00, 02, 05, 07, 08, 0A, 0D, 0F, 10, 12, 15, 17, 19, 1B, 1C, 1E}
as the hexadecimal notation, where 0x644BD671BE0C9241481A is its example of the constant part
of iv. Then, the ANF of the superpoly is represented as
pv (x) = x23 x24 ⊕ x25 ⊕ x67 ⊕ 1,
and this superpoly is balanced. Note that x66 is not involve to this superpoly. Balanced superpolys
are preferable, and we found 16 such superpolys. Therefore, the required number of trials for finding
preferable superpolys is about k = 6.
16 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
Table 3. Summary of theoretical cube attacks on Trivium. The time complexity in this table shows the
time complexity to recover the superpoly.
For any size of cube |I|, the odd index 1, 3, . . . , 79 and even index 2, 4, . . . , 2(|I| − 40) is chosen as cube
indices.
Theoretical Results. As experimental verification shows, Assumption 1 holds for Trivium in small
example. Therefore, we can expect that theoretically recovered superpolys also fulfill Assumption 1.
Cube indices are chosen as the following in our experiments: the odd index 1, 3, . . . , 2|I| − 1 is
chosen, and the even index 2, 4, . . . , 2(|I|−40) is additionally chosen. Then, we exhaustively evaluated
involved secret variables, and Table 3 summarizes the result in our theoretical cube attack. Table 3
shows indices of involved secret variables and the time complexity for the superpoly recovery against
Trivium with at least 800 initialization rounds. Since the previous best key-recovery attack is 799
rounds, all results at least improve the current best key-recovery attack. Under the condition that
the time complexity for the superpoly recovery is less than 279 , the largest number of initialization
rounds that we can attack is 832 rounds. Compared with previous best key-recovery attack, it
updates 832 − 799 = 33 rounds.
We do not have plausible evidence that our choice of cube indices is appropriate, and the choice
80
is still difficult because we need to try out |I| cubes when we want to evaluate all cubes whose size
is |I|. How to choose appropriate cubes is left as an open question.
Specification. Grain128a is one of Grain family of NLFSR-based stream ciphers, and the internal
state is represented by two 128-bit states, (b0 , b1 , . . . , b127 ) and (s0 , s1 , . . . , s127 ). The 128-bit key is
loaded to the first register b, and the 96-bit iv is loaded to the second register s. The other state
bits are set to 1 except the least one bit in the second register. Namely, the initial state bits are
represented as
g f
24 5 6
b0 b127 s0 s127
7 2 7 1
zi
Fig. 2. Structure of Grain128a
The pseudo code of the update function in the initialization is given as follows.
Here, A = {2, 15, 36, 45, 64, 73, 89}. First, in the initialization, the state is updated 256 times without
producing an output. After the initialization, the update function is tweaked such that z is not fed
to the state, and z is used as a key stream. Figure 2 shows the state update function of Grain128a.
MILP Model. Grain128aEval in Algorithm 3 generates MILP model M as the input of Algo-
rithm 1, and the model M can evaluate all division trails for Grain128a whose initialization rounds
are reduced to R. funcZ generates MILP variables and constraints for Eq. (4) and Eq. (5), and it
consists of 45 MILP variables and 32 MILP constraints. funcG generates MILP variables and con-
straints for Eq. (2), and it consists of 70 MILP variables and 55 MILP constraints. funcF generates
MILP variables and constraints for Eq. (3), and it consists of 13 MILP variables and 7 MILP con-
straints. As a result, the MILP model for every round consists of 45 + 70 + 13 + 4 = 132 MILP
variables and 32 + 55 + 7 + 4 = 98 MILP constraints. Therefore, generated MILP model M consists
of 256 + 45 + 132R MILP variables and 98R + 32 + 256 + 1 MILP constraints. Note that constraints
by the input division property are operated by Algorithm 1.
Experimental Verification. We implemented the MILP model M for the propagation of the
division property on Grain128a and evaluated involved secret variables by using Algorithm 1. To
verify our attack and implementation, the offline phase is executed by using small cube as I =
{1, 2, . . . , 9}.
18 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
Example 4 (Verification of Our Attack against 106-round Grain128a). The cube C{1,2,3,...,9} brings
the superpoly that involves only seven secret variables, (K46 , K53 , K85 , K119 , K122 , K126 , and K127 ),
and this result comes out of Algorithm 1. In our experiments, the Hamming weight of all superpolys
pv (x) is only 4. Specifically, in arbitrary iv satisfying IV76 = 0, pv (x) is 1 only when the involved
secret variables are represented as
(K46 , K53 , K85 , K119 , K122 , K126 , K127 ) =(∗, 1, 0, 1, 1, 1, 1) or
(∗, 0, 1, 1, 1, 1, 1),
where ∗ is any bit. Moreover, in arbitrary iv satisfying IV76 = 1, pv (x) is 1 only when the involved
secret variables are represented as
(K46 , K53 , K85 , K119 , K122 , K126 , K127 ) =(∗, 1, 0, 1, 0, 1, 1) or
(∗, 0, 1, 1, 0, 1, 1).
Namely, the superpoly is represented as
pv (x) = (x53 ⊕ x85 ) · x119 · (x122 ⊕ v76 ) · x126 · x127 .
This superpoly is independent of x46 . Moreover, it is not balanced, and the Hamming weight of
pv (x) is 2 for six involved input bits. Therefore, the recovered bit of information in secret variables
is represented as
2 62
log2 2 × 26 + (62 × 26 ) ≈ 0.09.
26
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 19
Table 4. Summary of theoretical cube attacks on Grain128a. The time complexity in this table shows the
time complexity to recover the superpoly.
† Following set of indices I = {1, ..., 40, 42, 44, . . . , 51, 53, ..., 87, 89, 91, 93, 95} is used as the cube.
‡ Following set of indices I = {1, ..., 51, 53, ..., 91, 93, 95} is used as the cube.
Double bit of information can be recovered by flipping the bit IV76 , but the recovered information
is still smaller than 1.
Theoretical Results. We cannot find superpolys satisfying Assumption 1 in our experiments using
small cube. On the other hand, Assumption 2 holds. Therefore, we can expect that theoretically re-
covered superpolys also fulfill Assumption 2, and it leaks at least some information in secret variables
which is smaller than 1 bit. Moreover, by collecting these superpolys, we can expect that multiple
bits of information in secret variables are recovered.
Table 4 shows indices of involved secret variables and the time complexity for the superpoly
recovery against Grain128a. Since the previous best attack is 177 rounds in the single-key setting,
all results at least improve the current best key-recovery attack. Under the condition that the time
complexity for the superpoly recovery is less than 2127 , the largest number of initialization rounds
that we can attack is 183 rounds. Compared with previous best distinguishing attack, it updates
183 − 177 = 6 rounds. Moreover it allows for some key recovery.
Specification. ACORN is an authenticated encryption and one of the 3rd round candidates in
CAESAR competition. The structure is based on NLFSR, and the internal state is represented by
293-bit state (S0 , S1 , . . . , S292 ). There are two component functions, ks = KSG128(S) and f =
F BK128(S), in the update function, and each is defined as
where ks is used as the key stream, and maj and ch are defined as
maj(x, y, z) = (x ∧ y) ⊕ (x ∧ z) ⊕ (y ∧ z),
ch(x, y, z) = (x ∧ y) ⊕ ((x ⊕ 1) ∧ z).
20 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
m
0 23 60 61 66 106 107 111 153 154 160 192 193 196 229 230 235 288 289 292
MILP Model. ACORNEval in Algorithm 4 generates MILP model M as the input of Algorithm 1,
and the model M can evaluate all division trails for ACORN whose initialization rounds are reduced
to R. xorFB generates MILP variables and constraints for feed-back function with XOR. ksg128 and
fbk128 generates MILP variables and constraints for KSG128 and F BK128, respectively.
If there are zero constant bit in input of KSG128 and F BK128, the propagation of the division
property for two functions ksg128 and fbk128 is limited. For example, when maj(x, y, z) is computed
under the condition y = z = 0, this function is represented as
maj(x, 0, 0) = 0,
and the division property of x never propagates to the output of maj. Such limitations of the
propagation only happens in the first several rounds because the state S is initialized to 0. To
control this behavior, there is the current number of rounds as the input of ksg128 and fbk128.
Note that constraints by the input division property are operated by Algorithm 1.
Experimental Verification. We implemented the MILP model M for the propagation of the
division property on ACORN and evaluated involved secret variables by using Algorithm 1. We
searched the small cube such that |I| + |J| is practically feasible, and the following small cube
C{1,2,3,4,5,8,20,125,126,127,128}
is used to verify our attack and implementation.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 21
Example 5 (Verification of Our Attack against 517-round ACORN). The cube C{1,2,3,4,5,8,20,125,126,127,128}
brings the superpoly that involves only nine secret variables, (K6 , K8 , K10 , K11 , K12 , K15 , K16 , K45 ,
and K49 ), and this result comes out of Algorithm 1. We try out 100 randomly chosen constant part
of iv. As a result, all superpolys pv (x) are balanced independent of the value of the constant part
of iv. Specifically, pv (x) corresponds to the sum of involved secret variables. Namely, the superpoly
is represented as
Table 5. Summary of theoretical cube attacks on ACORN. The time complexity in this table shows the
time complexity to recover the superpoly.
† Following set of indices I = {1, 2, . . . , 16, 22, 29, 31, 113, 114, . . . , 128} is used as the cube.
‡ Following set of indices I = {1, 2, . . . , 32, 97, 98, . . . , 128} is used as the cube.
Theoretical Results. As experimental verification shows, Assumption 1 holds for ACORN in small
example. Therefore, we can expect that theoretically recovered superpolys also fulfill Assumption 1.
Table 5 shows indices of involved secret variables and the time complexity for the superpoly
recovery against ACORN. Since the previous best attack is 503 rounds, all results at least improve
the current best key-recovery attack. As far as we searched various cubes, the largest number of
initialization rounds that we can attack is 704 rounds, where the cube size is 64 and the number
of involved secret variables is 58. Compared with previous best key-recovery attack, it updates
704 − 503 = 201 rounds.
Specification. Kreyvium is designed for the use of fully homomorphic encryption, and the structure
is inspired from Trivium. Kreyvium consists of five registers and three ones in the middle correspond
to Trivium. Therefore, the modification is only the top and bottom registers. Figure 4 shows the
state update function of Trivium. While Trivium claims 80-bit security and accepts 80-bit iv,
Kreyvium claims 128-bit security and accepts 128-bit iv. To achieve this property, the initial loading
is completely different from the case of Trivium.
The 128-bit key is loaded to the first register, and (K1 , . . . , K93 ) is loaded to the second register.
The 128-bit iv is loaded to the fifth register, and (IV1 , . . . , IV84 ) and (IV85 , . . . , IV128 ) are loaded to
the third and fourth registers, respectively. The remaining state bits in the fourth register are set to
1 except the last bit. Namely, the initial state bits are represented as
∗ ∗
(IV127 , IV126 , . . . , IV0∗ ) = (IV1 , IV2 , . . . , IV128 ),
(s1 , s2 , . . . , s93 ) = (K1 , K2 , . . . , K93 ),
(s94 , s95 , . . . , s177 ) = (IV1 , IV2 , . . . , IV84 ),
(s178 , s279 , . . . , s288 ) = (IV85 , IV86 , . . . , IV128 , 1, 1, . . . , 1, 0),
∗ ∗
(K127 , K126 , . . . , K0∗ ) = (K1 , K2 , . . . , K128 ),
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 23
zi
t1 ← s66 ⊕ s93
t2 ← s162 ⊕ s177
t3 ← s243 ⊕ s288 ⊕ K0∗
z ← t1 ⊕ t2 ⊕ t3
t1 ← t1 ⊕ s91 · s92 ⊕ s171 ⊕ IV0∗
t2 ← t2 ⊕ s175 · s176 ⊕ s264
t3 ← t3 ⊕ s286 · s287 ⊕ s69
(s1 , s2 , . . . , s93 ) ← (t3 , s1 , . . . , s92 )
(s94 , s95 , . . . , s177 ) ← (t1 , s94 , . . . , s176 )
(s178 , s279 , . . . , s288 ) ← (t2 , s178 , . . . , s287 )
∗ ∗
(K127 , K126 , . . . , K0∗ ) ← (K0∗ , K127
∗ ∗
, K126 , . . . , K1∗ )
∗ ∗
(IV127 , IV126 , . . . , IV0∗ ) ← (IV0∗ , IV127
∗ ∗
, IV126 , . . . , IV1∗ )
Here z denotes the 1-bit key stream. First, in the initialization, the state is updated 4 × 288 = 1152
times without producing an output. After the initialization, one bit key stream is produced by every
update function.
MILP Model. The core function for Kreyvium is identical to that of Trivium but the initial
division property is more complicated. Kreyvium has 128 secret key bits K1 , . . . , K128 , 128 iv bits
IV1 , . . . , IV128 and 288-128-93=67 constant 0/1 state bits. So Algorithm 1 requires x, v of lengths 128
and 128+67=195, respectively. Then, for R-round Kreyvium, R iv bits IV1 , . . . , IV128 , IV1 , . . . , IV1+(R mod 128)
24 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
Table 6. Summary of theoretical cube attacks on Kreyvium. The time complexity in this table shows the
time complexity to recover the superpoly.
will be output by the register IV ∗ ; R + 1 key bits K1 , . . . , K128 , K1 , . . . , K1+(R+1 mod 128) will be
output by the register K ∗ . All these bits will be used in the updating function or output function.
So, we need to use the COPY rule to generate the division property of these bits before doing the
evaluations of the round functions. We detail the whole process in Algorithm 5. This algorithm
generates MILP model M as the input of Algorithm 1, and the model M can evaluate all division
trails for Kreyvium whose initialization rounds are reduced to R.
Experimental Verification. Identical to Trivium, we use the cube I = {1, 11, 21, 31, 41, 51, 61, 71}
to verify our attack and implementation.
Example 6 (Verification of Our Attack against 576-round Kreyvium). The cube I brings the super-
poly that involves 4 secret variables, J = {48, 73, 74, 75}. When the non-active IVs are assigned
to values such as 0x613fa9ca,0x5068e953,0xe0f73db6,0xc8c3491f, the ANF of the superpoly is
represented as
pv (x) = x48 ⊕ x73 x74 ⊕ x75 .
When the non-active values are assigned to values such as 0x66b4ece3,0xca7ee516,0xf9249367,0x1c1be1ec,
the superpoly is represented as
pv (x) = x48 ⊕ x73 x74 ⊕ x75 + 1.
and it can attack 872-round Kreyvium. Since the number of involved keys is |J| = 39, the complexity
is 285+39 = 2124 . This is the current best key-recovery attack on Kreyvium to our knowledge.
Assuming that either s1 or s2 of (8) is 0, (s1 ∧ s2 ) is always 0. In other words, the division
property of (s1 ∧ s2 ) must be 0. Therefore, following propagations satisfying the basic propagation
rule are never happened.
COP Y +AN D
(1, 0) −−−−−−−−−→ (0, 0, 1),
COP Y +AN D
(0, 1) −−−−−−−−−→ (0, 0, 1).
To prohibit the propagation above, we add
M.con ← a = 0
when either s1 or s2 is 0. Note that the judgment whether s1 or s2 is 0 or not is done outside of
the MILP model for the division property. In real, once differences from cube bits are fully diffused,
constant-0 state bits disappear. Therefore, this evaluation is very easy and efficient because it is the
same as the evaluation of the full diffusion. As a result. this modification can further improve the
preciseness of our MILP model.
837 37, Eq. (9) zero-sum distinguisher Both Liu’s method [Liu17] and ours
Trivium 838 38, Eq. (10) zero-sum distinguisher Ours
842 37, Eq. (9) biased sum Experimental result [Liu17]
872 61, Eq. (6) zero-sum distinguisher Both Liu’s method [Liu17] and ours
Kreyvium
873 62, Eq. (11) zero-sum distinguisher Ours
‡ The attack against 477 rounds is mainly described for the practical attack in [SBD+ 16]. However, when
the goal is the superpoly recovery and to recover one bit of the secret key, 503 rounds are attacked.
Comparison with Liu’s Method. We applied this technique to Trivium. Very recently, Liu
showed a new algorithm to guarantee the upper bound of the algebraic degree on NFSR-based
ciphers [Liu17]. He evaluated a cube shown as
I = {1, 3, 5, 7, 9, 11, 13, 16, 18, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 41, 43, (9)
46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 67, 69, 71, 73, 76, 80},
where non-cube cube bits are filled with 0. Then Liu showed that 837-round Trivium has zero-sum
cube distinguisher. We also evaluated the same cube by using our method, and it guaranteed that
the first keystream bit is balanced up to the same number of rounds. Further we evaluated a cube
as
I = {1, 3, 5, 7, 9, 11, 13, 16, 18, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 41, 43, (10)
46, 48, 50, 52, 54, 56, 58, 61, 63, 65, 67, 69, 71, 73, 76, 78, 80},
where IV78 is additionally chosen as cube bits from Eq.(9). This result derives 1-round longer zero-
sum distinguisher from Liu’s result. Liu showed 832-round distinguisher, where the probability that
the sum of the first key stream bit is 1 is 0.27. This distinguisher is experimental and constructed
based on Liu’s cube as Eq.( 9). Therefore, there is the possibility that we can find longer distinguisher
based on the cube as Eq.(10).
28 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
† I = {1, ..., 40, 42, 44, . . . , 51, 53, ..., 87, 89, 91, 93, 95}
I = {1, 3, 5, 6, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 30, 32, 34, 37, 39, 41, 43, 45, 47, 49,
51, 53, 55, 58, 60, 62, 64, 66, 68, 70, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, (11)
99, 101, 103, 105, 108, 110, 112, 114, 116, 118, 120, 123, 125, 127},
where IV6 is additionally chosen as cube bits. We can prove that such a cube has zero-sum property
for round 873 when non-cube iv bits are set to 0. These results are summarized in Table 7.
7 Discussions
7.1 Validity of Assumption 1 and 2
Whether the two assumptions hold depends on the structure of analyzed ciphers. In the three
applications shown in this paper, we could easily find balanced superpoly for Trivium and ACORN
by actually evaluating the offline phase using small cube. Therefore, we can expect that Assumption 1
holds in theoretical recovered superpolys for these two ciphers. On the other hand, we could not
find balanced superpolys for Grain128a. This implies that Assumption 1 does not hold in theoretical
recovered superpolys for Grain128a. However, since we could easily find non-constant superpolys,
we can expect that Assumption 2 holds.
Note that Assumption 1 is introduced to estimate the time complexity to recover the entire secret
key, and some information of secret variables is leaked to attackers even if only Assumption 2 holds.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 29
Moreover, even if both assumptions do not hold, the recovered superpoly is useful for distinguishing
attacks. Therefore, if the superpoly recovery is more efficient than the brute-force attack, it imme-
diately brings some vulnerability of symmetric-key cryptosystems. Therefore, the time complexity
for the superpoly recovery discussed in this paper is very important.
Conventional cube attacks also have a similar assumption because they experimentally verify
whether the superpoly is linear, quadratic, or not. For example, in [DS09], the authors judged that
the superpoly is linear if the superpoly passes at least 100 linearity tests. Moreover, Fouque and
Vannet also introduced heuristic linearity and quadraticity tests in [FV13], where the superpoly is
judged as linear and quadratic if it passes constant-order linearity and quadraticity tests, respectively.
These constant-order tests may fail if there are terms of the superpoly that are highly biased. For
example, assuming that the superpoly is represented as K1 + f (K2 , K3 , K4 , ..., K32 ) where f is
unbalanced, the test used in previous cube attacks may judge the superpoly as K1 in error. Namely,
the conventional cube attack also assumes that the superpoly is balanced for each involved secret
variables, and it fails to recover secret variables if this assumption is incorrect.
There is a possibility that we can recover multiple bits from a given cube by changing a value in
constant part of iv. Indeed, Example 3 recovers more than one bit of information in secret variables
by using an v = 0x03CC37748E34C601ADF5 or v = 0x78126459CB2384E6CCCE together with v =
0x644BD671BE0C9241481A. Moreover, two bits of information in secret variables are recovered if we
find two independent balanced superpolys. On the other hand, the superpoly must be simplified
enough for the key recovery. While we may be able to recover multiple bits only from one cube by
changing values of the constant part of iv when the number of involved secret variables is high, we
cannot claim that there are many independent balanced superpolys when the number of involved
secret variables is small. Therefore, we do not claim that multiple bits are recovered from one cube
by changing values of the constant part of iv.
There is previous work that exploits non-randomness in high degree monomial structure in the ANF
for the key recovery of stream ciphers: In [FKM08], it is examined if every key bit in the parametrized
expression of a coefficient of some high degree monomial in iv bits does occur, or more generally,
how much influence each key bit does have on the value of the coefficient. If a coefficient depends
on less than all key bits, this fact is exploited to filter those keys which do not satisfy the imposed
value for the coefficient. As opposed to the present work, this method is mostly statistical in nature,
whereas division property is fully algebraic.
Secondly, in [KMN10], conditions are identified on the internal state to obtain a deterministic
differential characteristic for some large number of rounds. Depending on whether these conditions
involve public variables only, or also key variables, distinguishing and partial key-recovery attacks
are derived. The technique is extended to (conditional) higher order differentials and enables to
distinguish reduced round versions of some stream ciphers, and to recover parts of the key. Again,
this method is quite different from the methods of this paper, and is not purely algebraic.
A third more recent approach is dynamic cube attack [DS11]. In contrast to standard cube
attack that finds the key by solving a system of (linear) equations in the key bits, dynamic cube
attack recovers the secret key by exploiting distinguishers obtained from cube testers. Dynamic
cube attacks aim at creating lower degree representations of the given cipher. This method has
been successfully applied to break the stream cipher Grain-128 [DGP+ 11]. All the previous methods
share the restriction that they are experimental rather than theoretical, i.e., they are dependent on
computing with cubes as large as practically feasible.
30 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
‡ The attack against 477 rounds is mainly described for the practical attack in [SBD+ 16]. However, when
the goal is the superpoly recovery and to recover one bit of the secret key, 503 rounds are attacked.
Dummy Objective Function. Unlike the evaluation of the differential and linear characteris-
tics [SHW+ 14b,SHW+ 14a,SHW+ 14a], the MILP model does not require an objective function in
the evaluation of our cube attack. However, we know that good “dummy” objective function some-
times helps Gurobi to speed up.
For example, let us consider the case of Trivium. Then we do not introduce any objective
function because we only evaluate the feasibility. To accelerate the solving time, we may add the
following dummy objective function
288
R/2
X
M.obj ← maximize si
i=1
as an example, where we maximize the sum of the division property in the half number of rounds.
Note that the maximized value has no meaning, and we only know whether the model is feasible or
not. Therefore, once the MILP solver can find one feasible solution, we terminate the solver.
Use of Lazy Constraints. In Algorithm 1, we have to solve MILP model repeatedly until the
model becomes infeasible. Then the MILP model is refreshed every time it finds a feasible solution,
which may be a waste of time. To accelerate the total solving time, we cut found solutions by “lazy
constraints.” In our implementation, we used C++ API in Gurobi.
The lazy constraintsPare generally used to add “new constraint” during the optimization. In our
m
case, we first constrain i=1 xi = 1, and when we find one instance where xj is involved, we remove
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 31
the instance using addLazy constraint as xj = 0. Finally, the code stops when the model is infeasible.
When we try this technique in Gurobi, this dramatically accelerates the solving time. Therefore, we
suggest the implementation with lazy constraints if possible.
8 Conclusion
This paper revisited the cube attack proposed by Dinur and Shamir at Eurocrypt 2009. The con-
ventional cube attack regards a target symmetric-key cryptosystem as a blackbox polynomial and
analyzes the polynomial experimentally. Therefore, it is practically infeasible to evaluate the security
when the size of cube exceeds the experimental size. In this paper, we proposed the cube attack on
non-blackbox polynomials, and it enables the cube attack to exploit a large cube size. Our method
was developed by the division property, and as far as we know, this is the first application of the
division property to stream ciphers. The trivial application brings only zero-sum integral distinguish-
ers, and it is non-trivial to recover the secret key of stream ciphers by using the distinguisher. The
novel application of the division property was proposed, where it is used to analyze the Algebraic
Normal Form coefficients of polynomials. As a result, we can estimate the time complexity for the
superpoly recovery. Then, the superpoly recovery immediately brings the vulnerability. We applied
the new technique to Trivium, Grain128a, and ACORN, and the superpoly of 832-round Trivium,
183-round Grain128a, and 704-round ACORN are more efficiently recovered than the brute-force
search. For Trivium and ACORN, we can expect that the recovered superpoly is useful for the
key recovery attack, and they bring the current best key-recovery attacks. On the other hand, for
Grain128a, we cannot expect that the recovered superpoly is balanced, and then the recovered bit of
information may be significantly small. Therefore, the feasibility of the key recovery is speculative,
but 183 rounds are at least vulnerable. We expect that our new tool becomes a new generic tool to
measure the security of stream ciphers.
References
ADMS09. Jean-Philippe Aumasson, Itai Dinur, Willi Meier, and Adi Shamir. Cube testers and key recovery
attacks on reduced-round MD6 and Trivium. In Orr Dunkelman, editor, FSE, volume 5665 of
LNCS, pages 1–22. Springer, 2009.
ÅHJM11. Martin Ågren, Martin Hell, Thomas Johansson, and Willi Meier. Grain-128a: a new version of
grain-128 with optional authentication. IJWMC, 5(1):48–59, 2011.
BS01. Alex Biryukov and Adi Shamir. Structural cryptanalysis of SASAS. In Birgit Pfitzmann, editor,
EUROCRYPT, volume 2045 of LNCS, pages 394–405. Springer, 2001.
cae14. CAESAR: Competition for authenticated encryption: Security, applicability, and robustness,
2014.
CCF+ 16. Anne Canteaut, Sergiu Carpov, Caroline Fontaine, Tancrède Lepoint, Marı́a Naya-Plasencia,
Pascal Paillier, and Renaud Sirdey. Stream ciphers: A practical solution for efficient
homomorphic-ciphertext compression. In Thomas Peyrin, editor, FSE, volume 9783 of LNCS,
pages 313–333. Springer, 2016.
CJF+ 16. Tingting Cui, Keting Jia, Kai Fu, Shiyao Chen, and Meiqin Wang. New automatic search tool
for impossible differentials and zero-correlation linear approximations, 2016.
CP06. Christophe De Cannière and Bart Preneel. Trivium specifications, 2006. eSTREAM portfolio,
Profile 2 (HW).
DGP+ 11. Itai Dinur, Tim Güneysu, Christof Paar, Adi Shamir, and Ralf Zimmermann. An experimentally
verified attack on full Grain-128 using dedicated reconfigurable hardware. In Dong Hoon Lee
and Xiaoyun Wang, editors, ASIACRYPT, volume 7073 of LNCS, pages 327–343. Springer,
2011.
DKR97. Joan Daemen, Lars R. Knudsen, and Vincent Rijmen. The block cipher Square. In Eli Biham,
editor, FSE, volume 1267 of LNCS, pages 149–165. Springer, 1997.
32 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier
DMP+ 15. Itai Dinur, Pawel Morawiecki, Josef Pieprzyk, Marian Srebrny, and Michal Straus. Cube attacks
and cube-attack-like cryptanalysis on the round-reduced Keccak sponge function. In Elisabeth
Oswald and Marc Fischlin, editors, EUROCRYPT Part I, volume 9056 of LNCS, pages 733–761.
Springer, 2015.
DS09. Itai Dinur and Adi Shamir. Cube attacks on tweakable black box polynomials. In Antoine Joux,
editor, EUROCRYPT, volume 5479 of LNCS, pages 278–299. Springer, 2009.
DS11. Itai Dinur and Adi Shamir. Breaking Grain-128 with dynamic cube attacks. In Antoine Joux,
editor, FSE, volume 6733 of LNCS, pages 167–187. Springer, 2011.
est08. eSTREAM: the ECRYPT stream cipher project, 2008.
FKM08. Simon Fischer, Shahram Khazaei, and Willi Meier. Chosen IV statistical analysis for key recovery
attacks on stream ciphers. In Serge Vaudenay, editor, AFRICACRYPT, volume 5023 of LNCS,
pages 236–245. Springer, 2008.
FV13. Pierre-Alain Fouque and Thomas Vannet. Improving key recovery to 784 and 799 rounds of
trivium using optimized cube attacks. In Shiho Moriai, editor, FSE, volume 8424 of LNCS,
pages 502–517. Springer, 2013.
Inc15. Gurobi Optimization Inc. Gurobi optimizer 6.5. Official webpage, http://www.gurobi.com/,
2015.
ISO15. ISO/IEC. JTC1: ISO/IEC 29167-13: Information technology – automatic identification and
data capture techniques – part 13: Crypto suite grain-128a security services for air interface
communications, 2015.
KMN10. Simon Knellwolf, Willi Meier, and Marı́a Naya-Plasencia. Conditional differential cryptanalysis
of NLFSR-based cryptosystems. In Masayuki Abe, editor, ASIACRYPT, volume 6477 of LNCS,
pages 130–145. Springer, 2010.
Knu94. Lars R. Knudsen. Truncated and higher order differentials. In Bart Preneel, editor, FSE, volume
1008 of LNCS, pages 196–211. Springer, 1994.
KW02. Lars R. Knudsen and David Wagner. Integral cryptanalysis. In Joan Daemen and Vincent
Rijmen, editors, FSE, volume 2365 of LNCS, pages 112–127. Springer, 2002.
Lai94. Xuejia Lai. Higher order derivatives and differential cryptanalysis. In Communications and
Cryptography, volume 276 of The Springer International Series in Engineering and Computer
Science, pages 227–233, 1994.
Liu17. Meicheng Liu. Degree evaluation of NFSR-based cryptosystems. In Jonathan Katz and Hovav
Shacham, editors, CRYPTO Part III, volume 10403 of LNCS, pages 227–249. Springer, 2017.
LM12. Michael Lehmann and Willi Meier. Conditional differential cryptanalysis of Grain-128a. In Josef
Pieprzyk, Ahmad-Reza Sadeghi, and Mark Manulis, editors, CANS, volume 7712 of LNCS, pages
1–11. Springer, 2012.
Luc01. Stefan Lucks. The saturation attack - A bait for Twofish. In Mitsuru Matsui, editor, FSE,
volume 2355 of LNCS, pages 1–15. Springer, 2001.
MS12. Piotr Mroczkowski and Janusz Szmidt. The cube attack on stream cipher Trivium and quadratic-
ity tests. Fundam. Inform., 114(3-4):309–318, 2012.
MWGP11. Nicky Mouha, Qingju Wang, Dawu Gu, and Bart Preneel. Differential and linear cryptanalysis
using mixed-integer linear programming. In Chuankun Wu, Moti Yung, and Dongdai Lin,
editors, Inscrypt, volume 7537 of LNCS, pages 57–76. Springer, 2011.
SBD+ 16. Md. Iftekhar Salam, Harry Bartlett, Ed Dawson, Josef Pieprzyk, Leonie Simpson, and Ken-
neth Koon-Ho Wong. Investigating cube attacks on the authenticated encryption stream cipher
ACORN. In Lynn Batten and Gang Li, editors, ATIS, volume 651 of CCIS, pages 15–26.
Springer, 2016.
SHW+ 14a. Siwei Sun, Lei Hu, Meiqin Wang, Peng Wang, Kexin Qiao, Xiaoshuang Ma, Danping Shi, and
Ling Song. Towards finding the best characteristics of some bit-oriented block ciphers and
automatic enumeration of (related-key) differential and linear characteristics with predefined
properties, 2014.
SHW+ 14b. Siwei Sun, Lei Hu, Peng Wang, Kexin Qiao, Xiaoshuang Ma, and Ling Song. Automatic se-
curity evaluation and (related-key) differential characteristic search: Application to SIMON,
PRESENT, LBlock, DES(L) and other bit-oriented block ciphers. In Palash Sarkar and Tetsu
Iwata, editors, ASIACRYPT Part I, volume 8873 of LNCS, pages 158–178. Springer, 2014.
ST16. Yu Sasaki and Yosuke Todo. New impossible differential search tool from design and cryptanal-
ysis aspects, 2016. this paper is accepted in Eurocrypt 2017.
Cube Attacks on Non-Blackbox Polynomials Based on Division Property (Full Version) 33
SWW16. Ling Sun, Wei Wang, and Meiqin Wang. MILP-aided bit-based division property for primitives
with non-bit-permutation linear layers, 2016.
TIHM17. Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier. Cube attacks on non-blackbox poly-
nomials based on division property. In Jonathan Katz and Hovav Shacham, editors, CRYPTO
Part III, volume 10403 of LNCS, pages 250–279. Springer, 2017.
TM16. Yosuke Todo and Masakatu Morii. Bit-based division property and application to Simon family.
In Thomas Peyrin, editor, FSE, volume 9783 of LNCS, pages 357–377. Springer, 2016.
Tod15a. Yosuke Todo. Integral cryptanalysis on full MISTY1. In Rosario Gennaro and Matthew Rob-
shaw, editors, CRYPTO Part I, volume 9215 of LNCS, pages 413–432. Springer, 2015.
Tod15b. Yosuke Todo. Structural evaluation by generalized integral property. In Elisabeth Oswald and
Marc Fischlin, editors, EUROCRYPT Part I, volume 9056 of LNCS, pages 287–314. Springer,
2015.
Wu16. Hongjun Wu. Acorn v3, 2016. Submission to CAESAR competition.
XZBL16. Zejun Xiang, Wentao Zhang, Zhenzhen Bao, and Dongdai Lin. Applying MILP method to
searching integral distinguishers based on division property for 6 lightweight block ciphers. In
Jung Hee Cheon and Tsuyoshi Takagi, editors, ASIACRYPT Part I, volume 10031 of LNCS,
pages 648–678. Springer, 2016.
34 Yosuke Todo, Takanori Isobe, Yonglin Hao, and Willi Meier