Chaotic S-Box: Intertwining Logistic Map and Bacterial Foraging Optimization

. As the unique nonlinear component of block ciphers, Substitution box (S-box) directly affects the safety of a cryptographic system. It is important and difficult to design strong S-box that simultaneously meets multiple cryptographic criteria such as bijection, nonlinearity, strict avalanche criterion (SAC), bit independence criterion (BIC), differential probability (DP), and linear probability (LP). Though many chaotic S-boxes have been proposed, the cryptographic performance of most of them needs to be further improved. A new chaotic S-box based on the intertwining logistic map and bacterial foraging optimization is designed in this paper. It firstly iterates the intertwining logistic map to construct many S-boxes and then applies a bacterial foraging optimization algorithm tofind theoptimal S-box. Moreover, bacterial foraging optimization algorithm considers thenonlinearity and differential uniformityasthefitnessfunctionsintheoptimizationprocess.WeexperimentthattheproposedS-boxcaneffectivelyresistmultiple typesofcryptanalysisattacks.


Introduction
The dynamic developments in the multimedia industry and the Internet lead to a considerable amount of worry regarding the security of information transmitted over open or stored channels [1][2][3].How to protect information from being unauthorized handled is becoming extremely crucial.Modern cryptography technique, in which block cipher algorithm is an important research direction, is an effective way to guarantee the safety of information, since then many researchers have developed a lot of block cipher algorithms.In a block cipher algorithm, Substitution box (S-box) is the only one nonlinear component [4], providing the block cipher system with necessary confusing and scrambling effect against attacks.Moreover, its cryptography security features directly determine the safety of the entire cipher performance [1].Mathematically, an  ×  size of S-box is a nonlinear mapping S: {0, 1}  → {0, 1}  , where {0, 1}  represents the vector spaces of  elements from GF (2), and we set  = 8 in this paper.
Many papers on S-boxes have been published by scholars around the world over the past decades.In [5], Hussain and Gondal presented a design approach for  ×  S-boxes, which was an exhaustive search method; nevertheless, the performance of this procedure would become rather difficult with the increase of .Liu et al. [4] utilized near-bent Boolean functions of five variables to generate 5 × 5 S-boxes to resist the differential attack; however, their algorithm was useful only to create an S-box of odd input bit number.Therefore, most of these approaches were inefficient and were unable to construct S-boxes that could meet multiple assessment requirements simultaneously.
Chaotic systems that satisfy the major requirements of cryptography properties such as diffusion and confusion are differentiated on the basis of their reactiveness to ergodicity, pseudorandomness, unpredictability, control parameters, and initial conditions; this makes chaotic systems particularly catch heaps of heed for cryptology [1][2][3][4][5].Due to this matter, chaotic S-boxes have proved to be superior for encrypting a message.
For example, literature [6] proposed a four-step method of generating chaotic S-box based on discrete logistic map.It turned out that very simple chaotic maps and discretization procedure generated secure S-boxes.Literature [7] improved the work in [6] using bit extraction and Baker map.Furthermore, literature [8] proposed an S-box design approach based on iteration discrete chaotic that had high immunity to the differential cryptanalysis.Using three-dimensional chaotic Baker map, literature [9] constructed an S-box that approximately fulfilled all the criteria for a cryptographically strong S-box.
However, a simple chaos system also has many defects; for example, the implementation of the chaos on a computer is affected by the limited precision; the time series outputted by the simple chaotic system generally cannot reach the theoretically complete random, resulting in the problem that the pseudorandom sequence appears periodicity [10].
To cope with these problems, many complex chaotic maps based S-boxes have been presented in recent years.For example, literature [11] indicated the pseudorandomness and complexity of binary sequences produced by the Lorenz system and Chebyshev map.Literature [12] designed a new pseudorandom number generator by mixing the couple map lattice technology and the chaos iteration technology.Literature [13] proposed a secure pseudorandom number generator three-mixer.Khan et al. presented a complex chaotic S-box construction method that could provide better security in terms of resistance against various attacks by deploying the 2D Henon chaotic map and skew tent map [14].Ahmad et al. proposed a method for synthesizing cryptographically efficient chaotic S-box, which integrated four 1D chaotic systems, namely, logistic maps and cubic maps, to modulate the normal system trajectories of the other [15].Peng et al. designed a novel approach for dynamically generating Sboxes using a spatiotemporal chaotic system, which mapped the key to system parameters and generated the hyperchaotic sequences to construct S-boxes [16].
By increasing the complexity of the chaotic system, these complex algorithms obtained S-boxes with the higher security level to some extent.Nevertheless, the performance gap between many of these chaotic S-boxes and classic ones still exists; for example, few chaos-based S-boxes can achieve the high performance like the one used in advanced encryption standard (AES) [17].
Compared with other intelligent optimization algorithms, bacterial foraging optimization algorithm (BFO) has a group of intelligence and can carry out parallel search.Besides, it may be easy to jump out of the local minimal solution; thus, it can find solutions of higher quality.Due to these advantages, it has been widely used in some research fields.For example, Abd-Elazim and Ali proposed an optimization algorithm BFOA for controlling the damping of the power system's electromechanical oscillations [18].On the basis of literature [18], Ali and Abd-Elazim proposed a BFOA based Load Frequency Control (LFC) for the suppression of oscillations in power system [19].In addition, Abd-Elazim and Ali developed an optimization algorithm BSO, which synergistically coupled the BFOA with the particle swarm optimization algorithm for the optimal design of the TCSC damping controller.Specifically, they transformed the controller design problem into an optimization problem, and the BSO was developed to find the optimal controller parameters [20].Sur and Shukla also presented a discrete adaptive BFO algorithm, which could be applied to discrete search domains and various multidimensional problems [21].Furthermore, to optimize a power network problem, Tripathy and Mishra proposed an improved BFO algorithm.In this work, the power network problem was formulated as a multiobjective multivariable problem, and the improved BFO was applied to solve this problem [22].
In this paper, a new scheme for designing an S-box is presented.Unlike other chaos-based algorithms that generate strong S-boxes by using the random distribution property of chaotic maps, we divide the process of designing an S-box into two steps.Firstly, we generate many S-boxes by iterating the chaotic map.Secondly, we apply a genetic algorithm, the evaluation function of which adopts the nonlinearity and differential uniformity to improve the performance of the generated S-box.We show via simulation that our scheme can generate stronger S-box.Abbreviations section shows some abbreviations of technical terms involved in this paper.

Preliminary Work
2.1.Intertwining Logistic Map.In this section, we will introduce a chaotic map, the intertwining logistic map [23], which is defined as follows: where ,   are the system parameters with the ranges 0 <  < 3.In the intertwining logistic map system, the sequence distribution becomes more uniform, and, more importantly, empty windows are eliminated.Remarkably, comparing with a simple logistic map, the action of a intertwining logistic chaotic map is more complex, and the sequence distribution of it is more uniform.

Bacterial Foraging Optimization Algorithm.
In 2002, Passino proposed a bacterial foraging optimization algorithm that imitated groups competition coordination mechanism of Escherichia coli (E.coli) in the process of searching for food in the human gut.In looking for the region of food sources, E. coli might determine whether they enter the region through a priori knowledge.Once entering foraging area, if a certain amount of food was consumed or foraging region environment deteriorated, resulting in inhospitable conditions, a bacteria might die or move to another suitable region.Relying on its own unique behaviors, chemotaxis, reproduction, and elimination-dispersal, bacterial foraging algorithm proceeded to update bacteria individual position and searched the optimal locations of bacteria groups, so as to realize the evolution of the population.The main steps of bacterial foraging optimization algorithm can be described as follows [24].
Step 1 (parameters initialization).Ned is the number of elimination-dispersal events; Nre is the number of reproduction steps.Nc is the number chemotaxis steps.Ped is the basic probability of elimination-dispersal.SS is the bacteria scale.Ns is the maximum number of chemotactic steps.
Step 2. Initialize the bacteria locations; calculate the initialization fitness values of bacteria.
Step 4 (perform bacteria chemotaxis loop).Use   (, , ) to express the space location vector of bacteria, where  represents the th generation of chemotaxis loop,  represents the th generation of reproduction loop, and  represents the th generation of elimination-dispersal loop.
where () is the chemotaxis step length of bacterium .(, ) is an normalized random direction vector of bacterium i when tumbling in the th loop.Δ(, ) is arbitrarily generated random direction vector with each element being a random number on [−1, 1].
(2) Move.If the fitness value of tumbling improves, it will not move according to the direction of tumbling until the fitness value no longer improves or reaches the maximum moves steps Ns.
Step 5 (reproduction loop).After completing the chemotaxis loop, accumulate the fitness values of each bacterium during its life cycle to get an energy value.Order bacteria by the energy values; eliminate half bacteria which are poor to obtain energy.Reproduce half bacteria that have strong ability of energy harvesting.
Step 6 (elimination-dispersal loop).After completing the reproduction operator, generate a random probability, and compare it with the fixed elimination-dispersal probability Ped.If the generated probability is lower than Ped, proceed with the bacteria elimination-dispersal, and random initialize in the definition domain of the solution space.
Step 7. Determine the loop end condition; if it meets the condition, end and output the results; otherwise, continue.

Scheme of Generating of an S-Box
3.1.Improved Bacteria Locations Update Equation.Bacteria foraging optimization algorithm was designed to solve the problem of continuous optimization.The map among different S-boxes, however, belongs to a discrete problem; thus we will firstly operate the BFO discretization.To realize it, we introduce a concept of commutator [42] in this paper.
The commutator denoted by  = Swap(, ), ,  ∈ {1, 2, 3, . . ., }, where  represents the number of elements of a food source location, represents the exchange between  and  in a food location.Based on one solution, exchange any two solutions several times to obtain another solution.The difference between these two solutions can be denoted by a swap sequence { 1 ,  2 , . . .,   },where  is the number of commutators.
Next, we should define an operator operation symbol: assume two different solutions  and ; define  −  = { 1 ,  2 , . . .,   }; that is, the difference of  and  determines the exchange sequence; the physical meaning of the operation is that the solution  will be the same as  after operating  different commutators.The definition of the operation  + { 1 ,  2 , . . .,   } can be described as follows: exchange the solution , { 1 ,  2 , . . .,   } times, and connect these two commutators sequences one after another, respectively.For example,   () =

Fitness Function.
In the BFO, fitness function described the quality of a feasible solution which refers to the richness of the food sources and directly relates to the optimization results.When utilizing chaos optimal search method to construct an S-box, since an S-box has more than one Boolean function characteristic, we should construct a weighted equation to weigh the different cryptography characteristics of the S-box.
As the linear and differential analyses are two effective ways of attack analysis, we will consider the nonlinearity and differential uniformity of an S-box when designing a fitness function that can take the following form: where the nonlinearity function is   (  ) =   ; the differential uniformity function is   (  ) =   .Fitness function should satisfy the monodromy and continuity.According to the experimental results, we order (  ,   ) by the performance of the S-box, that is, (108, 6), (108, 8), (106, 6), (106, 8), (108, 10), and (106, 10) in this paper.Moreover, we assign   and   and obtain the fitness function as follows [43]: (4)

The Main
Steps of Generating an S-Box.According to the above description, we can summarize the detailed steps of generating an S-box as follows.
Step 1.Call the parameters initialization of the BFO, set a speed adjustment parameter  and constant , substitute the initial values,  0 ,  0 ,  0 , into (1), iterate  0 times to obtain  1 ,  1 ,  1 , and define an integer array S of length 256.
where ⌊⌋ returns the maximum integer less than or equal to .Step 5. Arrange the integer sequence   in a 2 /2 × 2 /2 table, and construct 3 S-boxes.
Step 7.Call Steps 3-7 of BFO, except that we use (7) to update the bacteria locations in the tumbling stage.

S-Box Evaluation Criteria
To obtain the S-box with desired cryptography properties, many evaluating criteria, such as bijectivity, Nonlinearity, SAC, BIC, DP, and LP, have been designed.We will also use these criteria to test the performance of the proposed S-box in this paper.
In fact, a reversible S-box is usually required; especially in a replacement network, the S-box must be bijective.

Nonlinearity
Definition 1.Let () :   2 →  2 be an  Boolean function; the nonlinearity of () can take the following form: where   is a set of the whole linear and affine functions and   (, ) denotes the Hamming distance between  and .
The nonlinearity denoted by the Walsh spectrum can take the following form: The cyclic spectrum of the function () is where  ∈ GF(2  ) and  ⋅  denotes the dot product of  and .
The larger the nonlinearity   of the function , the stronger the ability of its resistance to the linear attacks, and vice versa.

Strict Avalanche Criterion.
Strict avalanche criterion describes a fact that when one bit in the input of Boolean function changes, the changing probability of every bit in its output is 1/2.In practical application, a correlation matrix, the construction method of which refers to literature [45], is always constructed to test the SAC property of the Boolean function.

Bit Independent Criterion.
Given that a Boolean function   ,   ( ̸ = ) is a two-bit output of an S-box, if   ⊕  is highly nonlinear and meets the SAC, the correlation coefficient of each output bit pair may be close to 0 when one input bit is inversed.Thus, we can check the BIC of the S-box by verifying whether   ⊕   ( ̸ = ) of any two output bits of the S-box meets the nonlinearity and SAC [45].4.5.Differential Approximation Probability.The differential approximation probability DP  can reflect the XOR distribution of the input and output of the Boolean function [6], that is, the maximum likelihood of outputting Δ, when the input is Δ, where  denotes a set of all possible inputs and 2  is the number of elements in the set.The smaller the DP  , the stronger the ability of the S-box for fighting against differential cryptanalysis attacks, and vice versa.
4.6.Linear Approximation Probability.Given two randomly selected masks Γ and Γ, we use Γ to calculate the mask of all possible values of an input  and use Γ to calculate the mask of the output values () of the corresponding S-box.After masking the input and the output values, the maximum number of the same results is called the maximum linear approximation that can be computed by the following [46]: where Γ and Γ are the mask values of the input and output, respectively, and () is a set of all possible input values of , the elements of which are 2  .The smaller the LP, the stronger the ability of the S-box for fighting against linear cryptanalysis attacks, and vice versa.

Bijectivity Analysis.
Use (8) to calculate the value of the objectivity of the S-box.Since the obtained bijectivity value of the proposed S-box is 128 that is the same as the desired value, we may conclude that our S-box satisfies the bijectivity.(10) to calculate the nonlinearity of the S-box; Figure 3 depicts the statistical results of the nonlinearity of comparison algorithms.Table 6 shows the detailed nonlinearity results.From these results, we can see that the minimum nonlinearity value of eight Boolean functions of the proposed S-box is 106, and the average value 107.5 is greater than that of the other comparison algorithms.Thus, our S-box may have good nonlinearity and can resist the linear cryptanalysis. 2 depicts the dependence matrix of our S-box, and the SAC comparison results are shown in the third column of Table 6.From these two tables, we may conclude that our S-box satisfies the SAC.For our S-box, its obtained maximum SAC is 0.6094, the minimum is 0.3750, and its average value 0.5093 is close to the desired value 0.5.Moreover, compared with the algorithm [37] [34] [39]

5.4.
Bit Independent Criterion Analysis.Tables 3 and 4 describe the BIC related criterion results of our S-box.The fourth and fifth columns of Table 6 depict the corresponding comparison results of the experimental results.Additionally, the average BIC-nonlinearity value of the proposed S-box is larger than that of S-box generation algorithms in [7,8,28,31].The average BIC-SAC value of the proposed S-box is larger than that of algorithms in [6-8, 25, 31-33, 37-40].For our S-box, its average nonlinearity of the   ⊕   is 103.07; the average correlation matrix is 0.5025 that is close to the desired value 0.5.Therefore, we may obtain that our S-box has good bit independent criterion.

Differential Approximation Probability Analysis.
Table 5 shows the differential probability result of our S-box calculated by (12), and the left of the right column in  6, from which we argue that our S-box may have a good ability to resist linear cryptanalysis.Besides, Figure 5 depicts the statistical results of the LP of comparison algorithms.These results show that the LP of the proposed S-box is not worse than that of algorithms in [25,26,28,30,32,34,37,38,41].Furthermore, Table 6 summarizes the above-mentioned evaluating criteria results of the experimental algorithms.From the table, we may make the following observations: (1) these chaotic based S-boxes have good cryptographic properties.(2) Comprehensively, our S-box, however, may have better encryption performance and can resist many modern cryptanalysis attacks to some extent.

Conclusion
This paper is concerned with developing a novel S-box generation algorithm, chaotic S-box based on the intertwining logistic map and bacterial foraging optimization.This algorithm firstly generates a set of intermediate S-boxes by iterating the chaotic map and then utilizes a bacterial foraging optimization algorithm to search for an S-box with good performance.During the search process, the nonlinearity and differential uniformity are involved to design the evaluation function.Experimental results investigate that the proposed S-box generation algorithm may generate an S-box with good cryptography characteristics.Since there are many other factors that affect the performance of S-boxes, for example, SAC, BIC, and LP, the investigation of applying them to design the evaluation function of the bacterial foraging optimization algorithm may be worth studying in the near future.[32] Proposed

Figure 2 (
b) depicts the chaotic attractor diagram of the logistic map.

Figure 1 :Figure 2 :
Figure 1: Bifurcation diagrams comparisons of the logistic map and intertwining logistic map.

Figure 3 :
Figure 3: Statistical results of the nonlinearity.

Figure 5 :
Figure 5: Statistical results of the LP.
, has appeared in the array   , discard it; otherwise, save it in   until the array is filled.So are   and   .Similarly, iterate  0 2, record from ( 0 2 + 1)th value, and obtain   ,   , and   .
}  = {      }  = {      } .(6)Step 4. Iterate  0 and record starting from ( 0 + 1)th value; if   has appeared in array   , discard it; otherwise, save it in   .And the   box is obtained when the array is filled.So are   and   .Iterate  0  and record from the ( 0  + 1)th value; if

Table 1 :
The generated S-box.

Table 2 :
The dependence matrix of the generated S-box.

Table 5 :
Differential approach table for the generated S-box.