A Hyperchaotic Color Image Encryption Algorithm and Security Analysis

The current common color image encryption algorithms applying “scrambling-diffusion” have some problems, such as the small key space, the cumbersome encryption process, and the security vulnerability. Aiming at these problems, this paper proposes a new color image encryption algorithm based on the hyperchaotic system and applying “transforming-scrambling-diffusion” model. Before scrambling, in accordance with the plaintext itself attributes, the number of iterations was calculated, all the pixel values of color image were transformed into gray code iteratively, and then the chaotic sequence was generated from the four-dimensional hyperchaotic system. Pixel matrix after gray code transformation was converted to one-dimensional matrix. The chaotic sequence was sorted and the one-dimensionalmatrix was changed positions correspondingly to complete the whole domain scrambling. And then, bit-operation was executed for image diffusion.The ciphertext can be obtained by matrix transformation.The key sensitivity, histogram, information entropy, correlation, and other evaluation indexes were calculated and analyzed through the simulation experiment. Compared with other algorithms, it can be proved that the encryption algorithm has the strong antiattack ability.


Introduction
With the rapid development of multimedia information industry, the security requirements of information are gradually improved [1].In multimedia security, image encryption is playing a more and more essential role and has become one of hot issues in military, medical, meteorological, and other fields [2].Due to the strong initial value and parameter sensitivity, chaotic systems which show good randomness have been widely used in image encryption [3].Karan Nair, Janhavi Kulkarni et al. proposed an image encryption using logistic and rectangular chaotic maps [4].However, the process of the algorithm was quite simple which resulted in the ciphertext distribution not being uniform which made it difficult to resist statistical attacks.Abbas A. M. proposed an image encryption algorithm, based on independent component analysis and Arnold's Cat Map [5], which was easy to be realized and provide an effective and safe way for image encryption.However, only square images could be encrypted in this algorithm; the range of application was remarkably restrained.Ran Wei et al. proposed an image encryption algorithm combining DNA encoding and various chaotic maps [6].The simulation experiments showed that the sensitivity of plaintext and keys and the scramble effect could be greatly enhanced.But the process was complex and the requirements to hardware were comparatively high.Besides, compared with low-dimensional chaos, high-dimensional chaos has stronger dynamic characteristics and randomness.Nazira Shaikh, Santosh Chapaneri et al. proposed a single round color image encryption scheme based hyperchaotic system [7], and Chai Xiuli et al. proposed a color image encryption algorithm based on Chen's hyperchaotic system [8]; both algorithms achieved good encryption results.This paper proposes a new color image encryption algorithm based on fourdimensional hyperchaotic system and improved encryption process.This algorithm was different from the traditional "scrambling-diffusion" encryption mode.Before scrambling, the pixel values were firstly converted into gray codes.On that basis, a new "transformation-scrambling-diffusion" mode was formed that can expand the key space and improve 2 Security and Communication Networks the security of encryption.During the scrambling process, the global pixel positions were scrambled according to the chaotic sequence generated by the hyperchaotic system.The scrambling procedure can reduce the correlation of adjacent elements and each color component.The scrambled sequences and chaotic sequences were bitwise manipulated to complete image diffusion.After the whole encryption process was iterated, the ciphertext image would be obtained by matrix transformation.With this algorithm, the security and cryptography characteristics of the encrypted color image were improved.

Hyperchaotic System
The equation of state of the 4-dimensional autonomous hyperchaotic system used in this paper is [9] where , ,, and  are the state variables of system (1) and a, b, c, and m are the real value parameters.The dynamic characteristics of the chaotic system depend on the change of parameters above all.When a = 33.4,b = 33.6,c = 2.3, and m = 9.1, chaotic attractors exist in system (1), as shown in Figure 1.
Compared with low-dimensional chaotic systems, highdimensional hyperchaotic systems have more complex phase space and dynamic characteristics.At this time, system (1) has no less than two positive Lyapunov exponentials; thus it has hyperchaotic characteristics [10].The randomness of the system is greatly increased [11] which means it has a better performance in color image encryption.

Image Encryption and Decryption Algorithm
The common image encryption algorithms mostly apply the model of "scrambling-diffusion" [12,13].Before scrambling, this algorithm firstly converts the pixel value of the image into gray code to expand the key space and improve the security.

Gray Code Conversion.
Gray code is a typical binary communication coding format [14].Its encoding rule is that there is only one-bit difference between two adjacent codes.The method of converting the natural binary code of bit  into a typical gray code is as follows: Among them, () is typical gray code and () is natural binary code of the ith; ⨁ means exclusive or (XOR) operation.The method to convert a typical n-bit gray code into a natural binary code is as follows: In this algorithm, the first encrypted gray code iteration conversion times are calculated according to the size of the color image r 0 : where  and  represent the length and width in pixels.

Position Scrambling.
Based on the chaotic sequence generated by hyperchaotic system, this algorithm can scramble the pixel positions of n-by-m color images.The steps of pixel position scrambling are as follows: (1) According to the given system parameters , , ,  and initial values  0 , 0 , 0 ,  0 , Runge-Kutta algorithm is used to iterate the chaotic system (1), and the four chaotic real value sequences of ,,, and  were obtained.
(2) Four chaos real value sequences are converted into a one-dimensional matrix.To reduce the impact of the initial value on the system, the previous  0 results are given up and a one-dimensional chaos sequence   could be generated ( = 1, 2, . . .,  ×  × 3), Among them, , , and  are the average pixel values of three-color components and [⋅] represents the fetch operation.
(3) 3D matrix which has been converted to gray code is converted to a one-dimensional matrix   ; then, the one-dimensional chaotic matrix   in step ( 2) is sorted and   changes positions synchronously.This step completes the whole-field pixel scrambling.
For color images, there is a strong correlation between adjacent pixels and each color component.The whole-field pixel scrambling method not only disrupts the correlation between adjacent pixels, but also changes the correlation among R, G, and B color components to achieve a better scrambling effect.Although the histogram statistics of each color component have changed to some extent, the histogram statistics of the image as a whole have not been changed.The histogram statistics of each component are not uniform; hence the further encryption is still needed.

Value Diffusion.
In order to improve the security of image encryption, especially to equalize the histogram and hide the statistical information of plaintext, this algorithm uses the sequence generated by hyperchaotic system to diffuse the pixel value of image.The hyperchaotic sequence   transforming into one dimension is discretized as follows to obtain the key flow   : The matrix generated by the XOR operation of scrambled image sequence with the key flow   is converted as the final output sequence.
Decryption algorithm is the inverse process of encryption algorithm, decryption image can be obtained by the whole decryption process according to the key: , , , , ,  0 , 0 ,  0 , and  0 .

Simulation Experiment
= 5.According to (4) and ( 5), the first round of encryption, and the times of gray code conversion of iterations is r 0 = 2 and the selection of chaotic sequence starts from  0 = 768.In each subsequent iteration,   =  −1 + 1,   =  −1 +   2 .The encryption key includes , , , ,  0 ,  0 ,  0 ,  0 , , and  0 ; the decryption key is the same as the encryption key.The encryption and decryption results of the image are shown in Figure 2. The ciphertext image is disordered and the decrypted image is exactly the same as the plaintext image.

Key Sensitivity.
To detect the key sensitivity of the algorithm, only one key was changed during decryption.The initial value of the chaotic system, the number of iterations and the order number selected at the beginning of the chaotic sequence are changed, respectively, and slightly.In proper order, let  0 = 16.3000001, = 6, and  0 = 769; the decrypted images are shown in Figure 3.
Although only one key was changed imperceptibly during every round, the ciphertext could not be decrypted precisely, therefore, this algorithm can be proved to have a strong key sensitivity.

Histogram.
Histogram shows the frequency of different pixel values appearing in images.It has been widely used in image retrieval, classification, and other fields [15].One of the aims of image encryption is to increase the difficulty of extracting image histogram features by histogram equalization or generalization [16].The histograms of the images before and after encryption are shown in Figure 4.
The histogram of color components tends to be uniform distribution, which is completely different from the plaintext distribution.Figure 4 shows that the transformationscrambling-diffusion mode of the algorithm has good scrambling and statistical characteristics and meets the requirements of image encryption.

Relevance of Adjacent Elements.
There is often a high correlation between adjacent pixels in plaintext which is the inherent feature of the image.Therefore, the encryption algorithm should try to reduce the correlation between adjacent pixels.In this paper, 10,000 pixels are randomly extracted from plaintext and ciphertext.The correlation coefficients in horizontal, vertical, and diagonal directions are calculated according to the following equations: = cov (, ) √ ()√ () (10) x and y represent the pixel values of the two adjacent pixels, and   is the correlation coefficient.The results are shown in Table 1.2500 pixels were randomly selected from the three primary color components of the original image and the encrypted image, respectively.The element distribution in the diagonal direction is shown in Figure 5.
Adjacent elements of plaintext images tend to have a strong correlation, and the distribution of elements and their adjacent elements is concentrated around  = , as shown in Figures 5(a)-5(c).The scrambling and diffusion operation are aimed at reducing this correlation, which is shown as nearly uniform distribution in the region [0, 255], as shown in Figures 5(d)-5(f).
In fact, pixel values at the same relative position of different color components in color images are often highly correlated.Therefore, in the process of color image encryption, attention should be paid to reducing the correlation between pixel values at the same relative position of different components.
Some random points are randomly selected in plaintext and ciphertext.The pixel values of the three-color components R, G, and B represent the X, Y, and Z axis coordinates, the adjacent elements in the diagonal direction are plotted as the relationship diagram of the adjacent elements.The scatter diagram is shown in Figure 6, where the red points are the selected random points and the blue points are the pixels in the diagonal direction of the random points.For color plaintext images, the pixel values of components at the same relative position are highly correlated; as shown in Figure 6(a), the scattered points are distributed centrally around the line  =  = , and the overlap degree between red and blue points is high; in Figure 6(b), the scattered points selected from ciphertext are randomly distributed in space and the overlap degree is low.As can be seen from Figure 6, plaintext images show obvious characteristics of centralized distribution, while ciphertext images show strong randomness.
Table 1 and Figures 5 and 6 show that this encryption algorithm has good diffusion characteristics.

Robustness.
In the process of image transmission or decoding, pepper and salt noise, Gaussian noise, and other noises as well as image clipping are often generated [21].Therefore, the image encryption and decryption algorithm should adapt to clipping and noise to a certain extent.Figure 7 shows the images decrypted after a 1/4 clipping, adding 0.20 pepper noise, 0.1 Gaussian noise, Poisson noise, and speckle noise.

Antiattack Analysis
6.1.Antiexhaustive Attack.This algorithm is based on gray code and hyperchaos system of 4D.Parameters, initial value, the number of iterations, and image size are the encryption key.When the precision is set to 10 14 , key space would be more than 10 86 .According to the current calculation conditions, when the key space is larger than 2 128 , ciphertext images can effectively resist violent attacks.The key space of this algorithm far exceeds this standard [22].Thereunder, the key space of this encryption algorithm can effectively resist exhaustive attack.

Antientropy Attack.
Image information entropy is used to represent the aggregation feature of image pixel value distribution [23].The calculation method is as follows: () is the frequency of each greyscale.This equation is mainly used to calculate the information entropy of gray image.In this paper, the calculation method of the information entropy of color image is defined as follows: ∈ {, , } and   represents the information entropy of each color component of RGB.[4] 7.8556 ciphertext [17] 7.8534 ciphertext [20] 7.9994 ciphertext [24] 7.9551 According to Table 2, by comparing the information entropy of plaintext, ciphertext of this algorithm, and ciphertext image of [4,17,20,24], it can be concluded that the information entropy value of the encrypted image of this algorithm is closer to the ideal value 8 which means that the encrypted image is closer to the random signal source and this algorithm has the ability to resist entropy attack.

Antiplaintext Attack.
Since the starting sequence number of gray code and chaotic sequence is related to the attribute of plaintext image itself [25], the key obtained by selecting different plaintext is often different; "One Picture One Key" can basically be realized.The key deduced from the specific plaintext cannot correctly decrypt the other ciphertext [8].Therefore, it can be concluded that this algorithm has good antiselective plaintext attack ability.
where  ×  is the size of the image and (, ) and   (, ) represent the pixel values of the corresponding positions of plaintext and ciphertext.The calculation method of NPCR and UACI for color image is defined according to the gray images, as follows:  [4] 99.63 33.54 Ciphertext [17] 86.55 33.47 Ciphertext [18] 99.63 33.51 Ciphertext [20] 99.60 30.34 The calculated results are shown in Table 3.
When the NPCR and UACI of the ciphertext are greater than 99.6% and 33.46%, respectively, it indicates that the algorithm has good security.As shown in Table 3, by comparing the NPCR and UACI values of [4,17,18,20], this algorithm is more sensitive to plaintext than the references listed in Table 3.Therefore, this algorithm can meet the security requirements and has good resistance to differential attack.
Security and Communication Networks diffusion are completed and the algorithm shows better statistical characteristics.The process of encryption and decryption is simple and easy to implement.In the design of this algorithm, some encryption keys are dependent on plaintext which increases the sensitivity of the algorithm to plaintext and improves the antiplaintext attack ability.The simulation results show that this algorithm has good security and strong antidamage ability.As a result, this algorithm has a very high application value in the field of image encryption.

Figure 5 :𝑖=1(
Figure 5: Correlation of pixel components in the diagonal direction of plaintext and ciphertext.

Figure 6 :
Figure 6: RGB components are represented by the distribution of adjacent elements diagonally.

Table 2 :
Comparison of information entropy.