Color image encryption based on cross 2D hyperchaotic map using combined cycle shift scrambling and selecting diffusion

A novel color image encryption algorithm based on a cross 2D hyperchaotic map is proposed in this paper. The cross 2D hyperchaotic map is constructed using one nonlinear function and two chaotic maps with a cross structure. Chaotic behaviors are illustrated using bifurcation diagrams, Lyapunov exponent spectra, phase portraits, etc. In the color image encryption algorithm, the keys are generated using hash function SHA-512 and the information of the plain color image. First, the color plain image is converted to a combined bit-level matrix and permuted by the chaos-based row and column combined cycle shift scrambling method. Then, the scrambled integer matrix is diffused according to the selecting sequence which depends on the chaotic sequence. Last, decompose the diffusion matrix to get the encrypted color image. Simulation experiments and security evaluations show that the algorithm can encrypt the color image effectively and has good security to resist various kinds of attacks.


Introduction
With the rapid development of Internet, big data, artificial intelligence and 5G communications, a large amount of information has been digitized and transmitted over the network.As an important information carrier, the security of digital image attracts more and more attention.Because of color images contain richer information than grey-level images, the related research in color image encryption has become a research hotspot [1][2][3][4][5][6][7][8][9][10] .
Image encryption is different from text encryption, because image has the characteristics of massive data capacity and high correlation between pixels.Therefore, traditional encryption technologies such as DES, IDES and RSA are no longer suitable for image encryption.Chaotic system has the characteristics of sensitivity to control parameters and initial conditions, ergodicity, random like behavior and unpredictable orbit.It corresponds to the concepts of key design, confusion, diffusion and round robin in cryptography, which makes chaos theory have great potential in the field of cryptography.
Due to the limited precision of the computer, the dynamic behavior of most low dimensional chaotic systems degenerates, which leads to the defects of small key space and weak security performance.The image encryption algorithms designed by using high-dimensional continuous chaotic system still have defect that the cipher image can be cracked by known plaintext attack or selected plaintext attack [21][22][23][24] .In addition, the computational complexity and time cost of the encryption algorithm are increased.
Hyperchaotic systems with multiple positive Lyapunov exponents usually have more complex and richer dynamic behaviors than chaotic systems which can enhance the randomness and higher unpredictability of the corresponding system [25] .Therefore, when applied to encryption, the hyperchaotic system can generate larger key space and more complex random sequences.
How to design encryption algorithm based on the characteristics of color image and chaotic system still has a large research value.In recent years, some new chaotic maps have been applied to image encryption algorithms [33][34][35][36][37] .Some of the new chaotic maps still have defects that trajectory is not distributed in the whole phase space or has no complex dynamic behavior.
In view of the above shortcomings, we design a nonlinear discrete cross 2D hyperchaotic map, and propose a color image encryption algorithm based on this map.The 2D hyperchaotic map is constructed using one nonlinear function and two chaotic maps with cross structure.Chaotic behaviors are illustrated using bifurcation diagrams, Lyapunov exponent spectra and phase portraits, etc. Simulation results show that the cross 2D hyperchaotic map has good chaotic performance.In the color image encryption algorithm, the keys are related to the plain color image, that is, different plain image will generate different keys which will enhance the security to resist the chosen plaintext/ciphertext attack.The color plain image is converted to a combined bit-level matrix and permuted by the chaos based row and column combined cycle shift scrambling method.
Then the scrambled integer matrix is diffused according to the selecting sequence which depends on the chaotic sequence.The cipher color image is obtained by decomposed the diffused matrix.
The proposed encryption algorithm makes the three color components of color image affect each other to eliminate the correlations between them.Simulation results show that the algorithm can encrypt the color image effectively and has good security.The rest of this paper is organized as follows.Section 2 introduces the model of the nonlinear cross 2D hyperchaotic map.In section 3, the dynamic behaviors of proposed cross 2D hyperchaotic map is analyzed.Section 4 describes the encryption and decryption algorithm of color image.In section 5, the experiments results and the security of the algorithm are evaluated.Section 6 concludes the paper.

Cross 2D hyperchaotic map
In this paper, a cross 2D hyperchaotic map is proposed, and the structure is shown in Figure 1.
This model has two inputs and two cross outputs, which is when input is xn the output is yn+1, and when input is yn the output is xn+1.Function f is a nonlinear function, functions F and G are two chaotic maps.The + sign represents the addition of two input terms.The mathematical expression of the model is shown in Formula (1). ) where F and G can be chosen as any one-dimensional chaotic map.

Figure 1 Diagram of Nonlinear cross 2D hyperchaotic map
The chaotic map F is chosen as the infinite collapse map [38] defined as where its control parameter 0   .And the chaotic map G is chosen as the Sine map in this paper.The Sine map is given as where  is a control parameter and it has an interval of (0,1].The nonlinear function f is set to sin function, that is ( ) sin( ) . So the mathematical expression of the modified 2D coupled chaotic map model is set to where its control parameter , the initial value 0 0 y  .
3 Dynamics analysis of the cross 2D hyperchaotic map

Bifurcation diagram
The dynamical behaviors of a chaotic system can be evaluated by its bifurcation diagram.A bifurcation diagram shows the changes of the system motion state along with the control parameters.The evolution process of the system can be directly observed by the bifurcation

Lyapunov exponent spectrum
The Lyapunov exponent represents the numerical characteristics of the average exponential divergence rate of adjacent trajectories in phase space.It is one of the characteristics used to identify the chaotic characteristics of dynamic systems.For a high-order dynamic system, due to the different directions of the initial separation vector, the exponential divergence rate will be different, so there are multiple Lyapunov exponents, and the number of Lyapunov exponents is equal to the order of the system.Therefore the two dimensional system has two Lyapunov exponents.The Lyapunov exponents of the system are two negatives indicates the system is in fixed points.When the system is in periodic orbits, the Lyapunov exponents of the system are one zero and one negatives.When the system is in chaotic orbits, the Lyapunov exponents of the system are one positive, one negative.When the system is in hyperchaotic state, the Lyapunov exponents of the system are two positives.Hyperchaotic systems usually have more complex and richer dynamic behaviors than chaotic systems, which enhance the randomness and unpredictability., the largest Lyapunov exponent is positive, so the system is in chaotic state.When

Cross 2D hyperchaotic map based color image encryption and decryption algorithm
As the proposed cross 2D hyperchaotic map has good chaotic performance, a color image encryption and decryption algorithm based on this chaotic map is proposed in this section.Figure 6 shows the flowchart of proposed encryption algorithm which includes permutation process and diffusion process., which the input value of this hash algorithm is related to the plain color image in order to increase the security and able to resist select plaintext/ ciphertext attack.
Divide the 512-bit key K into 8-bit blocks, which can be expressed as

Chaos based row and column combined cycle shift scrambling
In the scrambling processing, the image pixels positions are changed to average the statistical information of the image, so the energy of the image can be uniform.A chaos based row and column combined cycle shift scrambling method is proposed: Step 1. Suppose the size of the image matrix is M×N, that is M rows and N columns.Set the row vectors PR and column vectors PC.Process rows and columns together, there are M+N vectors.
Step 2. Select a chaotic sequence X1 with length M+N, chaotic sequence X2 with length M and chaotic sequence X3 with length N. The chaotic sequences are further processed by where ceil(x) returns the smallest integer greater than or equal to x, mod( ) represents the modular operation.
Step 3. Sort the sequence 1 X  , record the transform position TP of every element in the chaotic sequence, thus the length of vector TP is M+N and the elements of TP are all non-repeating integers between 1 and M+N.
Step 4. Exchange the locations of image elements using row and column combined cycle ) Take an image matrix with the size of 4×4 as an example shown in Figure 7.Where TP= {8, 1, 4, 7, 3, 2, 5, 6}, 2 X  = {3, 2, 3, 1}, 3 X  = {2, 0, 1, 3}.It can be seen that each pixel changes its position after only one scrambling turn.mod( 4,1) Step 3. Iterate the chaotic system (4) 3M+8N+k times, k is the length of the sequence discarded for better chaos.Where mod( ( ),100) 500 means the sum of all the elements in three components.Get the chaotic sequences   Step 4. Use the chaos based row and column combined cycle shift scrambling method described in section 4.2 to permute the bit-level image matrix Pb with the size of 3M×8N.Where the chaotic sequence X1= ( ) A permutated bit-level image matrix b P  is generated.
Step 5. Transform b P  to an integer image matrix denoted as P  with the size of 3M×N.
The position of pixels are changed as well as the value of the pixels in the permutated image P  .

Diffusion process
In diffusion process, the pixel values of an image are modified so that a tiny change in one-pixel spreads out to as many pixels as possible.The proposed diffusion equation is chosen according to the selecting sequence which depends on the chaotic sequence.
Step 1. Set the diffuse key 512 ( ([ ],:) , where ([ ],:) P i j k  is the ith row, jth row and kth row of permutated image matrix P  .Obtain the sub-keys K1 ' , K2 ' , K3 ' , K4 ' according to equation ( 5), and set the parameters and initial conditions of chaotic system (4) using equation ( 10). Step Step 4. The encrypted combined image pixel matrix can be acquired from the diffusion matrix D and the permuted image P  according to the chaotic based selecting diffusion equations: where  denotes bit-level XOR operator.
Step 5. Convert C into the R, G and B color matrix vertically to get its cipher color image C with the size of M×N .

Decryption algorithm
Decryption algorithm is the reverse of encryption using the permute key Step 2. Use the same diffuse key diffuse K as the encryption algorithm to obtain the same selecting sequence ( ) S i and the diffusion sequence ( ) D i .
Step 3. The matrix D C can be acquired from the diffusion matrix D and the encrypted image matrix C  using inverse diffusion process equations: Step 6. Transform P C to an integer image matrix denoted as I C with the size of 3M×N.
Convert I C into the R, G and B color matrix vertically to obtain the decrypted image.

Experimental results and performance analysis
The experimental results and performance of the proposed algorithm is analyzed.In order to verify the effectiveness of the proposed algorithm, numerical simulations are performed on several images.
The chosen sample images are the different sizes color images of 256×256 House, 500×480 Baboon, 512×512 Lena, 512×512 Peppers, 720×576 Barbara and 768×512 Parrots. Figure 7 shows the encryption and decryption results for House, Baboon, Lena, barabra and Parrots images and the encrypted image is similar to noise image without any visual information leakage.

Key space analysis
The encryption algorithm with larger key space can better resist brute-force attacks and has higher security.In the proposed algorithm, the key includes the initial conditions 0 x , 0 y , 0 x  , 0 y  , parameters  ,  ,   ,   and the discard length k, k1 of the chaotic system in the permutation and diffusion processes.Because the computational precision is 10 -16 , the size of the key space of for one round encryption is which is much bigger than 100 2 .So the key space is large enough to resist any brute-force attack.

Key sensitivity analysis
Key sensitivity is an important feature for high security image encryption algorithm.
Slightly different key used in encryption will produce totally different cipher image.And minor changes in the key used for decryption will cause decryption failure.To analysis the key sensitivity of the proposed algorithm, the encryption and decryption keys are changed 10 -16 .
Figure 8 shows the experimental results of the key sensitivity.A slightly changes in any encrypt keys will lead to the completely different cipher images.And a tiny change of one key will generate completely different images and cannot obtain the correct decryption image.

Histogram
The image histogram shows the distribution information of pixel values.In order to prevent the statistical analysis attack to recover any meaningful information from the histogram of the cipher image, it is import for the cipher image to have uniform distribution.Figure 9 shows the histograms of the plain images and corresponding cipher images.As shown in Figure 9, the histograms distribution of the cipher images are uniform, which makes it difficult for attackers to attack cipher image through statistical analysis.

Correlation of adjacent pixels
There is a high correlation between adjacent pixels in plain images, which can leak the statistic information for attackers.Therefore, the cipher image should reduce the correlation between adjacent pixels as much as possible.Calculate the correction coefficient of each pair by using the following formulas: where ( ) i p m represents the probability of symbol i m and the entropy is expressed in bits.For an ideally completely random image, the value of information entropy is 8.
The information entropy for plain images and their corresponding encrypted images are calculated in Table 2.The encrypted image information entropy is very close to the theoretical value 8.This means that information leakage in the encryption process is negligible and the encryption system is secure against the entropy attack.

Differential attack
A secure image encryption algorithm should be highly sensitive to any subtle changes in the plaintext image, which means that one pixel of the plaintext image change will produce a completely different cipher image.
The number of pixels change rate (NPCR) while one pixel of plain image changed and the unified average changing intensity (UACI) between the plain image and ciphered image are used to test the differential attack.Here are the formulas to calculate NPCR and UACI: where M and N represent the rows and columns of the image respectively, C1 and C2 are respectively the ciphered images before and after one pixel of the plain image is changed.
The experiment results of NPCR and UACI are listed in Table 3. From Table 3 we can see that the NPCR and UACI values are very close to the theoretical value, and the proposed cryptosystem could resist plaintext attack and differential attack effectively.The lost data cipher images and corresponding decrypted images are shown in Figure 12.

Noise and data loss attacks
The experimental results show that the higher degree of image loss, the less clear the decrypted image is.But even if half of the image is lost, the image can still be decrypted and recognized.
The proposed algorithm is robust to noise attacks and information loss attacks.

Conclusion
This paper designed a cross 2D hyperchaotic map, which is constructed using one nonlinear function and two chaotic maps with cross structure.Numerous experiments such as bifurcation diagrams, Lyapunov exponent spectra and phase portraits are carried out to illustrate the complex chaotic behavior of the proposed hyperchaotic map.Simulation results show that the nonlinear cross 2D hyperchaotic map has good chaotic performance.In the color image encryption algorithm, the keys are generated using hash function SHA-512 and the information of plain color image.First, the color plain image is converted to a combined bit-level matrix and permutated by the chaotic based row and column combined cycle shift scrambling method.Then the scrambled integer matrix is diffused according to the selecting sequence.The cipher color image is obtained by decomposed the diffused matrix.The proposed encryption algorithm makes the three color components of color image affect each other to eliminate the correlations between them.Simulation results show that the algorithm can encrypt the color image effectively and has good security to resist various kinds of attacks.Correlation of adjacent pixels of plain image and cipher image The decryption results with different density noises Data loss attack

1 
diagram.Set the initial conditions 0 0.3  , the bifurcation diagram for control parameter  over the range [0.25, 2] is generated in Figure2(a).From Figure2(a), we can see that the system goes through periodic state to chaotic orbit.When 0.55 2    , the system exhibits the chaotic behavior.Fixing 1   , the bifurcation diagram for control parameter  over the range [0.1, 1] is generated in Figure2(b).It can be acquired that the system exhibits the periodic behavior between (0.34, 0.353), and the system can generate chaotic attractors all through the remaining range.

Figure 2
Figure 2 Bifurcation diagrams of the proposed system

Fixing 1 
 and varying  , the Lyapunov exponents spectrum is shown in Figure3(a).It can be seen that when (1.55, 1.47)  

Figure 3 (Figure 3 1 
Figure 3(b) shows the Lyapunov exponents spectrum varying  when

Figure 4 Figure 5
Figure 4 Attractor phase diagrams3.4Sensitivity analysis of initial valueA good performance chaotic system is very sensitive to initial value.Slightly different initial value will produce totally different chaotic trajectory.To analysis the initial sensitivity of the proposed hyperchaotic system, the initial values are changed 10 -16 , and the experiment results are shown in Figure5.It can be seen that the proposed hyperchaotic system is very sensitive to initial values.

Figure 6
Figure 6 Flowchart of proposed encryption algorithm ..., K k k k .K is processed and grouped in sub-keys as follows:

Figure 7 4×4
Figure 7 4×4 matrix scrambled by row and column combined cycle shift 4.3 Permutation process Step 1.Without loss of generality, assume the size of the color plain-image P is M×N.And the color image has three components: red (R), green (G) and blue (B).The value of each component pixel is range from 0 to 255.So each pixel can transform to 8-bit binary value.Therefore, an M×N size color image P can be extended to three binary image matrixes Rb, Gb and Bb with size M×8N.Combine the Rb, Gb and Bb matrixes vertically and get a combined image matrix Pb with 3×M rows, 8×N columns.Thus the three components of the color image can be affected by each other.Step 2. Set the permute key 512 ( , , )permute K SHA R G B , which R, G and B are all the pixels in each color components of plain-image, so that different plain-image will get different key.Obtain the sub-keys K1, K2, K3, K4 according to equation (5), and set the parameters and initial conditions of chaotic system (4) using: and known in the decryption process.Step 1. Obtain the cipher image C and convert it into the R, G and B color matrix.Combine the color matrixes vertically and get a combined encrypted image matrix C  with 3×M rows, N columns.

14 )Step 4 .
Extended the matrix D C to its binary image matrixes Db C .Use the same permute key permute K as the encryption algorithm to obtain the same chaotic sequences X1, X2 and X3 in the encryption permutation process.Step 5.The matrix P C can be acquired use the reverse row and column combined cycle shift scrambling equation(15) to reverse permute the bit-level image matrix Db C .

Figure 7
Figure 7 Encryption and decryption results

Figure 8
Figure 8 Key sensitivity

Figure 9
Figure 9 Histogram of different plain images and cipher images.

Figure 10
Figure 10 Correlation of adjacent pixels of plain image and cipher image Image data is easily experience the noise and data lost during transmission.A high security image encryption algorithm should be able to resist noise and data loss attacks.Salt and pepper noises with different density are added into the encrypted Lena image.It can be seen from Figure11that the decrypted image can still be recovered successfully, and the noises could not prevent us from visually recognizing the decrypted image contents.

25 Figure 11
Figure 11 The decryption results with different density noises

Figures
Figures

Table 1
Correlation coefficients of plain image and ciphered image.

Table 2
The results of information entropy.

Table 4
Execution time analysis (seconds)