Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

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

Abstract

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.

1 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 [13]. 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 [49]. 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 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 semi-tensor product theory and a Boolean network [1112]. However, many image encryption methods employ low-dimensional chaotic systems [1316]. 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 [1721]. 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.

2 5D hyperchaotic system and chaotic sequence generation

2.1 5D hyperchaotic system

A 5D hyperchaotic system [25] can be described as follows: (1) where a1, a2, a3, a4, a5, a6 and a7 are system parameters. When a1 = 10, a2 = 1, a3 = 28, a4 = 8/3, a5 = 2, a6 = -1 and a7 = 1, the 5D hyperchaotic system is in a chaotic state and can produce five chaotic sequences. The sequence trajectories of system (1) are displayed in Fig 1.

thumbnail
Fig 1. Sequence trajectories of system (1) with (a1, a2, a3, a4, a5, a6, a7) = (10, 1, 28, 8/3, 2, -1, 1).

https://doi.org/10.1371/journal.pone.0242110.g001

2.2 Preprocessing of chaotic sequences

1. Calculate the initial values of system (1) as follows: (2) where , , , and 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 N0 times to eliminate the transient response. (3) 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: X = [x1, x2, …, xMN/4], Y = [y1, y2, …, yMN/4], Z = [z1, z2, …, zMN/4], U = [u1, u2, …, uMN/4], and V = [v1, v2, …, vMN/4].

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, A1 = {Y, Z, V, X}, A2 = {X, V, Z, U}, A3 = {V, X, Z, Y} and A4 = {U, Y, Z, V}.

5. Sequences A1, A2 and A3 are rearranged to form new sequences A1’, A2’ and A3’, respectively. The processes of these rearrangements are demonstrated in Eqs 4 and 5. (4) (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.

3 Confusion and diffusion methods

3.1 Confusion method

1. The sequence of A1 is modified first as Eq 6. (6) where i = 1, 2, …, MN, and abs(x) is the absolute value of x.

2. Suppose i and i are the positions of plain image P. The corresponding confusion image is denoted as P, and it is calculated as follows: (7) where i = 1, 2, …, MN, and P(0) is designated as the initial secret key.

3. The scrambling method is executed as (8) 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.

3.2 Diffusion method

1. The sequences and are modified as Eqs 9 and 10. (9) (10) where ϵ[0, 7], ϵ[0, 255] and i = 1, 2, …, MN.

2. Convert decimal sequences P’ and into the corresponding binary sequences.

3. Sequence Q is obtained by Eq 11. (11) 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 1214. (12) (13) (14) where Q(i), (i), C(i) and C(i-1) represent the decimal sequence value, chaotic sequence value, diffusion sequence value and previous diffusion value, respectively, and i = 2, 3, …, MN.

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.

4 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.3 GHz and 8.00 GB RAM. The initial values of the 5D chaotic system are = 2.2356, = 1.9057, = 0.7468, = 2.1577, = 0.9723 and P(0) = 128. The 256×256 gray images “Boat”, “Tiffany” and “Peppers” are used as the plain images. The plain, cipher and deciphered images are shown in Fig 3.

thumbnail
Fig 3. Encryption and decryption results.

(a) Boat (b) Cipher image, (c) Decoded image, (d) Tiffany, (e) Cipher image, (f) Decoded image, (g) Pepper (h) Cipher image, (i) Decoded image.

https://doi.org/10.1371/journal.pone.0242110.g003

4.1 Key space analysis

In this paper, the key space is determined by the initial values of the 5-D hyperchaotic system {xi0, i = 1, 2, …, 5}. If the precision of the system is 10−15, the key space is approximately (1015)5 = 1075≈2249. It is larger than 2100, 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.

thumbnail
Table 1. Key space results comparison with other methods.

https://doi.org/10.1371/journal.pone.0242110.t001

4.2 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.

thumbnail
Fig 4.

The key sensitivity test: (a) cipher image with x1 changed to x1+10−15; (b) cipher image with x2 changed to x2+10−15; (c) deciphered image with x4 changed to x4+10−15; (d) deciphered image with x5 changed to x5+10−15.

https://doi.org/10.1371/journal.pone.0242110.g004

Key x1 is changed to x1+10−15, and the cipher image is displayed in Fig 4(A). The value of x2 is modified to x2+10−15, and the corresponding cipher image is shown in Fig 4(B). The value of x4 is altered to x4+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 x5 is altered to x5+10−15. Table 2 shows the differences between the different cipher and decipher images.

thumbnail
Table 2. Differences between the cipher and decipher images with minor key modifications.

https://doi.org/10.1371/journal.pone.0242110.t002

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.

4.3 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.

thumbnail
Fig 5. Histogram of the plain and cipher images.

(a) Boat's histogram (b) Boat's cipher histogram, (c) Tiffany's histogram, (d) Tiffany's cipher histogram, (e) Pepper's histogram, (f) Pepper's cipher histogram.

https://doi.org/10.1371/journal.pone.0242110.g005

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.

4.4 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, rxy, between two adjacent pixels, x and y, is defined as: (15) (16) (17) 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.

thumbnail
Fig 6. Correlation between the plain image Pepper and the cipher image in three directions.

(a) Horizontal direction of the plain image, (b) Horizontal direction of the cipher image, (c) Vertical direction of the plain image, (d) Vertical direction of the cipher image, (e) Diagonal direction of the plain image, (f) Diagonal direction of the cipher image.

https://doi.org/10.1371/journal.pone.0242110.g006

Table 4 displays the correlation coefficients of the plain image Pepper and the cipher image.

thumbnail
Table 4. Correlation coefficients of the adjacent pixels in the Pepper image.

https://doi.org/10.1371/journal.pone.0242110.t004

4.5 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: (18) where p(mi) represents the frequency of symbol mi, and L denotes the number of mi. 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.

4.6 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: (19) (20) (21) where M and N denote the width and height of the image, respectively, and C1 and C2 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.

4.7 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.

thumbnail
Fig 7. Recovery after different degrees of cropping attacks.

(a) 1/8 cropped, (b) 1/4 cropped, (c) 1/2 cropped, (d) deciphered of (a), (e) deciphered of (b), (f) deciphered of (c).

https://doi.org/10.1371/journal.pone.0242110.g007

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.

thumbnail
Fig 8. Decryption results with different noise.

(a) Gaussian v = 0.001, (b) Gaussian v = 0.005, (c) Gaussian v = 0.01, (d) Salt and pepper d = 0.001, (e) Salt and pepper d = 0.005, (f) Salt and pepper d = 0.01.

https://doi.org/10.1371/journal.pone.0242110.g008

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: (22) (23) 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.

thumbnail
Table 7. PSNR values of different schemes with different percentages of salt and pepper noise.

https://doi.org/10.1371/journal.pone.0242110.t007

thumbnail
Table 8. PSNR values of different schemes with different percentages of data loss.

https://doi.org/10.1371/journal.pone.0242110.t008

It can be seen from Tables 7 and 8 that the proposed algorithm obtains higher PSNR values than those in [3234] when decrypting images under noise and cropping attacks. Therefore, the proposed scheme is superior to the comparative ones.

4.8 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 xi0 (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.

4.9 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.

5 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 high-security method that can be used in practical applications.

References

  1. 1. Zhang YQ, Wang XY. A symmetric image encryption algorithm based on mixed linear-nonlinear coupled map lattice. Inform. Sciences, 2014, 273: 329–351.
  2. 2. Wang XY, Zhang YQ, Bao XM. A novel chaotic image encryption scheme using DNA sequence operations. Opt. Laser. Eng., 2015, 73:53–61.
  3. 3. Wang XY, Teng L, Qin X. A novel colour image encryption algorithm based on chaos. Signal Process., 2012, 92(4):1101–1108.
  4. 4. Gao HJ, Zhang YS, Liang SY, Li DQ. A new chaotic algorithm for image encryption. Chaos Soliton. Fract., 2006, 29(2):393–399.
  5. 5. Wang XY, Zhang HL. A color image encryption with heterogeneous bit-permutation and correlated chaos. Opt. Commun.,2015, 342:51–60.
  6. 6. Sun SL. Chaotic image encryption scheme using two-by-two deoxyribonucleic Acid complementary rules. Opt. Eng., 2017, 56(11):116117.
  7. 7. Liu HJ, Wang XY. Color image encryption based on one-time keys and robust chaotic maps. Comput. Math. Appl., 2010, 59(10):3320–3327.
  8. 8. Liu HJ, Wang XY, Kadir A. Image encryption using DNA complementary rule and chaotic maps. Appl. Soft Comput., 2012, 12(5):1457–1466.
  9. 9. Wang XY, Yang L, Liu R, Kadir A. A chaotic image encryption algorithm based on perceptron model. Nonlinear Dynam., 2010, 62(3):615–621.
  10. 10. Wang XY, Feng L, Zhao HY. Fast image encryption algorithm based on parallel computing system. Inform. Sciences, 2019, 486:340–358.
  11. 11. Wang XY, Gao S. Image encryption algorithm for synchronously updating Boolean networks based on matrix semi-tensor product theory. Inform. Sciences, 2020, 507:16–36.
  12. 12. Wang XY, Gao S. Image encryption algorithm based on the matrix semi-tensor product with a compound secret key produced by a Boolean network. Inform. Sciences, 2020, 539: 195–214.
  13. 13. Zhang YQ, Wang XY. A new image encryption algorithm based on non-adjacent coupled map lattices. Appl. Soft Comput., 2015, 26: 10–20.
  14. 14. Wang XY, He GX. Cryptanalysis on a novel image encryption method based on total shuffling scheme. Opt. Commun., 2011, 284(24):5804–5807.
  15. 15. Wang XY, Liu LT, Zhang YQ. A novel chaotic block image encryption algorithm based on dynamic random growth technique. Opt. Laser. Eng., 2015, 66:10–18.
  16. 16. Lima J B, Lima E A O, Madeiro F. Image encryption based on the finite field cosine transform. Signal Process., 2013, 28(10):1537–1547.
  17. 17. Liu HJ, Wang XY. Color image encryption using spatial bit-level permutation and high-dimension chaotic system. Opt. Commun., 2011, 284(16–17): 3895–3903.
  18. 18. Ye GD, Wong K. W. An image encryption scheme based on time-delay and hyperchaotic system. Nonlinear Dynam.,2013, 71(1–2):259–267.
  19. 19. Sun SL. A novel hyperchaotic image encryption scheme based on DNA encoding, pixel-level scrambling and bit-level scrambling. IEEE Photonics J., 2018, 10(2):7201714.
  20. 20. Chen JX, Zhu ZL, Fu C, Yu H, Zhang LB. A fast chaos-based image encryption scheme with a dynamic state variables selection mechanism. Commun. Nonlinear Sci., 2015, 20(3): 846–860.
  21. 21. Luo YL, Zhou RL, Liu JX, Cao Y, Ding XM. A parallel image encryption algorithm based on the piecewise linear chaotic map and hyper-chaotic map. Nonlinear Dynam., 2018, 93(3): 1165–1181.
  22. 22. Liu HJ, Kadir A. Asymmetric color image encryption scheme using 2D discrete-time map. Signal Process., 2015, 113:104–112.
  23. 23. Sun SL, Guo YN, Wu RK. A novel image encryption scheme based on 7D hyperchaotic system and row-column simultaneous swapping. IEEE Access, 2019, 7: 28539–28547.
  24. 24. Sun SL, Guo YN, Wu RK. A novel plaintext-related image encryption algorithm based on stochastic signal insertion and block swapping. IEEE Access, 2019, 7: 123049–123060.
  25. 25. Yang QG, Bai ML. A new 5D hyperchaotic system based on modified generalized Lorenz system. Nonlinear Dynam., 2017, 88(1):189–221.
  26. 26. Chai XL, Yang K, Gan ZH. A new chaos-based image encryption algorithm with dynamic key selection mechanisms. Multimed. Tools Appl., 2017, 76(7):9907–9927.
  27. 27. Li YP, Wang CH, Chen H. A hyper-chaos-based image encryption algorithm using pixel-level permutation and bit-level permutation. Opt. Laser. Eng., 2017, 90:238–246.
  28. 28. Chai XL, Chen YR, Broyde L. A novel chaos-based image encryption algorithm using DNA sequence operations. Opt. Laser. Eng., 2017, 88:197–213.
  29. 29. Xu L, Gou X, Li Z, Li J. A novel chaotic image encryption algorithm using block scrambling and dynamic index based diffusion. Opt. Laser. Eng., 2017, 91:41–52.
  30. 30. Rehman A U, Liao XF, Kulsoom A, Abbas S A. Selective encryption for gray images based on chaos and DNA complementary rules. Multimed. Tools Appl., 2015, 74(13):4655–4677.
  31. 31. Chai XL, Han DJ, Lu Y, Chen YR, Gan ZH. A novel image encryption algorithm based on the chaotic system and DNA computing. Int. J. Mod. Phys. C, 2017, 28(5):1750069.
  32. 32. Hua ZY, Yi S, Zhou YC. Medical image encryption using high-speed scrambling and pixel adaptive diffusion. Signal Process., 2018, 144:134–144.
  33. 33. Hua ZY, Zhou YC. Design of image cipher using block-based scrambling and image filtering. Inform. Sciences, 2017, 396:97–113.
  34. 34. Belazi A, Talha M, Kharbech S, Xiang W. Novel medical image encryption scheme based on chaos and DNA encoding. IEEE Access, 2019, 7:36667–36681.