A new secure image encryption algorithm based on a 5D hyperchaotic map

Image encryption is an effective method for protecting private images during communication. In this paper, a novel image encryption method is proposed based on a 5D hyperchaotic system. Since a 5D hyperchaotic system can generate more complex dynamic behavior than a low-dimensional system, it is used in this paper to generate pseudorandom number sequences. The generated sequences are processed to obtain new sequences. The randomness of the new sequences is improved by recombination and rearrangement. The experimental results and theoretical analysis show that the method possesses a large key space and can resist differential attacks, statistical analysis, entropy analysis, clipping attacks and noise attacks. Therefore, it is very secure and can be used for secure communication.


Introduction
With the rapid development of the Internet and communication technologies, researchers have focused increasingly more on information security. Images are known as one of the most important and popular multimedia technologies and are widely transmitted over the Internet. It is important to protect private images from hackers during communication. Image encryption is an effective method for protecting private images during communication, and many image encryption methods have been proposed [1][2][3]. Chaos is famous for its sensitivity to initial conditions and system parameters, pseudorandomness, ergodicity and reproduction. It is suitable for image encryption. Many chaotic image cryptosystems have been proposed [4][5][6][7][8][9]. Gao et al. [4] proposed a new nonlinear chaotic algorithm based on a power function and tangent function. The system parameters were obtained by experimental analysis. It is a one-time password system. Wang and Zhang [5] proposed a new color image encryption method based on bit permutations and correlated chaos. Heterogeneous a bit permutation process was adopted to reduce the computational cost and improve the permutation efficiency. An expanded XOR operation was also employed for the red (R), green (G) and blue (B) components of color images. Sun [6] proposed an image encryption scheme based on DNA operations and a chaotic map. A two-dimensional sine iterative chaotic map with an infinite collapse matrix was employed. An extended XOR operation was also applied to improve the a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 security of the system. Liu and Wang [7] proposed a color image encryption scheme based on one-time keys. Image encryption using the DNA complementary rule and chaotic system was proposed in [8]. Wang et al. [9] proposed a chaotic image encryption algorithm based on a perception model. A fast image encryption algorithm based on the perceptron model was proposed in [10]. Wang and Gao proposed an image encryption algorithm based on matrix semitensor product theory and a Boolean network [11][12]. However, many image encryption methods employ low-dimensional chaotic systems [13][14][15][16]. Low-dimensional chaotic systems have a small key space and parameters. They are not safe enough to use as an image cryptosystem.
A hyperchaotic system is a better image cryptosystem than a low-dimensional chaotic system. A hyperchaotic system has more than one positive Lyapunov exponent. It generates more complex dynamic behavior and higher randomness than low-dimensional chaotic systems [17][18][19][20][21]. Ye and Wong [18] designed an image encryption scheme based on a time delay and a hyperchaotic system. A permutation function and double diffusion operations were executed in both the forward and reverse directions. Sun [19] proposed a novel hyperchaotic image encryption algorithm based on pixel-level scrambling, bit-level scrambling and DNA encoding. A 5-D hyperchaotic system was executed to generate chaotic sequences. Chen [20] proposed a fast chaos-based image encryption scheme with a dynamic state variable selection mechanism. Liu and Kadir [22] proposed color image encryption using bit-level permutations and a high-dimensional chaotic system. Sun et al. [23,24] proposed a novel hyperchaotic image encryption method. Since a 5-D hyperchaotic system [25] has three positive Lyapunov exponents and generates more complex dynamic behavior than a low-dimensional system, we also adopt a 5-D hyperchaotic system to generate chaotic sequences in this paper. To eliminate the correlations between adjacent elements in chaotic sequences, the generated sequences are pretreated before being used for scrambling and diffusion. Compared with other encryption algorithms, the proposed method has advantages in efficiency and security.
In this paper, we propose a new image encryption method based on a 5D hyperchaotic system. First, a 5D hyperchaotic system is used to generate chaotic sequences. Then, chaotic sequences are preprocessed to obtain new sequences, which are used in the image confusion and diffusion processes.
The rest of this paper is organized as follows. The 5D hyperchaotic system and chaotic sequence generation are introduced in Section 2. The confusion and diffusion methods are described in Section 3. Section 4 discusses the experimental results and safety analysis. The conclusions are given in Section 5.

Preprocessing of chaotic sequences
1. Calculate the initial values of system (1) as follows: where x 0 1 , x 0 2 , x 0 3 , x 0 4 and x 0 5 are the initial secret keys, and mod (x, y) represents the residue of x divided by y. The row and column of original plain image P are M and N.
2. System (1) is iterated N 0 times to eliminate the transient response.
where floor (x) returns the nearest integer value less than or equal to x. 3. System (1) continues to iterate MN/4 times to generate five real-number sequences: 4. Four sequences are chosen from the five chaotic sequences, and they are combined to become a new sequence with the length MN. There are 120 kinds of arrangement modes according to an arrangement study. For example, 5. Sequences A 1 , A 2 and A 3 are rearranged to form new sequences A 1 ', A 2 ' and A 3 ', respectively. The processes of these rearrangements are demonstrated in Eqs 4 and 5.
where sort is a sorting function; i = 1, 2, . . ., MN; j = 1, 2, 3; g is the new sequence; and h is the index value of g.

Confusion method
1. The sequence of A 1 ' is modified first as Eq 6. The corresponding confusion image is denoted as P ' , and it is calculated as follows: where i = 1, 2, . . ., MN, and P ' (0) is designated as the initial secret key.
3. The scrambling method is executed as where P ' (i) is the scrambling image positioned at i, P(i') and P(i) are the plain images positioned at i' and i, respectively, for i = 1, 2,. . ., MN.

Diffusion method
1. The sequences A where CIRSFT [r, s, t] represents the t-bit cyclic shift on binary sequence r. LSB(t) represents the smallest bit of t. The left cyclic shift or right cyclic shift will be decided by s = 0 or s = 1. 4. Convert the binary sequence Q into its decimal sequence. 5. Diffusion sequence C is obtained by Eqs 12-14.
6. Convert C to a gray image P " . Finally, encrypted image P " is obtained. The flowchart of the image encryption procedure is displayed in Fig 2. The decryption algorithm is the reverse process of the encryption algorithm.

Experimental results and safety analysis
In this paper, MATLAB 2010b is applied to execute the algorithm. The experiments are executed on a computer with a Windows 7 operating system, inter(R) Core (TM) i3-3220, 3.

Key space analysis
In this paper, the key space is determined by the initial values of the 5-D hyperchaotic system {x i 0 , i = 1, 2, . . ., 5}. If the precision of the system is 10 −15 , the key space is approximately (10 15 ) 5 = 10 75 �2 249 . It is larger than 2 100 , so the proposed method could effectively resist a brute-force attack.
Other encryption schemes are compared with the proposed method in Table 1. It can be seen that the key space of the proposed method is much larger than those of Refs [26,31] but smaller than that of Ref [19]. Although the key space in Ref [19] is larger than that of our scheme, it has more secret keys and is more complex.

Key sensitivity analysis
An excellent cryptosystem should be sensitive to the initial keys. Two completely different cipher images can be produced if a minor change (10 −15 ) is made and the other four keys are unchanged. The cipher image also cannot be decrypted correctly if even a slight change (10 −15 ) is made between the encryption and decryption keys. The key sensitivity test is shown in Fig 4. Key x 1 is changed to x 1 +10 −15 , and the cipher image is displayed in Fig 4(A). The value of x 2 is modified to x 2 +10 −15 , and the corresponding cipher image is shown in Fig 4(B). The value of x 4 is altered to x 4 +10 −15 to decipher Fig 3(H), and the deciphered image is shown in Fig 4(C). Fig 4(D) is the deciphered image when x 5 is altered to x 5 +10 −15 . Table 2 shows the differences between the different cipher and decipher images.
It can be concluded that a small difference in the secret key will generate a completely different cipher image. It also cannot extract the correct deciphered image. If the secret key and plain image have a slight alteration, it is impossible to decrypt the plain image. The pixels differ by approximately 99.6% between the original image and the decrypted image.

Histogram analysis
The histogram of the cipher image should be as uniform as possible. In the proposed method, the histograms of the plain and cipher images of Boat, Tiffany and Pepper are displayed in Fig  5. It is shown that the plain image pixel values are centralized around some values; however, the corresponding cipher image pixel values are very smooth and even. Therefore, it makes a statistical attack ineffective.
The chi-square test [27,28] is often used to measure the uniformity of the histogram. The chi-square results are listed in Table 3 for different cipher images.
It can be shown from Table 3 that all values generated by the proposed method are smaller than the theoretical value of 293.25 [29,30]. It can be proven that the distribution of the histogram is flat, and the proposed method could pass the chi-square test.

Correlation analysis
The plain image pixel has a great correlation with its neighboring pixels. An excellent cryptosystem should reduce this correlation to close to zero. The correlation coefficient, r xy , between  two adjacent pixels, x and y, is defined as: Table 2. Differences between the cipher and decipher images with minor key modifications.  A total of 7225 pairs of adjacent pixels in the "Pepper" plain and cipher images are selected in the horizontal, vertical and diagonal directions. Fig 6 displays the correlation between two adjacent pixels in the plain image Pepper and the corresponding cipher image. It can be concluded that the pixels are highly correlated in the original image, while the correlation is considerably reduced in the cipher image. Table 4 displays the correlation coefficients of the plain image Pepper and the cipher image.

Information entropy analysis
Information entropy is the most important characteristic of randomness. If m is the information source, the information entropy can be defined as follows: where p(m i ) represents the frequency of symbol m i , and L denotes the number of m i . The information entropy data of the cipher image are shown in Table 5. As displayed in Table 5, the information entropies of the cipher images are close to 8 bits. This also means that the ciphered image with our algorithm is very uniform. This result demonstrates that our method can resist entropy attacks. It can also be found that our algorithm is better than other similar methods.

Differential attack analysis
NPCR and UACI are two important parameters that are often employed to measure the sensitivity to plaintext [26]. These are defined as follows: Dði; jÞ � 100% ð19Þ Dði; jÞ ¼ 0; if C 1 ði; jÞ ¼ C 2 ði; jÞ ( where M and N denote the width and height of the image, respectively, and C 1 and C 2 represent the ciphered images before and after one pixel of the plain image is modified, respectively. The values of NPCR and UACI are shown in Table 6. It can be concluded that the proposed algorithm can effectively resist differential attacks.

Clipping and noise attack analysis
A good cryptosystem should be designed to resist noise attacks and clipping attacks. The ciphered Pepper image of Fig 2(H) is cropped by 1/8, 1/4 and 1/2, and the decryption results are shown in Fig 7. Salt and pepper noise and white Gaussian noise are added to the ciphered Pepper image in Fig 2(H), and the deciphered images are shown in Fig 8. When the variance of the white Gaussian noise is increased from 0.001 to 0.01, more noise points appear in the deciphered image, but the deciphered image is still recognizable. Similar results were obtained for the salt and pepper noise.
The results prove that the proposed method effectively resists cropping and noise attacks. The peak signal-to-noise ratio (PSNR) is used to measure the ability of the method to resist noise and data loss [32]. It is adopted to measure the difference between plain image I and cipher image I'. The PSNR is defined as follows: PSNR ¼ 20log 10 255 ffi ffi ffi ffi ffi ffi ffi ffi ffiffi MSE p ð22Þ The higher the value of the PSNR is, and the smaller the difference between I and I'. The results are shown in Tables 7 and 8. It can be seen from Tables 7 and 8 that the proposed algorithm obtains higher PSNR values than those in [32][33][34] when decrypting images under noise and cropping attacks. Therefore, the proposed scheme is superior to the comparative ones.

Classical types of attacks
There are four classical types of attacks: ciphertext only, known plaintext, chosen ciphertext, and chosen plaintext. If a cryptosystem can resist a chosen plaintext attack, then it will be able to resist other attacks [3].
The proposed method is sensitive to initial values x i 0 (i = 1, 2, 3, 4, 5) and the plain image. If one of them is changed, then the generated chaotic sequences will be completely different. The ciphered value not only connects to the confused pixel but also connects to the former confused pixel value and former ciphered value. This means that different ciphered values have different former confused values and different ciphered values. Therefore, the proposed scheme could defend against chosen plaintext attacks.

Encryption time analysis
The results of the comparison are shown in Table 9. As shown in Table 9, the proposed method requires the least encryption time compared with the other algorithms. Thus, our proposed method has better performance than other schemes.

Conclusion
In this paper, a novel image encryption scheme is proposed based on a 5D hyperchaotic system. First, chaotic sequences are produced by a 5D hyperchaotic system based on initial secret keys. Then, the chaotic sequences are preprocessed to obtain new chaotic sequences. They are modified so that they can be used in confusing and diffusing the image. A cycle shift is executed to improve the security of the cryptosystem. The experimental results and theoretical analysis demonstrate that the method has a large key space and resists differential attacks, brute-force attacks, statistical attacks, clipping attacks and noise attacks. Therefore, it is a highsecurity method that can be used in practical applications.