1. Introduction
There has been substantial progress in quantum computer development in recent years. Experts in physics, quantum computing, and computer architecture are committed to realizing quantum computers. While quantum computing may bring benefits to research in many fields, it also brings challenges, especially for cryptography.
The key difference in quantum computing from classical information computing and processing is parallelism, which comes from the principle of superposition. This parallelism superiority makes it possible to execute a great quantity of computational paths simultaneously on quantum computers, so that some computational problems that cannot be solved by electronic computers may be solved by quantum computers. For example, factoring large integers will be solvable on quantum computers by utilizing Shor’s algorithm [
1]; however, the security of some widely used public key algorithms is built on it.
Apart from public key schemes, symmetric cryptography is under the threat of quantum attacks as well. Grover’s algorithm [
2] is the most representative example. It can be used for any unstructured search and brings a quadratic speedup. Searching a specific marked target in an
M-element database using Grover’s algorithm needs only
complexity, while classical algorithms need at least
complexity. Another famous example is Simon’s algorithm [
3], which was introduced to find periods. It is also frequently applied to cryptanalysis of symmetric ciphers. At first, Simon’s algorithm was exploited to distinguish between a Feistel structure and a random function [
4,
5,
6]. Afterwards, it was also utilized to find the key of the Even-Mansour (EM) scheme [
6,
7]. Lender et al. then utilized Grover’s algorithm and Simon’s algorithm simultaneously to extract the keys of FX ciphers [
8]. Dong and Wang applied a similar method to attack a Feistel cipher [
9] and the generalized Feistel cipher [
10]. As for the Substitution–Permutation Network (SPN) structure, quantum attacks on the Advanced Encryption Standard (AES) algorithm were investigated by Jaques et al. [
11]. Halak et al. evaluated the computation costs and performance of several quantum-attack-resilient cryptographic algorithms [
12]. Recently, the research on the cryptanalysis of symmetric schemes has begun to pay attention to the Bernstein–Vazirani (BV) algorithm [
13] and has obtained some good results [
14,
15].
In addition to the specific attacks on certain symmetric ciphers, analytic tools for symmetric ciphers must also be investigated for accurate security evaluation. In this direction, Grover’s algorithm was used to accelerate the search involved in differential attacks [
11,
16], and it was also used in the search part of linear attacks and their variants [
17]. Afterwards, the BV algorithm was exploited for finding differentials [
14,
18,
19]. Zhou and Yuan combined the BV algorithm and Grover’s algorithm for attacking Feistel ciphers [
15]. Their attack strategy was inspired by the attack presented in [
8,
9], the main innovation being that it uses BV algorithm to distinguish the functions with nonzero linear structures from random functions instead of using Simon’s algorithm to distinguish functions with nonzero periods from random functions. Quantum algorithms are also applied to the collision attack on Hash functions [
20,
21]. Quantum cryptanalysis under the related-key model has also been studied [
22,
23]. The attacks mentioned above all exhibit the acceleration superiority of quantum algorithms in symmetric cryptanalysis over classical algorithms.
In this study, we investigate quantum attacks on the MIBS cipher, which is a lightweight algorithm with a Feistel structure and designed specifically for constrained environments [
24]. First, by analyzing the characteristics of the MIBS cipher, we construct linear-structure functions based on the 5-round encryption of the MIBS cipher. Then, we combine this function with the BV algorithm to construct a distinguisher of the 5-round MIBS cipher. Afterwards, we utilize Grover’s algorithm and this distinguisher to implement a 7-round key-recovery attack on the MIBS cipher. Based on a similar idea, we further use the same distinguisher to implement 8-round and 9-round key-recovery attacks on the MIBS cipher. The 7-round, 8-round, and 9-round attacks require 156, 179, and 194 qubits, respectively, and their complexity are
,
, and
, respectively. Compared with existing quantum attacks, the quantum attacks presented in this article have the minimum complexity when attacking the same number of rounds. Our work further explores the “BV-meet-Grover’’ attack strategy and helps to evaluate the security of the MIBS cipher.
We first construct a periodic function based on the 5-round encryption, and then we combine Simon’s algorithm with the found periodic function to obtain a 5-round quantum distinguisher. As the number of rounds increases, the encryption function becomes more complex, making it increasingly difficult to find periodic functions. The 5-round distinguisher is the longest distinguisher we can find. Using the constructed 5-round distinguisher to attack 7-round, 8-round, and 9-round MIBS requires guessing 21, 44, and 64 bits of subkeys, respectively. The complexity of the 10-round attack exceeds that of the key exhaustive attack. Therefore, we only provide 7-round, 8-round, and 9-round attacks on MIBS.
Organization.
Section 2 recalls the the fundamental concepts of quantum computing and cryptography;
Section 3 constructs a 5-round quantum distinguisher of the MIBS cipher;
Section 4 presents key-recovery attacks on the MIBS cipher;
Section 5 provides a summary.
3. Quantum Distinguisher of MIBS
One of the common methods for attacking block ciphers by quantum algorithms is to first construct a quantum distinguisher by Simon’s algorithm or the BV algorithm, and then utilize Grover’s algorithm to extract the correct key based on the constructed distinguisher. Specifically, Simon’s algorithm can quickly determine whether a function is a periodic function. To obtain a distinguisher, the attacker first constructs a periodic function by using part of the encryption algorithm. Then, when the queried oracle is the block cipher, implementing Simon’s algorithm on the constructed function should output a period. When the queried oracle is a random function, applying Simon’s algorithm on the constructed function outputs a nonzero period with a negligible probability. Based on this significant difference, the attacker can distinguish between the block cipher and random function. In the phase of key recovery, the attacker guesses the round keys of several rounds after the distinguisher and uses the guessed keys to decrypt the ciphertexts obtained by querying. If the guessed round keys are correct, then the distinguisher performed on the partly decrypted ciphertexts should identify them as the outputs of a block cipher. If the round keys are incorrect, the partly decrypted ciphertexts are equivalent to the outputs of a random function. Thus, the distinguisher should identify them as outputs of a random function. By traversing all possible round keys, the attacker can recognize the correct key. In this process, Grover’s algorithm can provide speedup. This attack strategy is called “Grover-meet-Simon” [
8,
9,
10].
Similar to Grover-meet-Simon, the strategy “Grover-meet-BV” is also used [
15]. In a Grover-meet-BV attack, the attacker constructs a linear-structure function instead of a periodic function and uses the BV algorithm to distinguish functions with nonzero linear structures from random functions, instead of using Simon’s algorithm to distinguish functions with nonzero periods from random functions. Except for this point, other parts of these two attacks are the same. According to this attack strategy, we first construct a linear-structure function based on a 5-round encryption of MIBS; then, we present a 5-round quantum distinguisher of MIBS using this linear structure function and BV algorithm.
3.1. A Linear-Structure Function Based on 5-Round MIBS
In this subsection, we construct a linear-structure function based on 5-round MIBS. For the convenience of derivation, let
be the
F transformation in the
i-th round, and let the
S layer in the
i-th round be
, as presented in
Figure 5. All
s (
’s) operate in the same way. The left-branch input in the
i-th round is
, and the right branch is
.
Select two arbitrary constant vectors
such that
. For any variables
and
, let the input of the 5-round MIBS be
where
,
when
, and
when
.
is defined as in Equation (
1). We use
to construct a linear-structure function. Due to Equation (
3), for computing
, we should first compute
and
. Let
be the
j-th nibble of the
i-th round key
. That is,
It holds that
where
,
is a constant, and the notation
indicates that the corresponding nibble is a constant. The values of different nibbles marked with
may be different, but they are all restricted to constants that do not depend on variables
x and
d. Then,
Therefore,
where
. Since
we have
Before further deriving the linear-structure function, we first give Lemma 1.
Lemma 1. Let , where and ; then, the value of the 5th nibble of is only related to the value of ∗.
Proof. According to the construction of the
transformation,
where
indicates that the corresponding nibble is a constant, and
indicates that the value of the corresponding nibble is a function of ∗. Different nibbles marked with
may be different functions of ∗, but their values are all restricted to only depend on the variable ∗. Notations
and
are used to indicate the state of the corresponding nibbles, not a specific vector or function. The last equality holds since
is a constant. Then,
Therefore,
where “?” means that the state of corresponding nibbles is uncertain. Due to the above equation, the 5th nibble
of
is in the state
; thus, its values are only related to ∗. The notation
means that every nibble marked with
is a function of ∗. The
does not refer to a specific function, but rather indicates that the values of the corresponding nibbles depend only on the value of ∗. It represents a kind of state of nibbles rather than a specific function. The
symbols in the 2nd, 3rd, and 5th nibbles of
indicate that these three nibbles are all functions of ∗, and their values depend only on ∗, but they are not necessarily the same function. □
According to Lemma 1, we define the function
where
and
, i.e., the ciphertext after a 5-round encryption of MIBS.
is the inverse function of
.
is the 5th nibble of
.
.
Theorem 2. Function is a linear-structure function, and is its linear structure. Specifically,where and are constants. Proof. According to Equation (
3), it holds that
Due to Equation (
4), we have
We compute the first part:
Then, we compute the second part:
Combining these two parts gives
These two equations mean that
which indicates the conclusion. □
3.2. 5-Round Quantum Distinguisher
We have constructed a linear-structure function based on the 5-round encryption of MIBS. Combining this with the quantum algorithm, which can determine whether a function is a linear-structure function, we can obtain a quantum distinguisher of 5-round MIBS.
Based on Algorithm 1, Xie and Yang constructed a quantum algorithm that can determine whether a function has linear structures [
14]. We present this quantum algorithm below.
Theorem 3 ([
14]).
If is a linear-structure function, then except with a negligible probability, Algorithm 2 on f with will output a linear structure of f. Algorithm 2 [14] Algorithm for finding linear structures of multiple-output functions |
Input: quantum oracle of , a polynomial . (.) |
Output: a linear structure of f. |
1: for
do |
2: Run Algorithm 1 on with ; |
3: if Algorithm 1 returns “Not linear structure function” then |
4: Output “Not linear structure function”; |
5: else |
6: Let , where and are the outputs of Algorithm 1; |
7: end if |
8: end for |
9: if
then |
10: Return “Not linear structure function”; |
11: else |
12: Randomly choose a nonzero vector and return ; |
13: end if |
In a quantum distinguishing attack on 5-round MIBS, a quantum oracle
is available, which implements either the encryption of 5-round MIBS
or a random function
. Since the linear-structure function
G is defined only using the right part
of the output of
, it is assumed that the attacker can query the oracle, which merely returns the right branch
. Such assumption is commonly used in quantum distinguishing attacks [
4,
5,
6]. Moreover, in the following key-recovery attack, we show how to construct such oracle via the oracle of complete encryption. Thus, the attacker can query
by implementing either the operator
or the operator
where
is the the encryption function of 5-round MIBS, which only returns the right 32 bits, and
is a random function.
A quantum distinguisher of
is a quantum algorithm that can distinguish whether
implements
or a random function
. In order to construct a quantum distinguisher, an intuitive idea is to construct the oracle
of function
G based on
and then run Algorithm 2 on
to determine whether it is the oracle of a linear-structure function, thereby determining whether
is the encryption of 5-round MIBS. If
implements
, then Algorithm 2 will return a linear structure of
G; otherwise, if
implements
, then its probability of outputting a linear structure of
G is negligible.
Figure 6 shows how to construct the oracle
of function
G based on
. The unitary operator
is composed of 32
gates and works as follows:
Similarly,
is composed of 4
gates and works as follows:
The unitary operator
is defined as
and can be realized as shown in
Figure 7. The input
of
is combined with 31 auxiliary states
to form the state
, and the input
is combined with 28 auxiliary states
to form the state
. The states in
Figure 6 are defined as below.
Therefore, when
is the oracle of
, it holds that
When
is the oracle of random function
, it holds that
The disentanglement process is to disentangle the registers denoted
,
, and
from the registers of the auxiliary states. Thus, after this process, the state will be
if
is the oracle of
, or
if
is the oracle of random function
. Since
is a random function from 64 bits to 32 bits,
can also been seen as a random function mapping 5 bits to 4 bits given input
. Let
denote the random function from 5 bits to 4 bits; then, we have
when
is the oracle of
. The output state of
shown in
Figure 6 is
The quantum oracle has been constructed; then, we present the quantum distinguisher of 5-round MIBS. Given the access to the oracle , the distinguisher works as follows:
- (1)
Construct the oracle
based on
as in
Figure 6;
- (2)
Implement Algorithm 2 using oracle ;
- (3)
If Algorithm 2 returns a linear structure, output ; otherwise, output .
The output indicates that is the oracle of , and output indicates that is the oracle of random function . According to Theorem 2, can correctly distinguish the 5-round MIBS from a random function.
4. Key-Recovery Attack
We first give a 7-round key-recovery attack on MIBS utilizing the distinguisher proposed in
Section 3.2. We consider a chosen plaintext attack, where the oracle of the 7-round MIBS is available. Namely, the oracle
can be queried by an attacker. Through querying
, the attacker can obtain the superposition state of the ciphertexts after 7-round encryption; then, the attacker guesses the relevant bits of the 6th- and 7th-round keys and decrypts the ciphertexts for two rounds to obtain the ciphertexts of
(
). Therefore, for each guessed candidate round key of the 6th and 7th rounds, the attacker can use it to decrypt 2 rounds to obtain oracle
, which is the oracle of
when the guessed key is right, and is the oracle of the random function
when the guessed key is wrong. Using the distinguisher
defined in
Section 3.2 with queries to
can determine whether the guessed round key bits are right. If the round key bits are right,
will output
; otherwise, it will output
.
The key is how to compute
using the least bits of
and
given the ciphertext
. Since
to construct oracle
, we actually only need to compute the 5th nibble of
instead of the entire
. Therefore, we can slightly change the way to generate
so that we do not need the entire
.
can still be constructed from
using the method in
Section 3.2, except that
is no longer the oracle of the entire
, but only the part of
required for computing
. This does not bring any essential differences but can void guessing the unnecessary key bits during key-recovery attack. As shown in
Figure 8, it holds that
Since and are known, according to the definition of , to compute , we only need to guess the 1st, 3rd, 4th, 5th, and 8th nibbles of . Therefore, , are enough for computing the value of or . There are 24 bits needed to be guessed. Considering the key scheduling, there may exist repetitive bits.
Table 3 shows the repetition bits of the subkeys in 7–10 rounds generated as the key scheduling. Suppose the state of the key register in the 6th round of key scheduling is
then,
and
. Here, we omit the Sbox transformation since the determined transformation does not affect the amount of bits that is required to be guessed. According to
Table 3, the 2nd, 3rd, and 4th bits of
are the same as the 1st, 2nd, and 3rd bits of
. Thus, in fact, we only need to guess 21 key bits:
where
denotes the 8th, 5th, 4th, and 3rd nibbles and the 1st bit of the 1st nibble of
.
Given the oracle of
, by decrypting under the relevant keys in the 6th and 7th rounds, it is easy to obtain the oracle of
. Then, we can construct the oracle of
using a similar method in
Section 3.2. The oracle of
can play the role of
in the distinguisher
. Thus,
will output
when
is the correct 21-bit key and output
when
is the wrong 21-bit subkey. Taking
as the oracle
in Grover’s algorithm, it will search for the right key bits:
.
According to [
8], this key-recovery attack needs a total of
qubits, where
is the number of bits of the subkeys to be recovered,
is the input length of the linear structure function
G,
is the output length of
G, and
.
,
,
, and
. Thus, this attack requires 156 qubits. The time complexity is
.
Consider attacking 8-round MIBS using the same distinguisher. By similar derivation, to compute
based on the ciphertext
, we need to guess the subkeys
According to
Table 3,
has 9 repetitive bits, so there are only 44 bits to be recovered. According to Equation (
11), an 8-round key-recovery attack requires 179 qubits. The corresponding time complexity is
.
By similar derivation, a 9-round attack requires 194 qubits, and the time complexity is
. A 10-round attack requires 199 qubits, and the time complexity is
. The authors in [
25] also presented quantum attacks on MIBS. The time complexity of their 7-round, 8-round, and 9-round attacks is
,
, and
, respectively. The complexity of our attacks proposed in this article is lower.
5. Results and Discussion
In this article, we proposed quantum attacks on the MIBS cipher based on the BV algorithm. Specifically, we first fully utilize the characteristics of the linear transformations of the MIBS cipher to construct a linear-structure function. Then, we use the fact that the BV algorithm can quickly determine whether a function has nonzero linear structures to design a 5-round quantum distinguisher for the MIBS cipher, which can effectively distinguish the encryption of the 5-round MIBS cipher from a random function. Subsequently, by analyzing the key scheduling of the MIBS cipher, we find the repeated bits between round keys. Combined with Grover’s algorithm, we realize a 7-round key-recovery attack on MIBS and generalize the attack to more rounds. The quantum attack on 7-round MIBS requires 156 qubits and has a time complexity of . The 8-round attack requires 179 qubits, and the time complexity is . Compared with the existing quantum attacks, our attack has the smallest time complexity. We believe this study contributes to evaluating the safety of the MIBS cipher in the quantum world and helps to further explore the "BV-meet-Grover" attack strategy.
For further research, how to reduce the resource consumption and time complexity of the attacks on the MIBS cipher is worth studying. We can also study the applications of the BV algorithm and other quantum algorithms to key-recovery attacks on various block ciphers. Quantum attacks on other symmetric primitives, such as hash functions and stream ciphers, are also a meaningful direction. For example, we can apply the quantum attack strategies introduced in [
20,
21] to attack other hash functions [
26,
27]. We can also apply quantum algorithms to enhance the classical attacks on stream ciphers that have been proposed [
28,
29] or to attack other cryptographic schemes [
30,
31].