Introduction
Square attack, proposed by Ref. [
1], considers the propagation of sums of (many) ciphertexts with special inputs. It was first applied to the Square cipher that is of substitution permutation network structured (SPN-structured). Reference [
2] first applied Square attack, employing a different term “saturation attack” to Feistel cipher. The so-called multiset attack, proposed by Ref. [
3], is another name of Square attack. In fact, all of these attacks belong to the integral cryptanalysis [
4], proposed by Knudsen et al., at FSE 2002.
Integrals exploit the simultaneous relationship between many encryptions, in contrast to differential cryptanalysis where only pairs of encryptions are considered. This feature makes it especially well-suited in analyzing ciphers with primarily bijective components that are not vulnerable to differential and linear cryptanalysis. This feature also makes integral an increasingly popular tool in the recent cryptanalysis works. At FSE 2008, Ref. [
5] proposed the bit-pattern-based integral attack that can be seen as a complement of the traditional integral attack proposed in Ref. [
4], since the traditional ones can only be applied to byte (word)-oriented ciphers, while the bit-pattern based ones can only be applied to bit-oriented ciphers.
Camellia [
6] is a 128-bit block cipher proposed by NTT and Mitsubishi in 2000 and supports 128/192/256-bit keys. The design of Camellia is based on the Feistel structure with an SPN-structured round function, and the number of rounds is 18 for 128-bit key version and 24 for 192/256-bit key version. An FL/FL
-1 function layer is inserted in every six rounds in order to thwart future unknown attacks. Before the first round and after the last round, there are pre- and post-whitening layers, respectively. Camellia had been submitted to the standardization and the evaluation projects, such as ISO/IEC JTC 1/SC 27, CRYPTREC, and NESSIE. It is one of the winners of the NESSIE project.
Since its publication, Camellia has been widely analyzed. In Ref. [
7], the security against truncated differential cryptanalysis is studied, and it has been proved that 11 rounds are enough to make Camellia resilient to the byte-character-based truncated differential attacks. In Ref. [
8], empowered by computer aids, security against higher order differential attack was studied. He and Qing found that 6-round Camellia is breakable by Square attack [
9]. Reference [
10] improved the known result about Square attack. Later, Ref. [
11] adopted the equivalent structure of Feistel cipher that improved the known results of Square attack on Camellia. Reference [
12] gave an efficient collision attack on Camellia, and later in Ref. [
13], some nontrivial 8-round impossible differential was given; based on which, Ref. [
14] gave an effective attack on Camellia with up to 14 rounds.
To date, there are many ciphers that adopt multi-S-boxes instead of single S-box, and Camellia is one of them. Another example that adopts multi-S-boxes is ARIA [
15], which is a 128-bit block cipher designed by a group of Korean experts in 2003. ARIA is an SPN cipher. To make the encryption and decryption alike, the designers of ARIA adopted two S-boxes, which are denoted by
S1 and
S2, as well as their inversions
and
to make the cipher involutional.
Although many ciphers adopt multi-S-boxes, however, how the multi-S-boxes influence the security of ciphers remains undiscovered. Reference [
7] investigated truncated differentials and found that for byte-character-based truncated differentials, the multi-S-boxes case can decrease the truncated differential probabilities, thus making the cipher stronger against truncated differential attack. Reference [
16] investigated the security of ARIA against integral attack and suggested that if the cipher adopts only single S-box or different order of the multi-S-boxes, security margins are different. The basic technique of Ref. [
16] is a counting method: if different values of a set appear even times, the sum of all element of the correspondence set is zero; in other words, the set is balanced.
This paper focuses on how multi-S-boxes and their order will influence the security of Camellia against Square attack. Our results show that if Camellia adopts single S-box, the security margin will be decreased to design a cipher using multi-S-boxes, the order of these S-boxes should be chosen carefully; otherwise, the security of the ciphers with different orders against Square attack might be compromised.
The rest of this paper is organized as follows: Section 2 briefly describes the Camellia cipher, its variant (Camellia*), and the basis of Square attack. Section 3 focuses on finding Square distinguisher of Camellia*. In Sect. 4, Square attacks on some round-reduced Camellia* are presented. Finally, Sect. 5 concludes the paper.
Preliminaries
Description of Camellia
Camellia is an iterative block cipher with Feistel structure. Let the
ith round input and output be (
Li-1,
Ri-1) and (
Li,
Ri), then
where
F is the round function, and
ki is the round key, which is generated from a master key through the key schedule.
An FL/FL
-1 function is inserted every six rounds in order to thwart future unknown attack, and the FL function is defined as follows:
where
is the bit-wise and operation, while
is the bit-wise or operation.
The round function
F function contains three transformations, namely, key-addition,
S-function, and
P-function.
S-function contains four types of nonlinear S-boxes
s1,
s2,
s3, and
s4, where
s2,
s3, and
s4 are variations of
s1.
S-function maps
to
, which is defined as
P-function maps
to
:
Obviously,
P is a linear transformation, and it can be easily computed that
P-1, the inverse of the
P-function, is defined as
Since we assume that the round keys are independent with each other, the key schedule of Camellia is omitted, and we refer to Ref. [
15] for more details.
To evaluate the influence of four S-boxes and different order of these S-boxes being used, we analyze the case where only single S-box is used, and this variant is all Camellia* whose
S-function is replaced by
where
s is one of
s1,
s2,
s3, and
s4, and the FL/FL
-1 is omitted. Other parts of Camellia and Camellia* are the same.
Basis of Square attack
The following definitions are essential when applying an integral attack.
Let a Λ-set be a set of 256 states that are all different in some of the state bytes (the active) and all equal in the other state bytes (the passive). We have
Let Γ-set (balanced set) be a set of 256 states that are all equal to zero in summation (the balanced). We have
Applying the S-function or key-addition on a Λ-set results in a Λ-set with the positions of the active bytes unchanged. The result set of applying P-function to a Λ-set is not always a Λ-set but always a Γ-set.
In practice, if a balanced set comes with a nonlinear transformation, the finding process is stopped. Thus, the determination of the property of balanced set after it passed through a nonlinear transformation is very important in finding integral distinguishers. Reference [
16] determined the property of balanced set after it passes through a nonlinear by determining that different values in the set appear even times; thus, the corresponding set is a balanced one.
4.5-round Square distinguisher of Camellia*
Let the input and output of the ith round be (Li-1, Ri-1) and (Li, Ri), respectively, and the output of S-function and P-function be Zi and Yi, respectively. Let Xi,j denote the jth byte of Xi, where X can represent L, R or Z, Y.
Assume that the input to Camellia* is
where
c denotes some constant value in
(which are not necessarily equal to each other at different positions). Thus
where
t1 and
t2 are some unknown constants in
. Let
. Since
S(
x) is a one-to-one map, so is
f(
x). After the
P-function, we have
where
are some unknown constants.
Similarly, we have
where
are also some unknown constants.
Based on above, we can compute the expression of
Y3 and
L3 =
R4. Since each byte of
L3 is a sum of some active bytes and each byte of
L3 is balanced, this supports Ref. [
7]’s claim as the 4-round Square distinguisher of Camellia.
After computing the expression of
L3, we can find that the 8th byte of
L3 satisfies
where
γ is a constant.
Let
, thus
If
,
is a constant; if
, we have
where
. Since
L3=
R4, the following theorem holds.
Theorem 1 Assuming Camellia* is defined as above, if all the bytes of the left half of the input to Camellia* are fixed, and in the right half, all the bytes are fixed except the first one is active, then all the bytes of the right half of the output of the 4th round are balanced, besides, the times that different values appear at the 8th byte, i.e., Z4,8, are even integers.
According to Theorem 1, the times that different values of L3,8 appear are even integers, Because the S-box is a bijective map, the times that different values of Z4,8 appear are even integers. Thus, Z4,8 is a balanced byte. Also, because Z4,8 is the output of S-box, rather than a full round, the distinguisher shown in Theorem 1 is called a 4.5-round Square distinguisher of Camellia*.
In the original Camellia, we have
by which we can only determine that
R4,8 is a balanced byte. If one wants to determine whether the times that different values of
R4,8 appear is even or odd, it is enough that the S-boxes at positions 1 and 5 are the same.
Reference [
8] evaluated the security of Camellia against higher order differential attacks. According to the definition of higher order differences and by aid of computers, some higher order differences of round-reduced Camellia were found. In fact, the result of Theorem 1 will also be found by computers.
The results in this section show that, when a cipher adopts multi-S-boxes, in order to improve the immunity against Square attack, the designers must choose the order of the S-boxes carefully.
We can simply denote the Square distinguisher shown in Theorem 1 by (PR,1, Z4,8), which means that if only PR,1 is active and other bytes are constants, Z4,8 is a balanced byte. By the same techniques, we can find the following Square distinguishers of Camellia*: (PR,2, Z4,5), (PR,3, Z4,6), and (PR,4, Z4,7). Details of the proofs are omitted.
Square attacks on Camellia*
Square attack on 6-round Camellia*
To apply a 6-round Square attack, we adopt the method that has been used in Ref. [
8] (See Fig. 1).
First, we have
Thus,
which means that
Thus, we have
according to which we have the following attack on 6-round Camellia*.
Step 1 Choose plaintexts with the following form where
c is some constant not necessarily equal to each other at different positions, and
x takes all value of
:
the corresponding ciphertexts are denoted by (
CL(
x),
CR(
x)). Then, compute
Step 2 Guess
k6,8 of the 6th round key and compute
If
, keep
k6,8 as a candidate of the right subkey; otherwise, it is rejected.
Step 3 If necessary, repeat Steps 1 and 2 until the value of k6,8 is uniquely determined.
For a wrong key, with probability 2-8, holds. Thus, after choosing a structure of plaintexts, there are (28-1)×2-8≈1 wrong keys that can pass the test. To uniquely determine the correct key, two structures are sufficient. Therefore, the data complexity of the above attack is 2×28=29 chosen plaintexts. Accordingly, the time complexity of the attack is about 28×28+2×28 times lookup tables, and since there are 6×8 S-boxes in 6-round Camellia*, the time complexity is about (28×28+2×28)/(6×8) ≈210.4 encryptions. Since the structure must be stored, the space complexity of the attack is 28 plaintext/ciphertext pairs.
Square attack on 7-round Camellia*
The 7-round attack is based on the 6-round attack with additional one round at the beginning.
Step 1 Choose plaintexts with the left half being
where
c is some constant not necessarily equal to each other at different positions; guess a value for
k1,1, and compute
Then, compute the corresponding ciphertext of (
PL,
CR), say, (
CL,
CR), and last, compute
.
Step 2 Guess a value for
k7,8, then compute
If
, put (
k1,1,
k6,8) as a candidate of the right keys; otherwise, it is rejected.
Step 3 If necessary, repeat Steps 1 and 2 until the value of (k1,1, k6,8) is uniquely determined.
If
k1,1 is the correct value, the output of the first round is
thus the 6-round attack can be applied to the following 6-round cipher. Because a wrong value for
k7,8 can pass the test with probability 2
-8, three different structures of
PL will be needed to uniquely determine (
k1,1,
k6,8). Thus, the data complexity of the attack is 2
17.6 chosen plaintexts, time complexity is (2×2
8×2
8×2
8+2
8×2
8+2×2
8)/(8×7)≈2
19.2 encryptions, space complexity of the attack is 2
8 plaintext/ciphertext pairs, and 2
8 keys are candidates after analyzing the first structure.
This attack is valid even if an FL/FL-1 is inserted.
In fact, if there is no FL/FL
-1 transformation,
, we only need to know five bytes of
, thus when FL/FL
-1 is added, we need to guess another 5×8 bits of
kl and 8 bits of
kr, where
kl and
kr stand for the left and right halves of the correspondence subkey. Therefore, the number of structures must satisfy
which tells that
is enough. Therefore, the data complexity is
chosen plaintexts, and the time complexity is
encryptions.
Square attack on 11-round Camellia*
The 11-round attack is based on the 6-round attack with additional two rounds at the beginning and three rounds at the end. In the two rounds at the beginning, it needs to guess six bytes subkeys; and in the three rounds at the end, it needs to guess 22 bytes subkeys.
Step 1 Guess a value for
k2,1, and
then guess
k1,1,
k1,2,
k1,3,
k1,5,
k1,8 and compute
Step 2 Guess all bytes of the 11th round-key (eight bytes) and compute (L10, R10), then guess all bytes of the 10th round-key (8 bytes) and compute (L9,8, R9); guess k9,1, k9,4, k9,5, k9,6, k9,7 and compute (L8,(1,4,5,6,7), R8,8); guess k8,8 and check whether the following equation holds:
If the equation does not hold, the combination of the correspondence subkeys is a wrong one.
Step 3 If necessary, repeat Steps 1 and 2 until the combination of the subkeys is uniquely determined.
To uniquely determine the candidates, it needs 29 different structures of PL. Thus, the data complexity of the attack is 29×28×240≈252.9 chosen plaintexts; the time complexity is (28×28×240×222×8+···)/(8×11)≈2225.5 encryptions; and the space complexity is 2216.
Conclusion
This paper primarily investigated the relationship between the order of S-boxes and immunity of ciphers against Square attack. Results in this paper show that, if Camellia adopts only a single S-box instead of four S-boxes, the security of Camellia against Square attack decreased dramatically. Also, if the order of the four S-boxed is changed, the security of Camellia against Square attack is also decreased. See Table 1 for the comparison of these results. In the design of a cipher, multi-S-boxes can improve the security of the cipher, given that one can carefully chooses the order of the S-boxes being used.
Higher Education Press and Springer-Verlag Berlin Heidelberg