Paper

Efficient image encryption algorithm based on dynamic high-performance S-box and hyperchaotic system

, , and

Published 17 May 2023 © 2023 IOP Publishing Ltd
, , Citation Yuyue Su et al 2023 Phys. Scr. 98 065215DOI 10.1088/1402-4896/acd1c3

1402-4896/98/6/065215

Abstract

With the development of information technology, security, low latency, and instant messaging have become a major demand. To solve this problem, this paper designs a secure and efficient image cipher algorithm. Firstly, a new four-dimensional hyperchaotic system with strong chaotic performance is proposed. Secondly, a dynamic high-performance S-box generation algorithm is proposed based on GF(28) by improving the method of generating S-boxes in AES, selecting suitable irreducible polynomial as well as affine matrix, precomputing the corresponding affine multiplication matrix as well as multiplication inverse matrix. The S-box algebraic expressions generated by this algorithm have 255 terms and are more resistant to algebraic attacks than AES. Finally, based on the four-dimensional hyperchaotic system and dynamic high-performance S-box generation algorithm, the new image cipher algorithm that can encrypt and decrypt images of arbitrary size is proposed. The image cipher algorithm consists of two rounds of interleaved permutation, two rounds of dynamic S-box substitution and cyclic shift permutation with fixed point. Cyclic shift permutation with fixed point and dynamic S-box substitution ensure that the plaintext transformation can be transferred to the entire image. Through testing, analysis and comparison, the algorithm has proven to be a secure and efficient image cipher algorithm.

Export citation and abstractBibTeXRIS

1. Introduction

With the popularity of the network and the development of science and technology, how to ensure the confidentiality and security of data in the transmission process is always a matter of commitment. The increasing performance of computers has led to the development not only of cryptography but also of cryptanalysis. Traditional block cipher algorithms, such as Data Encryption Standard(DES) [1], Advanced Encryption Standard(AES) [2] and International Data Encryption Algorithm(IDEA) [3], can encrypt and decrypt text data, but they cannot solve the problems of strong correlation between adjacent pixels, data redundancy and energy distribution in image data. Since chaos has the characteristics of improving the security of cipher algorithms, including initial value sensitivity, randomness and uniqueness, more and more cryptographic algorithms use chaotic systems to improve their security. As the only nonlinear component in many cryptographic algorithms, S-box plays a key role in avoiding ciphertext from linear approximation attacks and algebraic attacks.

Common chaotic systems can be roughly divided into low-dimensional chaotic systems and hyperchaotic systems. Compared with low-dimensional chaotic systems, hyperchaotic systems have more complex dynamic characteristics and more control parameters. The hyperchaotic system need to satisfy the condition of having no less than two nonlinear functions, which is equivalent to having at least two positive Lyapunov exponents. Based on Lorenz system [4], Chen system [5], Lü system [6] and Rossler system, many new hyperchaotic systems have been proposed in recent years. Zhou et al [7] construct a new four-dimensional smooth quadratic autonomous hyperchaotic system by adding state variables to the Lorenz system. Zhang et al [8] construct a four-dimensional non-equilibrium hyperchaotic system by adding two new non-linear functions to the modified Sprott B system. He et al [9] design the fractional symbolic network entropy measure algorithm to analyze the complexity of fractional order chaotic system. In addition, there are 3D hyperchaotic map [10], 5D hyperchaotic systems [11], 6D hyperchaotic systems [12] and 7D hyperchaotic systems [13].

The S-box is essentially a substitution table of non-repeating integers of [0,2n ). When the value of n is 8, there are a total of 10506 possible S-boxes and these S-boxes have different security strengths, so high-performance S-boxes need to be obtained in finite time by algebraic methods [14, 15], random construction methods [1619] or hybrid construction methods [2022]. In general, the performance of the S-boxes obtained by random construction is not as high as that of the S-boxes generated by algebraic methods. The most typical S-box generation by algebraic methods is the AES S-box, where the inverse element and affine transformation are solved under GF(28) to generate the S-box with nonlinearity 112. Although the maximum algebraic degree of AES S-box can reach 255, the algebraic expression has only nine terms, which makes it vulnerable to algebraic attacks. Liu et al [23] increased the number of algebraic expression terms to 255 by improving the generation method of AES S-boxes. Massey et al [24] implemented the substitution operation in the SAFER cryptographic algorithm by means of a logarithmic function and an exponential function. In the case of GF(28), the linear fractional transform (LFT) is also applied to generate the S-box [25, 26] and a S-box with differential uniformity of 4 and nonlinearity of 112 can be got. Al-Obeidi et al [13] constructed S-boxes by using the cubic fractional transform (CFT), which can generate S-boxes with differential uniformity of 10 and nonlinearity of 107. S-boxes can be classified as dynamic S-boxes and static S-boxes based on whether they change in cryptographic algorithm. Well-known algorithms that use static S-boxes including AES, Present, Camellia, and SMS4, among which S-boxes all have outstanding performance. Su et al [27] obtained S-boxes with average nonlinearity of 113 and difference uniformity of 8 by a three-layer S-box optimization method. In general, the performance of dynamic S-boxes is not as good as that of static S-boxes in order to save overhead. RC4 implements a dynamic S-box by swapping the values of two positions in the S-box at each encryption, but it can not guarantee that a high-performance S-box is obtained every time. Algorithms such as Khufu and Twofish use dynamic S-boxes associated with keys. Ibrahim et al [28] generated dynamic S-boxes with average nonlinearity of 107.5by key alignment on a finite elliptic curve. Obviously, if the performance of static and dynamic S-boxes is approximately the same, the security strength of the algorithm using dynamic S-boxes is higher. How to dynamically construct high-performance S-box based on algebraic methods becomes a problem.

Many image cipher algorithms are able to improve greatly in terms of security performance over previous cipher algorithms, but are costly, time-consuming, and not efficient to use for application in daily life, such as DNA-based image encryption algorithms [29, 30]. There are also image cipher algorithms that have specific requirements for the size of the image and require additional delivering of hash values. Wang et al [31] obtain a visually meaningful ciphertext by using quantum 16*16 S-box to displace the images, using the probability matrix to diffuse the images, but this algorithm requires delivering two phase masks of the same size as the ciphertext during the decryption process. Lin et al [32] proposed an image encryption algorithm based on Latin squares and cellular neural networks. This encryption algorithm is only applicable to square grayscale images and does not take the relationship between the RGB three layers into account. Teng et al [33] and Liu et al [34] improve image resistance to differential attacks as well as key sensitivity by computing 512-bit hashes of plaintext image, but additional hashes need to be passed in each encryption and decryption process. Xu et al [35] use RSA to encrypt and decrypt keys, and embed the key cipher image and cipher image into the carrier image, but asymmetric cryptography take longer time. So how to design a secure and efficient image cipher algorithm that can encrypt image of any size and consider RGB triple correlation is a problem.

In this paper, we first propose a new hyperchaotic system with more complex dynamical properties than the conventional chaotic system. Then a new algorithm for dynamically generating high-performance S-boxes is designed based on the multiplication and addition on GF(28). Finally, an efficient image cipher algorithm suitable for image of any size is designed. The main contributions of this paper are as follows:

  • A new four-dimensional hyperchaotic system is proposed. By adding nonlinear feedback terms and dimensions to the Lű chaotic system, a hyperchaotic system with more complex dynamic properties is constructed.
  • A new algorithm for generating dynamic high-performance S-boxes is proposed. By improving the method for generating S-boxes in AES, selecting the relatively optimal irreducible polynomial as well as affine matrix, calculating affine multiplication as well as multiplication inverse matrices in advance, the proposed algorithm is constructed. The algebraic expression of the S-box generated by the algorithm reaches 255 terms, with an algebraic degree of up to 254.
  • A new secure and efficient image cipher algorithm is proposed. Based on the new hyperchaotic system and dynamic S-box, the proposed image cipher algorithm is designed by using cyclic shift permutation with fixed point, dynamic S-box substitution and interleaved permutation, which can encrypt images of any size and take the correlation of RGB triplet pixels into account. Dynamic S-box substitution does not require the calculation of inverse S-box, saving the storage space for inverse affine multiplication matrix. The setting of cyclic shift permutation with fixed point and dynamic S-box substitution also ensures that the plaintext image transformation can be transferred to the entire image.

The remainder of this paper is organized as follows: section 2 describes the construction of a new four-dimensional hyperchaotic system. Section 3 introduces a new method for dynamically generating high-performance S-box. In the section 4, a new secure and efficient cipher algorithm is designed. Finally, a brief summary about the work in this paper and future work direction are given in the section 5.

2. A new four-dimensional hyperchaotic system

2.1. Construction of new hyperchaotic system

2.1.1. Lű chaotic system

Lű chaotic system is a three-dimensional chaotic system proposed based on Lorenz system and Chen system, as shown in equation (1). When (m, n, h) = (36,3,20), the system is in chaotic state.

Equation (1)

2.1.2. The new hyperchaotic system

A new hyperchaotic system is constructed by adding dimensions and nonlinear feedback terms to the Lű chaotic system, as shown in equation (2).

Equation (2)

where m, n, h, p, q, k are the control parameters and x, y, z, w are the system variables. When (m, n, h, p, q, k) = (36, 3, 20, 0.6, 2, 2), the system is a hyperchaotic system and has chaotic properties.

2.2. Performance analysis of hyperchaotic systems

2.2.1. Lyapunov exponent

The Lyapunov exponent (LE) is a value that theoretically quantifies how fast the orbits diverge or contract in phase space. To ensure the unpredictability of the system, the more divergent the orbits are, the better, which means that the larger value of the Lyapunov exponent the more chaotic the system is. As shown in figure 1, the LE values of the Lű system with (m, n, h)=(36,3,20) and the new four-dimensional hyperchaotic system with (m, n, h, p, q, k)=(36,3,20,0.6,2,2) are plotted against time.

Figure 1. Refer to the following caption and surrounding text.

Figure 1. Lyapunov exponent.

Standard image High-resolution image

The three LE values of the Lű system are LE1 = 1.336, LE2 = 0, and LE3=−20.338. The four LE values of the new four-dimensional hyperchaotic system are LE1 = 5.468, LE2 = 0.008, LE3 = 0, and LE4=−26.189. The maximum LE value of the Lű system is smaller than that of the new four-dimensional hyperchaotic system, which means that the dynamical property of the new four-dimensional hyperchaotic system are more complicated.

2.2.2. Poincaré section

Poincaré section is a two-dimensional graph obtained by intercepting the continuous trajectory using section. The morphology of the trajectory motion can be determined from the trajectories on the Poincaré section. If there are a large number of dense points that aggregate into fractal structure on the Poincaré section, the system is chaotic. The Poincaré section of the new four-dimensional chaotic system is shown in figure 2.

Figure 2. Refer to the following caption and surrounding text.

Figure 2. Poincare surface of section.

Standard image High-resolution image

From figure 2, it can be observed that the four-dimensional hyperchaotic system has a large number of dense points that aggregate into fractal structure on the section. So the new system proposed in this paper is chaotic.

2.2.3. Dissipativity

Chaotic systems include dissipative systems and conservative systems, where unique attractors exist in dissipative systems and do not exist in conservative systems. The total energy of the dissipative system changes as time changes. Equations (3) and (4) is used to judge whether the system is dissipative. When the volume element ${\rm{\nabla }}\cdot f\lt 0,$ the system is a dissipative chaotic system. When the volume element ${\rm{\nabla }}\cdot f=0,$ the system is a conservative chaotic system.

Equation (3)

Equation (4)

The volume element of the new hyperchaotic system is calculated to be ${\rm{\nabla }}\cdot f=-m-n-k$ = $-36+20-3-2$ = $-21\lt 0,$ which means that there are unique attractors in the new hyperchaotic system and the phase space volume tends to 0 at the rate of ${e}^{-21t}.$ This new hyperchaotic system is a dissipative system with unique attractors.

2.2.4. Fractal dimension

The fractal dimension is the infinite multilayer self-similar shape of the unique attractor in the chaotic system. According to the Kaplan York conjecture, the calculation method for fractal dimension is shown in equation (5).

Equation (5)

where j is the maximum value that satisfies $\displaystyle {\sum }_{i=1}^{j}L{E}_{i}\gt 0.$

The fractional dimension of the new hyperchaotic system is calculated to be a fraction of $FD=3+\displaystyle \frac{5.468+0.008+0}{| -26.189| }=3.209$ and $3\lt FD\lt 4.$ Therefore, the new system is a four-dimensional hyperchaotic system with unique attractors.

2.2.5. Unique attractor

Since this hyperchaotic system is a dissipative system, there will be infinite self-similar structures in the phase space and the volume of the phase space will keep decreasing and eventually converge to a set, which is the unique attractor. For four-dimensional hyperchaotic system, the phenomenon can be macroscopically observed in three dimensions as well as in two-dimensional phase space.

The projection of the attractor of the new four-dimensional hyperchaotic system on the plane is shown in figure 3.

Figure 3. Refer to the following caption and surrounding text.

Figure 3. Projection of the attractor of the chaotic system on the plane.

Standard image High-resolution image

2.2.6. Equilibrium point

When the equilibrium point has a positive eigenvalue, it is called an unstable equilibrium point. The new hyperchaotic system equations were solved according to equation (6), and four sets of solutions were obtained: (−7.6483, −6.0, 15.9436, −1.9411), (0, 0, 0, 0), (−20, −45.0, 0, 900), and (0.4483, −6.0, −35.5800, 104.0502). By using Jacobi matrix, the eigenvalues of the fourth set of solutions are (26.2549, 2.1732, −4.7459, −44.6822). There are positive and negative real numbers in the eigenvalues, so this hyperchaotic system has unstable saddle point.

Equation (6)

2.2.7. Initial value sensitivity

Initial value sensitivity refers to the fact that even if the initial value changes very slightly, the results obtained over time can be completely different.

As shown in figure 4, the four variables x, y, z, w all appear to have different chaotic trajectories at t<10 after adding 1014. This new hyperchaotic system possesses initial value sensitivity.

Figure 4. Refer to the following caption and surrounding text.

Figure 4. Initial value sensitivity.

Standard image High-resolution image

2.2.8. Pseudo-randomness

In order to apply the pseudo-random sequence generated by the chaotic system to the encryption process, it is necessary to discretize pseudo-random sequence. We use SP800-22 to test whether discretized sequence is a random sequence. The discretization equation is shown in equation (7).

Equation (7)

Take 100 sets of 1,000,000 bits of the discretized pseudo-random sequences generated by the new hyperchaotic system for testing. From table 1, we can see that the 15 tests are successfully passed.

Table 1. SP800 test result.

 Statistical testP-ValuePass rateResults
1The Frequency Test0.3838270.9900Pass
2Frequency Test within a Block0.7197470.9800Pass
3The Runs Test0.1025261.0000Pass
4Tests for the Longest-Run-of-Ones in a Block0.8513831.0000Pass
5The Binary Matrix Rank Test0.4011991.0000Pass
6The Discrete Fourier Transform (Spectral) Test0.6371190.9900Pass
7The Non-overlapping Template Matching Test0.9914681.0000Pass
8The Overlapping Template Matching Test0.9558350.9900Pass
9Maurer's 'universal Statistical' Test0.9114131.0000Pass
10The Linear Complexity Test0.1153871.0000Pass
11The Serial Test0.0269481.0000Pass
12The Approximate Entropy Test0.8676920.9900Pass
13The Cumulative Sums Test0.4943920.9900Pass
14The Random Excursions Test0.6197721.0000Pass
15The Random Excursions Variant Test0.6544670.9855Pass

In summary, the newly proposed four-dimensional system is a hyperchaotic system with complex dynamics, unique attractors, unstable equilibrium points, initial value sensitivity and the ability to generate pseudo-random sequences, which is suitable for application in image encryption and decryption.

3. Dynamic high-Performance S-Box

3.1. Construction of dynamic high-performance S-box

3.1.1. Design of high-performance S-box

Let S(x) denote the value in the S-box and x denote the position. As shown in figure 5, a new general structure is designed to generate a high-performance S-box. The expression that generates the high-performance S-box is shown in equation (8), where $b\ne c,$ $b\in {{\mathbb{Z}}}_{256},$ $c\in {{\mathbb{Z}}}_{256}.$

Equation (8)

Figure 5. Refer to the following caption and surrounding text.

Figure 5. S-box structure.

Standard image High-resolution image

3.1.2. Selection of irreducible polynomial and affine matrix in general structure

The expression of an eighth irreducible binary polynomial is {${d}_{8}{x}^{8}+{d}_{7}{x}^{7}+{d}_{6}{x}^{6}$ + ${d}_{5}{x}^{5}+{d}_{4}{x}^{4}+{d}_{3}{x}^{3}$ + ${d}_{2}{x}^{2}+{d}_{1}{x}^{1}+1$}, where ${d}_{i}\in \{0,1\}.$ There are 30 eighth irreducible binary polynomials. The maximum nonlinearity of the 30 irreducible binary polynomials is 112 [35], and the corresponding irreducible binary polynomials are 'x8+x4+x3+x+1', 'x8+x6+x5+x+1', and 'x8+x7+x6+x5+x4+x+1', as shown in table 2.

Table 2. Irreducible polynomial.

Irreducible polynomial d8 d7 d6 d5 d4 d3 d2 d1 Decimal valueNonlinearity
x8+x4+x3+x+1100011011283112
x8+x6+x5+x+1101100011355112
x8+x7+x6+x5+x4+x+1111110011499112

The expression of the affine transformation defined on GF(2) is y = Ax+b, where A is the 8 $\times $ 8 invertible matrix and b is a constant of 8 bits. A1, A2 and A3 are relatively good affine matrices [36, 37], and their corresponding affine transformations are equations (9)–(11), respectively. Assuming that A is taken as A1 and b is taken as 45, the corresponding affine transformations are equation (12).

Equation (9)

Equation (10)

Equation (11)

Equation (12)

To generate S-boxes with better performance, the irreducible binary polynomials (283, 355, 499) and affine matrices (A1, A2, A3) are combined and applied to equation (8), respectively. Under different combinations of irreducible polynomials and affine matrices, 1000 S-boxes are generated by taking $b\in {{\mathbb{Z}}}_{100},$ $c\in \{c| 101\leqslant c\leqslant 110,c\in {\mathbb{Z}}\}$ and the average value of S-box performance is calculated. As shown in table 3, there are nine combinations.

Table 3. The performance comparison of S-box with different Irreducible polynomial and affine matrix.

  NL  SAC BIC_SAC
Irreducible polynomialAi Min.Avg.Max.LPDU_OffsetBIC_NL_Offset
x8+x4+x3+x+1(283)A1 1121121120.062540.0271120.0093
x8+x6+x5+x+1(355)A1 1121121120.062540.02691120.0088
x8+x7+x6+x5+x4+x+1(499)A1 112 112 112 0.0625 4 0.0268 112 0.0086
x8+x4+x3+x+1(283)A2 1121121120.062540.02681120.009
x8+x6+x5+x+1(355)A2 1121121120.062540.02711120.0091
x8+x7+x6+x5+x4+x+1(499)A2 1121121120.062540.0271120.0094
x8+x4+x3+x+1(283)A3 99100.91020.12092560.04311010.0152
x8+x6+x5+x+1(355)A3 99100.81030.12092560.04381010.0156
x8+x7+x6+x5+x4+x+1(499)A3 991011030.12092560.04321010.0154

According to the comparison results in table 3, the irreducible binary polynomial is chosen as x8+x7+x6+x5+x4+x+1 (499), and the affine matrix is chosen as A1.

3.1.3. Design of dynamic S-box

By changing the values of the constants $b,c\in {{\mathbb{Z}}}_{256},$ different high-performance S-boxes can be generated. Generating S-boxes mainly consists of three operations on GF(28): affine multiplication Ax, multiplication inverse, and multiplication operations. Because A is fixed A1 and $x\in {{\mathbb{Z}}}_{256},$ affine multiplication has 256 items of data. The multiplication inverse on GF(28) also has 256 items of data. The multiplication operation can be simplified as a combination of time operations, then the results of multiplying $x\in {{\mathbb{Z}}}_{256}$ and $x\in \{1,2,4,8,16,32,64,128\}$ contains 2048 items of data. As shown in table 4, the average time taken for the 256 times direct calculation and for the 256 times calculations with the help of the precomputing data is obtained by repeating 100 times.

Table 4. The time comparison of calculating directly and calculating by data.

 Affine multiplicationMultiplication inverseMultiplication
The time of calculating directly(ms)27.78841454.91661.6083
The time of calculating by data(ms)0.00210.00580.2760

It can be observed from table 4 that multiplication inverse saves the most time, followed by affine multiplication and finally multiplication operation. Considering the balance between speed and memory, the data of affine multiplication and the data of multiplication inverse are selected to save, corresponding to tables 5 and 6, so that S-boxes can be generated dynamically.

Table 5. Affine multiplication T1.

 0123456789ABCDEF
00131713214141913828159271521814521150
15618763188541814917836167351604216945174
211224311924412625312125010823910723298225101230
37220379204701976519484215832089021793222
422499231100238109233106252127251120242113245118
52169122392214852098219671195642027320578
61441915120158291532614015139813011336
71684317544166371613418055179481865718962
81936619869207762007522194218892118021287
924912225412524711624011522910222697235104236111
A1775018253191601845917346170411633216439
B13710142131354128314922146171552415631
C3316238165471724017161190581855117652183
D25154301572314816147513421291113612143
E8121086213952208821977206742016719268199
F10523411023710322896227117246114241123248124255

Table 6. Multiplication inverse T2.

 0123456789ABCDEF
00124917413320387220187229156136210239110232
116488139130781906824410521914224255120116161
2822064425418820065403964957334255122144
3205162148153711261212822625360935892169106
441381031802224512752944310025021715420191
5234983220721411922161716513411561597242
6159167812357425118166218246316819720814233
71131121359130160215852954461451731505370
823714719138202490114111571311819822226243
9471232361295015212517214951772161013716696
A1173149204168915897107621941781511243248
B241246171195671021922252312132288362012179
C182224170179209108140223371891325163483383
D10919612238230185841181557610425786141199
E19318356252186921218415111809914612821113
F247176271432369177240175275101227573545

3.1.4. Dynamic high-performance S-box overall algorithm

A flow chart for dynamically generating high-performance S-box is shown in figure 6. The specific steps are shown as follows.

Figure 6. Refer to the following caption and surrounding text.

Figure 6. S-box generation flow chart.

Standard image High-resolution image

Step 1: Parameter input. Enter the values of parameters b, c, where $b\ne c,$ $b,c\in {{\mathbb{Z}}}_{256}.$

Step 2: Initialize the S-box. Initialize the S-box in the order of {0,1,2,...,255}.

Step 3: Affine multiplication. The result of multiplying the element x with the affine matrix A1 is found in table 5, then the number B at position x of table 5 is the result of affine multiplication.

Step 4: XOR. M is the result of B xor parameter b. E is the result of B xor parameter c.

Step 5: Multiplication inverse. Calculate multiplication inverse D of M according to table 6.

Step 6: Multiply. The final result S(x) is obtained by multiplying E with D under GF(28), and the irreducible polynomial is selected to be x8+x7+x6+x5+x4+x+1.

Step 7: Determine if all x have been processed. if not, turn to Step 3. Otherwise, Sbox is obtained.

When b = 5 and c = 22, the resulting S-box Sbox1 is shown in table 7.

Table 7. S-box Sbox1.

 0123456789ABCDEF
09715024120819017241791624417173541453153
125215799801101051461706216424816322915613182
28313195144246178148179904024338205464174
391103210872202501682381842132002720212020973
41382074742171177195503913465143122483133
566115612757211107185231242372913243196
61251671091761512119164344912488123121126161
7137227234235241419423616169204175109192239
8282511652551062171831427210418111210036128116
914012919351119318011822320885581512786
A222222491124518971216519622682238435160
B166332286124718778114901352557197130212
C68141136220169155521591533256214244117254
D2061589218613924098154115221911410825323019
E101554589766326225218941131021887430237
F1471982032245923321567781991191872326022170

3.2. Performance analysis of S-box

We analyze the performance of S-boxes by nine metrics, including bijectivity, fixed point , iteration period, algebraic expression, nonlinearity, etc.

3.2.1. Bijectivity

Bijectivity means that the S(x) obtained for any x is unique, and similarly for any one S(x) the obtained x is unique. We can know from table 7 that the 256 values in Sbox1 are non-repeating integer arrangements in the range [0,255], and the S-boxes all satisfy the bijection property.

3.2.2. Fixed point

If S(x)=x, then position x is a fixed point of the S-box. Fixed points can cause threat to the security of the algorithm, so the existence of fixed points should be reduced. From table 7, we can get that there is no fixed point in Sbox1.

3.2.3. Iteration period

For all elements in S(x), if satisfied ${S}^{n}(x)=x,$ n is the iteration period of x. The maximum value of n is 256, the minimum value of n is 1. The smallest positive integer n is taken as the iteration period of the S(x). The formula for calculating the iteration period of S(x) is shown in equation (13).

Equation (13)

After calculation, the iteration period of all elements in Sbox1 is 256. Therefore, S-box have long iteration periods.

3.2.4. Algebraic expression

The insertion attack is effective against block ciphers with few algebraic expression terms and low algebraic degree. In order to prevent insertion attacks, the algebraic expression of the S-box should be made to have the highest algebraic degree as well as the highest number of terms. We use the algebraic representation of the elemental components [38] to calculate the algebraic expression of the S-box.

When irreducible polynomial is x8+x7+x6+x5+x4+x+1:

After calculation, we can get $Ax=6x+36{x}^{2}+238{x}^{4}+23{x}^{8}+94{x}^{16}+229{x}^{32}+82{x}^{64}+177{x}^{128}$

So when b = 5, c = 22,

The algebraic expression of Sbox1 has 255 terms and the maximum degree of this is 254, reaching the maximum number of terms and the maximum degree. Sbox1 algebraic expression coefficient matrix is shown in table 8.

Table 8. The algebraic expression coefficient of Sbox1.

 0123456789ABCDEF
0964323111854662251951107123770103961447
1159174100188201256129131271607967232216
2155531497323724185133551576248253187216225
31802358218144118715624216020110918615104137
4531822018812715412613284783910642806247
512114923314218312325166815410637327240122
6671755670149111125414025236421080149203
76517014416915322823549106158351122354173166
81301052414319717569416830179491401163933
9842432449223952482345199155262237016160
A722012521855010423121195501951610217924019
B8230247812750111180254106232100222311960
C106203725087786220092114218515212444247
D5923921215843802292372118514615111307255
E15137106292132291631402351184693911183159
F190141631636411091629173128249156167410

3.2.5. Linear attacks

Linear attacks are one of the common attacks. This paper measures the ability of S-box to resist linear attacks by nonlinearity(NL) and Linear approximation probability(LP).

After calculation, the eight nonlinearities of both Sbox1 and the average of 1000 dynamic S-boxes are 112,112,112,112,112,112,112,112. The LP of both Sbox1 and the average of 1000 dynamic S-boxes is 0.0625, which means that the dynamic S-boxes generated in this paper has strong resistance to linear attacks.

3.2.6. Differential uniformity(DU)

Differential attack is used to break the cipher algorithm by analyzing the effect of the difference of the plaintext pair on the difference of the ciphertext pair. The differential uniformity is calculated as in equation (14).

Equation (14)

where ${\rm{\Delta }}x$ and ${\rm{\Delta }}y$ represent the input differential value and the output differential value, respectively. The smaller the differential uniformity, the better the S-box performance.

After calculation, the differential uniformity of both Sbox1 and the average of 1000 dynamic S-boxes is 4, which means that the dynamic S-boxes has strong resistance to differential attacks.

3.2.7. Strict avalanche criterion (SAC)

The strict avalanche criterion means that any input bit changes with a change probability of 0.5 for each output bit. The SAC correlation matrix is calculated as in equation (15).

Equation (15)

where ${e}_{t}=1\lt \,\lt t,\,t\in {{\mathbb{Z}}}_{m}.$ Let offset denote the average distances between all values in the SAC correlation matrix and 0.5. The smaller the offset is, the better of S-box performance is.

The SAC correlation matrix for Sbox1 is shown in table 9. The offset of Sbox1 is 0.0291. The offset average of 1000 dynamic S-boxes is 0.0268. Therefore, the S-boxes generated by the dynamic high-performance S-box generation algorithm satisfy the strict avalanche criterion.

Table 9. SAC correlation matrix of Sbox1.

 01234567
00.51560.54690.45310.45310.51560.43750.48440.5313
10.45310.46880.43750.48440.45310.46880.50000.4531
20.53130.43750.48440.48440.50000.56250.46880.4531
30.54690.48440.48440.50000.50000.43750.46880.5313
40.48440.48440.50000.48440.51560.51560.43750.5469
50.53130.50000.48440.51560.53130.48440.48440.4844
60.45310.48440.51560.50000.56250.53130.48440.5313
70.54690.46880.53130.46880.51560.56250.53130.4688

3.2.8. Bits independence criterion (BIC)

The bits independence criterion of S-box is measured by the nonlinearity BIC_NL and strict avalanche criterion BIC_SAC of ${f}_{i}\left(x\right)\oplus {f}_{j}\left(x\right)$ $\left(0\leqslant i,j\lt m\right),$ where ${f}_{i}\left(x\right)$ and ${f}_{j}\left(x\right)$ belong to two different output bits of S(x). BIC_NL and BIC_SAC are calculated in a similar way as NL and SAC.

After calculation, the BIC_NL of both Sbox1 and the average of 1000 dynamic S-boxes is 112. The BIC_SAC of both Sbox1 and the average of 1000 dynamic S-boxes is 0.0105 and 0.0086. It means that the S-boxes generated by the dynamic high-performance S-box generation algorithm has good bits independence criterion.

3.2.9. Comparison of S-box performance

From table 10, it can be observed that the performance of Sbox1 and 1000 S-boxes generated by the dynamic S-box generation algorithm proposed in this paper is superior to that of other literature S-boxes.

Table 10. S-box performance comparison.

  NonlinearitySAC    
S-boxMin.Avg.Max.Min.Max.offsetLPDUBIC_ NLBIC_ SAC_offset
Static S-boxRef. [39]106107.001080.42190.57810.03540.156310103.500.0114
 Ref. [21]110110.251120.42190.57810.02320.125010104.070.0114
 Ref. [22]112112.001120.43750.57810.02760.109410104.790.0127
 Ref. [40]104106.251100.42190.59380.03810.140610103.360.0140
 Ref. [41]104107.001100.42190.59380.03100.132810103.290.0130
Dynamic S-boxRef. [42]98103.751060.39060.59380.03520.125012103.860.0112
 Ref. [43]99103.881080.39840.61720.03320.121110103.890.0126
 Ref. [44]102104.001080.39060.56250.03000.132810103.000.0112
 Ref. [17]104105.501080.37500.62500.03640.125010103.790.0141
 Ref. [45]100104.001060.39060.57810.03250.125012103.210.0113
  Sbox 1 112 112.00 112 0.4375 0.5625 0.0291 0.0625 4 112.00 0.0105
  S-box Average 112 112.00 112 0.4803 0.5234 0.0268 0.0625 4 112.00 0.0086

4. Image cipher algorithm based on dynamic S-box and hyperchaotic system

We design an efficient and secure image cipher algorithm by hyperchaotic system and dynamic high-performance S-boxes. m represents the length of image and n represents the width of image. per represents the number of iterations, layer represents the selected layer number, mnum represents the selected row number, and nnum represents the selected column number. The above variables are initialized to 1. These definitions apply to all content in section 4.

4.1. Key generation

The initial values x0, y0, z0, w0 of chaotic equation are generated according to 192bit initial key Key inputted by user, including CKey1, CKey2, CKey3, CKey4.

4.1.1. Generation of initial values for the hyperchaotic equation

CKey1, CKey2, CKey3 and CKey4 are all 48bit. The four initial values x0, y0, z0, w0 of the hyperchaotic system are obtained by processing CKeyi according to equation (16).

Equation (16)

4.1.2. Dynamic S-box generation

First, input the initial values x0, y0, z0, w0 to the hyperchaotic system and eliminate the first 5000 pseudo-random sequences, then generate bi , ci , $i\in \left\{1,2,3\right\}$ according to equation (7). Judge whether bi is equal to ci . If so, xor ci with 1. Then loop input bi , ci to generate high-performance S-box. The pseudo code is shown in Algorithm 1.

Algorithm 1. Generate S-box algorithm.

Input: bi , ci , $i\in \left\{1,2,3\right\}$
Output:S-boxes S1, S2, S3
1: for i = 1:3 do
2: if bi = ci then
3: ${c}_{i}\leftarrow {c}_{i}\oplus 1$
4: end if
5: for x= 0:255 do
6: if Ax + b = 0 then
7: ${S}_{i}\left(x\right)\leftarrow 1$
8: else
9: ${S}_{i}\left(x\right)\leftarrow {\left(Ax+b\right)}^{-1}\left(Ax+c\right)$
10: end if
11: end for
12: end for

4.2. Interleaved permutation

In order to improve the rate of permutation and the security of cipher algorithm, interleaved permutation is proposed. According to the sequence zkeylayer , zmsortlayer , znsortlayer , layer = {1,2,3} generated by the hyperchaotic system, the whole rows and columns in one layer are randomly permuted into the other two layers. The specific steps are as follows.

Step 1: Initialization. By using hyperchaotic system, generate the discretization sequence zkey of length 3*(m+n); obtain the index sequence zmsort, znsort of length 3m, 3n.

Step 2: Layers calculation. Get the value of temp according to mod(zkeylayer, 2). Then, according to table 11, get the value of zlayer.

Table 11. Correspondence between layers.

layer temp zlayer
102
113
201
213
301
312

Step 3: Row and column permutation selection. The value of tnum is calculated according to mod(per−1,2). If tnum = 0 and mnum $\leqslant $ m, or nnum > n, then go to Step 4; Otherwise go to Step 5.

Step 4: Row interleaving permutation. Swap the row that layer number is layer, row number is mnum with the row that layer number is zlayer, row number is zmsortlayer (mnum). Turn to Step 6.

Step 5: Column interleaving permutation. Swap the column that layer number is layer, column number is nnum with the column that layer number is zlayer and column number is znsortlayer (nnum).

Step 6: If each row and column in the image has undergone interleaving permutation, it ends. Otherwise, go to Step 2 and continue performing interleaving permutation on the next row or column.

When zkey=[[1,2,3,4,5,6,7,8],[10,11,12,13,14,15,16,17],[20,21,22,23,24,25,26,27]], zmsort=[[4,3,2,1],[3,2,1,4],[2,1,4,3]], znsort=[[1,4,3,2],[3,4,2,1],[4,2,1,3], an example of interleaved permutation for a color image of size 4 × 4 is shown in figure 7. After calculation, the row that layer number is 1 and row number is 1 is swapped with the row that layer number is 3 and row number is 4; The column that layer number is 1 and column number is 1 is swapped with the column that layer number is 2 and column number is 1; After dealing with all the rows and columns in this way, the final interleaved permutation result is obtained.

Figure 7. Refer to the following caption and surrounding text.

Figure 7. An example of interleaved permutation.

Standard image High-resolution image

If the image is a grayscale image, both the value of layer and zlayer are 1, which means that interleaved permutation is performed only in one layer.

4.3. Dynamic S-box substitution

Three dynamic S-boxes generated in section 4.1.2 are used to improve the security of the cipher algorithm. The sequence generated by the hyperchaotic system and three dynamic S-box are used to realize the substitution operation. The specific steps are as follows.

Step 1: Initialization. According to the hyperchaotic system, the discretization sequences dmkey, dnkey of length 3m, 3n are generated and three S-boxes S1, S2, S3 are generated by Algorithm 1. first is the user input.

Step 2: The replacement of R layer. First calculate ca1 by equation (17), then perform S-box substitution for R layer of image according to equation (18), where $i\in \{1,2,3,\mathrm{..}.,m\},$ $j\in \{1,2,3,\mathrm{..}.,n\},$ sImage represents the input image, and mImage represents the output image.

Equation (17)

Equation (18)

Step 3: The replacement of G layer. Perform S-box substitution for G layer of image according to equations (19) and (20).

Equation (19)

Equation (20)

Step 4: The replacement of B layer. Perform S-box substitution for B layer of image according to equations (21) and (22).

Equation (21)

Equation (22)

Step 5: Judge whether all values in the image have been substituted. If not, turn to Step 2; Otherwise, the dynamic S-box substitution ends.

When b1=b2=b3 = 5, c1=c2=c3 = 22, dmkey=[10,20,30,40,50,60,70,80,90,100,110,120], dnkey=[130,140,150,160,170,180,190,200,210,220,230,240], first = 0, SU1, SU2, SU3 correspond to S1, S2, S3 respectively, an example of dynamic S-box substitution for a color image of size 4 × 4 is shown in figure 8. Starting from the pixel value of 85 in the upper left corner of the first layer, the value becomes 185, calculated according to equation (18). Then the upper left corner value of the second layer change from 154 to 247 according to equation (20) and the value 185. Then, according to equation (22) and the value 247, the value of the upper left corner of the third layer change from 174 to 62. In this way, the result after dynamic S-box substitution is obtained.

Figure 8. Refer to the following caption and surrounding text.

Figure 8. An example of dynamic S-box substitution.

Standard image High-resolution image

The three-layer dynamic S-box inverse substitution for color image decryption is shown in equations (23)–(25), and the inverse S-box is not required.

Equation (23)

Equation (24)

Equation (25)

When the image is grayscale, the corresponding dynamic S-box substitution and the dynamic S-box inverse substitution are shown in equations (17), (26), (27).

Equation (26)

Equation (27)

4.4. Cyclic shift permutation with fixed point

For the color image, the R, G, and B layers are connected by row or column to form a cylindrical side. The sequences generated by the hyperchaotic system are used to perform the row and column cyclic shift permutation. pkey is used to specify how many positions need to cyclic shift, msort is used to specify the row number to cyclic shift, and nsort is used to specify the column number to cyclic shift. Fixed point means that the last one position pixel of the image is not changed, so that if there is a change in the plaintext image, the change can be passed to each pixel of the image by the second round of dynamic S-box substitution. The specific encryption steps are as follows.

Step 1: Initialization. According to the hyperchaotic system, generate the discretization sequence pkey with length of m+n; obtain the sorted pseudo-random sequences msort and nsort with the length of m and n.

Step 2: The selection of row and column cyclic shift permutation. The tnum is obtained according to equation (28). When $tnum\in \{0,1\},$ turn to Step 3; When $tnum\in \{2,3\},$ turn to Step 4.

Equation (28)

Step 3: Connect the three RGB layers by columns to form a cylindrical side, which is of size $3m\times n.$ When tnum = 0, upward cyclic shift; when tnum = 1, downward cyclic shift. wper(i) is calculated according to equation (29) and represents the number of row after the pixel cyclic shift with row number i. Column cyclic shift permutation is performed at the column number nsort(nnum) according to wper. Turn to Step 5.

Equation (29)

Step 4: Connect the three RGB layers by rows to form a cylindrical side, which is of size $m\times 3n.$ When tnum = 2, left cyclic shift; When tnum = 3, right cyclic shift. wper(j) is calculated according to equation (30) and represents the number of column after the pixel cyclic shift with column number j. Row cyclic shift permutation is performed at the row number msort(mnum) according to wper. Turn to Step 5.

Equation (30)

Step 5: Judge whether nsort(nnum)=n or msort(mnum)=m. If it is, replace the last pixel of the image back.

Step 6: Judge whether all columns and rows of the image have been cyclic shift. If so, end and output the image; Otherwise, turn to Step 2.

Suppose the color image size is 4 × 4, pkey=[17,5,3,4,11,20,10,90], nsort=[3,4,1,2], msort=[1,2,3,4], the corresponding example of cyclic shift permutation is shown in figure 9. First, RGB three layers combined by column, the third column cyclic shift up by 17 positions. and the 4th column cyclic shift down by 5 positions. Since nsort(2)=m = 4, 43 is swapped with 48, and 48 is fixed as the last pixel. Then the RGB three layers are combined by row, the first row cyclic shift to the left by 3 positions and the second row cyclic shift to the right by 4 positions. After executing all the rows and columns in this way, the result image is obtained.

Figure 9. Refer to the following caption and surrounding text.

Figure 9. An example of cyclic shift permutation with fixed point.

Standard image High-resolution image

Since m may not equal to n and the row cyclic shift and the column cyclic shift are performed twice alternately, it is necessary to calculate np and mp first when decrypting. np, mp represents how many column or row cyclic shifts need to be performed first, respectively. When m>n, mp=m-floor(n/2)*2, np = 0. When n>m, np=n-(floor(m/2)*2<m? floor(m/2)*2+2: floor(m/2)*2), mp = 0.

If it is a gray image, only one layer is cyclic shifted by row and column. Other situations are similar with RGB images.

4.5. The proposed image encryption algorithm

The structure of the image encryption algorithm is shown in figure 10, where the initial values x0, y0, z0, w0 and are calculated from the user input key.

Figure 10. Refer to the following caption and surrounding text.

Figure 10. Image encryption structure.

Standard image High-resolution image

The specific steps for color image encryption are as follows.

Step 1: Initialization. Read in the plaintext image sImage. Based on the key input by user, the initial values x0, y0, z0, w0 of the hyperchaotic system and three S-boxes S1, S2, S3 are generated.

Step 2: Interleaved permutation. The mImage is obtained by interleaved permutation. Set sImage=mImage.

Step 3: Dynamic S-box substitution. Let first = 0, SU1, SU2, SU3 correspond to S1, S2, S3 respectively, and get mImage by dynamic S-box substitution. Set sImage=mImage.

Step 4: Cyclic shift permutation with fixed point. The mImage is obtained by cyclic shift permutation with fixed point. Set sImage=mImage.

Step 5: Dynamic S-box substitution. Let first=sImage(m,n,3), SU1, SU2, SU3 correspond to S2, S3, S1 respectively, and get mImage by dynamic S-box substitution. Set sImage=mImage.

Step 6: Interleaved permutation. The mImage is obtained by interleaved permutation.

Step 7: Output cipher image mImage.

The overall process of grayscale image encryption and decryption algorithm is similar with color image, but the grayscale image algorithm only needs to generate one dynamic S-box.

4.6. Experimental results and performance evaluation

The following tests were performed in environments Intel(R) Core(TM) [email protected], 8GBRAM, Windows 10. The test images are from the USC-SIPI database, which is linked to https://sipi.usc.edu/database/.

4.6.1. Encryption and decryption results

Figure 11 shows that the encryption and decryption results of the color images: House, Baboon, San Diego and grayscale image: Airplane. The corresponding sizes of the images are $256\times 256,$ $512\times 512,$ $1024\times 1024,$ $256\times 256$ respectively. Visually, all ciphertext images appear snowflake-shaped, and plaintext pictures are the same with decrypted pictures.

Figure 11. Refer to the following caption and surrounding text.

Figure 11. Image encryption and decryption results.

Standard image High-resolution image

MSE and MSSIM are used to quantitatively measure the similarity between two images. The larger the MSE and the smaller the MSSIM, the greater difference between the two images. It can be observed from table 12 that plaintext images and ciphertext images are not similar, and plaintext images are the same with decrypted images.

Table 12. The results of MSE and MSSIM.

 PlainText Image & CipherText ImagePlainText Image & Decrypted Image
ImageMSEMSSIMMSEMSSIM
House(4.1.05)8395.19950.025801
Baboon(4.2.03)8622.47280.024201
San Diego(2.2.01)9211.09130.023001
Airplane(5.1.11)10889.25020.025601

4.6.2. Histogram

Histogram is used to visualize the frequency distribution of each pixel value. The histograms of the four plaintext images and the corresponding ciphertext images are shown in figure 12. As can be observed from figure 12, the frequency of pixel values in plaintext images is not uniformly distributed, with peaks and valleys, while the frequency distribution of each pixel value in the ciphertext image connects into a line without large fluctuations. The ciphertext image generated by the proposed cipher algorithm has a uniform frequency distribution of pixel values and is resistant to statistical attacks.

Figure 12. Refer to the following caption and surrounding text.

Figure 12. Image histogram.

Standard image High-resolution image

4.6.3. Information entropy

The information entropy can be used to quantitatively describe the randomness of the ciphertext. The closer the ciphertext information entropy is to 8, the less information is revealed by the ciphertext. The information entropy is calculated for the four plaintext images and the corresponding ciphertext images, and the results are shown in table 13. From table 13, we can see that the information entropy of the plaintext images is low, and the information entropy of the ciphertext images is high and close to the theoretical value.

Table 13. Image information entropy results.

 PlainText ImageCipherText Image
ImageRGBAvg.RGBAvg.
House6.43116.53896.23206.40077.99777.99737.99737.9974
Baboon7.70677.47447.75227.64447.99947.99937.99937.9993
San Diego7.75757.33876.95617.35087.99987.99987.99987.9998
Airplane7.19147.9967

As can be observed from table 14, the information entropy of the 512 × 512 color ciphertext image generated by the proposed algorithm is no less than that of algorithms [33, 4648, 50]. The ciphertext image generated by proposed cipher algorithm is secure and randomized.

Table 14. Comparison of image information entropy.

 PlainText Image
Cipher AlgorithmRGBAvg.
Ours 7.9994 7.99937.9993 7.99933
Ref. [46]7.9993 7.9994 7.99937.99933
Ref. [47]7.99177.99127.99187.99157
Ref. [48]7.99927.99937.99927.99923
Ref. [33]7.99127.99137.99147.99130
Ref. [49] 7.9994 7.9993 7.9994 7.99937
Ref. [50] 7.9994 7.99937.99937.99933

4.6.4. Adjacent pixel correlation

Adjacent pixel correlation is the elements correlation of horizontal, vertical, and diagonal. Adjacent pixel correlation can be used to check whether the ciphertext image will reveal information and contain laws. From figure 13, it can be observed that the adjacent pixels of the plaintext image are unevenly distributed with high correlation, and the pixels of the ciphertext image are evenly distributed over the whole plane with low correlation. Therefore, the proposed cipher algorithm can make adjacent pixel correlation of image lower.

Figure 13. Refer to the following caption and surrounding text.
Standard image High-resolution image
Figure 13. Refer to the following caption and surrounding text.

Figure 13. Adjacent pixel correlation test results.

Standard image High-resolution image

4.6.5. Differential attack

The ability of cipher algorithms to resist differential attacks is measured by NPCR and UACI. NPCR is the data change rate of two pairs data at the same position, and UACI is the overall change rate of two pairs data.

From [51], the theoretical values of NPCR and UACI for images with maximum pixel value of 255 are μN = 99.6094% and μu = 33.4635%. The NPCR and UACI tests were most stringent when $\alpha =0.05.$ The NPCR and UACI thresholds corresponding to different image sizes at $\alpha =0.05$ are shown in table 15. When NPCR ≥ ${N}_{0.05}^{* },$ UACI $\in $ (${u}_{0.05}^{* -},$ ${u}_{0.05}^{* +}$), image passes NPCR and UACI tests.

Table 15. Thresholds about NPCR and UACI for different image sizes.

 NPCR(%)UACI(%)
Image Size ${N}_{0.05}^{* }$ ${\mu }_{N}$ ${u}_{0.05}^{* -}$ ${u}_{0.05}^{* +}$ ${\mu }_{u}$
64 × 6499.449199.609432.738934.188233.4635
128 × 12899.529299.609433.101233.825933.4635
256 × 25699.569399.609433.282433.644733.4635
512 × 51299.589399.609433.373033.554133.4635
1024 × 102499.599499.609433.418333.508833.4635

The average of the corresponding NPCR and UACI obtained by repeating 100 times are shown in table 16 and all ciphertext images pass the NPCR and UACI tests.

Table 16. Test results about NPCR and UACI.

 NPCR(%)UACI(%) 
ImageRGBAvg.RGBAvg.Test Result
House99.608699.606299.609299.608033.507533.451533.435333.4648PASS
Baboon99.613999.612599.610899.612433.465533.456633.435233.4524PASS
San Diego99.612599.613099.612099.612533.471633.451433.462233.4617PASS
Airplane99.605633.4638PASS

As shown in table 17, the results of NPCR and UACI tests on 512*512 color images are compared with other literature. The NPCR of the proposed algorithm is closer to the theoretical value than that of other algorithms. The UACI is closer to the theoretical value than UACI of the literature [33, 46, 49, 50, 52]. Therefore, the proposed cryptographic algorithm is resistant to differential attacks.

Table 17. Comparison of NPCR and UACI.

 NPCR(%)UACI(%)
 RGBAvg.RGBAvg.
Our 99.6058 99.6095 99.6092 99.6082 33.4606 33.4698 33.444333.4582
Ref. [46]99.620099.610099.620099.616733.460033.560033.510033.5100
Ref. [47]99.624399.618599.628199.623633.422433.4362 33.4604 33.4397
Ref. [33]99.624399.643399.602999.623533.468633.502033.4155 33.4620
Ref. [49]99.647999.659799.628899.645533.439033.479933.483333.4674
Ref. [50]99.629699.617499.647399.631433.602733.499733.551633.5513
Ref. [52]99.605299.612099.630399.615833.402533.442833.502933.4494

4.6.6. Select plaintext attack

Selective plaintext attack means that the attacker can know the ciphertext corresponding to any of the plaintexts, so the ciphertext with a regular pattern can be obtained by carefully constructing the contents of plaintext and be used to crack the cipher algorithm. The cipher images obtained by encrypting 512*512 all-black and all-white color images are analyzed to judge whether the proposed cipher algorithm can resist the selective plaintext attack. As shown in figure 14, the proposed algorithm is visually resistant to the selective plaintext attack.

Figure 14. Refer to the following caption and surrounding text.

Figure 14. Select plaintext attack test results.

Standard image High-resolution image

As shown in table 18, the white and black cipher images still have high security, which means that the cryptographic algorithm proposed in this paper can resist selective plaintext attack.

Table 18. Security test results of all black and white pictures.

   Differential attackCorrelation coefficients
ImageChannelInformation EntropyNPCR(%)UACI(%)HorizontalVerticalDiagonal
WhiteR7.999299.607833.45780.00150.00200.0021
 G7.999399.608633.46400.00160.00170.0033
 B7.999399.608233.47120.00150.00140.0016
BlackR7.999499.609733.46000.00160.00230.0024
 G7.999399.611333.45170.00160.00190.0055
 B7.999399.610733.45890.00170.00160.0028

4.6.7. Key space size

The key size for the proposed cipher algorithm is 192bit which is exceeds 128, so the proposed cipher algorithm can resist brute-force attack.

4.6.8. Key sensitivity

Key sensitivity refers to two aspects: one is decryption sensitivity: a small change in the key will make the decrypted image of the ciphertext image different from the plaintext image; The second is encryption sensitivity: small changes in the key will cause the ciphertext image to be different. The proposed algorithm sets up three 192-bit keys K1, K2 and K3, of which K1 is only 1 bit different from K2 and K3.

K1= 210CD20802249A787989BCD0774428912873145693293AB3

K2= 310CD20802249A787989BCD0774428912873145693293AB3

K3= 210CD20802249A787989BCD0774428912873145693293AB2

As shown in figure 15, visually, the ciphertext image obtained by using key K1 encryption can only be decrypted by the original key K1 and cannot be decrypted by using keys K2 and K3. The key of the proposed cipher algorithm has decryption sensitivity.

Figure 15. Refer to the following caption and surrounding text.

Figure 15. Encryption and decryption diagram of different keys.

Standard image High-resolution image

PSNR is used to measure whether two pairs data are similar or not. The encryption sensitivity is measured by NPCR, UACI, PSNR and MSSIM. The closer the NPCR is to 99.6094%, the closer the UACI is to 33.4635%, and the smaller the PSNR and MSSIM are, the more sensitive the key is.

Suppose that the encrypted images obtained by keys K1, K2 and K3 are E1, E2 and E3, respectively. As shown in table 19, the values indicate that a mere 1bit change in the key can also cause the ciphertext image to be very different, so the key of the proposed image cipher algorithm has encryption sensitive.

Table 19. Key encryption sensitivity results.

  E1&Ei
ImageKeyNPCRUACIPSNRMSSIM
HouseK299.610933.46527.73970.0143
 K399.627733.54227.75470.0173
BaboonK299.601433.43057.75440.0154
 K399.620133.41057.76130.0171
San DiegoK299.603533.46617.75030.0153
 K399.613433.45547.74960.0155
AirplaneK299.618533.46277.76730.0179
 K399.614033.41917.74960.0110

4.6.9. Efficiency

In order to verify the efficiency of the proposed image cipher algorithm, the average time to encrypt the same color image and same grayscale image of size 256 × 256, 512 × 512, 1024 × 1024 repeated 100 times is compared and the results are shown in table 20. From table 20, it can be observed that the proposed image cipher algorithm has high efficiency in processing both grayscale and color images at different scales.

Table 20. Comparison of time consumption.

 Gray imageColor image
Cipher Algorithm256*256512*5121024*1024256*256512*5121024*1024
Ours 0.1056 0.1512 0.3304 0.1956 0.3620 1.2604
Ref.[53]0.17450.91782.77101.28664.824220.3141
Ref.[49]0.13850.56932.8148
Ref.[54]0.10590.51353.08350.45502.343914.5444
Ref.[55]2.00642.08252.08542.77152.90952.9884
Ref.[56]0.40911.64706.83271.20854.832224.9778
Ref.[57]7.976539.1302

5. Conclusion

The four-dimensional hyperchaotic system is proposed on the basis of the three-dimensional Lű chaotic system. Then, the method of generating S-box by AES is improved, and the relative suitable irreducible polynomial and affine matrix are selected by combining different irreducible polynomials and affine matrices on the basis of GF(28). Dynamic high-performance 8 × 8 S-box generation is achieved by calculating affine multiplication and multiplication inverse matrices in advance. Based on the new four-dimensional hyperchaotic system and the method of generating S-box in real time, a image cipher algorithm that can securely and efficiently encrypt images of any size is designed. In order to improve the ability of the image to resist differential attacks, cyclic shift permutation with fixed point is set to ensure that the plaintext transformation can be transferred to entire image through the second round of dynamic S-box substitution. The proposed image cipher algorithm can be used only for encrypting and decrypting images. Further research can be done to design an efficient and secure cipher algorithm that can encrypt and decrypt both text and images.

Acknowledgments

This work was supported by the following projects and foundations: the National Natural Science Foundation of China (No.61902091); Shandong Provincial Natural Science Foundation(No.ZR2019MF054).

Data availability statement

All data that support the findings of this study are included within the article (and any supplementary files).

Conflict of interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Please wait… references are loading.