A New Secure Image Encryption Algorithm Based On A
A New Secure Image Encryption Algorithm Based On A
RESEARCH ARTICLE
Abstract
Image encryption is an effective method for protecting private images during communica-
tion. In this paper, a novel image encryption method is proposed based on a 5D hyperchao-
tic system. Since a 5D hyperchaotic system can generate more complex dynamic behavior
a1111111111 than a low-dimensional system, it is used in this paper to generate pseudorandom number
a1111111111
sequences. The generated sequences are processed to obtain new sequences. The ran-
a1111111111
a1111111111 domness of the new sequences is improved by recombination and rearrangement. The
a1111111111 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.
OPEN ACCESS
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 pro-
posed in [10]. Wang and Gao proposed an image encryption algorithm based on matrix semi-
tensor product theory and a Boolean network [11–12]. However, many image encryption
methods employ low-dimensional chaotic systems [13–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 sys-
tem. 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–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 encod-
ing. A 5-D hyperchaotic system was executed to generate chaotic sequences. Chen [20] pro-
posed 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 sys-
tem. 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.
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.
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
where x10 , x20 , x30 , x40 and x50 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.
! !
X5
0 10
N0 ¼ 300 þ mod floor xi � 10 ; 300 ð3Þ
i¼1
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’, respec-
tively. The processes of these rearrangements are demonstrated in Eqs 4 and 5.
0
Aj ðiÞ ¼ Aj ðhðiÞÞ; ð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.
where P’(i) is the scrambling image positioned at i, P(i’) and P(i) are the plain images posi-
tioned at i’ and i, respectively, for i = 1, 2,. . ., MN.
� �
0 0
A3 ðiÞ ¼ mod floorðabsðA3 ðiÞÞ � 1015 Þ; 256 ð10Þ
0 0
where A2 ðiÞ�[0, 7], A3 ðiÞ�[0, 255] and i = 1, 2, . . ., MN.
0
2. Convert decimal sequences P’ and A2 into the corresponding binary sequences.
3. Sequence Q is obtained by Eq 11.
� 0 0 �
QðrÞ ¼ CIRSFT P0 ðrÞ; LSBðA2 ðrÞÞ; A2 ðrÞ ð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 12–14.
! !
X 5 0
P ð0Þ
0 15
sum ¼ floor xj þ � 10 ð12Þ
j¼1
256
0 0
Cð1Þ ¼ A3 ð1Þ � modðA3 ð1Þ þ Qð1Þ; 256Þ � modðsum; 256Þ ð13Þ
0 0
CðiÞ ¼ A3 ðiÞ � modðA3 ðiÞ þ QðiÞ; 256Þ � Cði 1Þ ð14Þ
0
where Q(i), A3 (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.
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
https://doi.org/10.1371/journal.pone.0242110.t001
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
Table 2. Differences between the cipher and decipher images with minor key modifications.
https://doi.org/10.1371/journal.pone.0242110.t002
1X N
1X N
2
EðxÞ ¼ xi ; DðxÞ ¼ ðx EðxÞÞ ð15Þ
N i¼1 N i¼1 i
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
https://doi.org/10.1371/journal.pone.0242110.t003
1X N
covðx; yÞ ¼ ðx EðxÞÞðyi EðyÞÞ ð16Þ
N i¼1 i
covðx; yÞ
rxy ¼ pffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ð17Þ
DðxÞDðyÞ
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 con-
cluded that the pixels are highly correlated in the original image, while the correlation is con-
siderably reduced in the cipher image.
Table 4 displays the correlation coefficients of the plain image Pepper and the cipher image.
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
https://doi.org/10.1371/journal.pone.0242110.t004
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 dem-
onstrates that our method can resist entropy attacks. It can also be found that our algorithm is
better than other similar methods.
1 X M X N
NPCR ¼ Dði; jÞ � 100% ð19Þ
M � N i¼1 j¼1
1 X M X N
jC1 ði; jÞ C2 ði; jÞj
UACI ¼ � 100% ð20Þ
M � N i¼1 j¼1 255
(
0; if C1 ði; jÞ ¼ C2 ði; jÞ
Dði; jÞ ¼ ð21Þ
1; else
where M and N denote the width and height of the image, respectively, and C1 and C2 repre-
sent the ciphered images before and after one pixel of the plain image is modified, respectively.
https://doi.org/10.1371/journal.pone.0242110.t005
The values of NPCR and UACI are shown in Table 6. It can be concluded that the proposed
algorithm can effectively resist differential attacks.
2
1 XM X N
0
MSE ¼ ðI Iij Þ ð23Þ
MN i¼1 j¼1 ij
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–34] when decrypting images under noise and cropping attacks. Therefore,
the proposed scheme is superior to the comparative ones.
https://doi.org/10.1371/journal.pone.0242110.t006
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
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
Table 7. PSNR values of different schemes with different percentages of salt and pepper noise.
https://doi.org/10.1371/journal.pone.0242110.t007
Table 8. PSNR values of different schemes with different percentages of data loss.
https://doi.org/10.1371/journal.pone.0242110.t008
https://doi.org/10.1371/journal.pone.0242110.t009
5 Conclusion
In this paper, a novel image encryption scheme is proposed based on a 5D hyperchaotic sys-
tem. 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 exe-
cuted 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.
Supporting information
S1 Material.
(RAR)
Author Contributions
Visualization: Dejian Fang.
Writing – original draft: Shuliang Sun.
References
1. Zhang YQ, Wang XY. A symmetric image encryption algorithm based on mixed linear-nonlinear cou-
pled map lattice. Inform. Sciences, 2014, 273: 329–351.
2. Wang XY, Zhang YQ, Bao XM. A novel chaotic image encryption scheme using DNA sequence opera-
tions. Opt. Laser. Eng., 2015, 73:53–61.
3. Wang XY, Teng L, Qin X. A novel colour image encryption algorithm based on chaos. Signal Process.,
2012, 92(4):1101–1108.
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. Wang XY, Zhang HL. A color image encryption with heterogeneous bit-permutation and correlated
chaos. Opt. Commun.,2015, 342:51–60.
6. Sun SL. Chaotic image encryption scheme using two-by-two deoxyribonucleic Acid complementary
rules. Opt. Eng., 2017, 56(11):116117.
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. Liu HJ, Wang XY, Kadir A. Image encryption using DNA complementary rule and chaotic maps. Appl.
Soft Comput., 2012, 12(5):1457–1466.
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. Wang XY, Feng L, Zhao HY. Fast image encryption algorithm based on parallel computing system.
Inform. Sciences, 2019, 486:340–358.
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. Wang XY, Gao S. Image encryption algorithm based on the matrix semi-tensor product with a com-
pound secret key produced by a Boolean network. Inform. Sciences, 2020, 539: 195–214.
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. Wang XY, He GX. Cryptanalysis on a novel image encryption method based on total shuffling scheme.
Opt. Commun., 2011, 284(24):5804–5807.
15. Wang XY, Liu LT, Zhang YQ. A novel chaotic block image encryption algorithm based on dynamic ran-
dom growth technique. Opt. Laser. Eng., 2015, 66:10–18.
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. Liu HJ, Wang XY. Color image encryption using spatial bit-level permutation and high-dimension cha-
otic system. Opt. Commun., 2011, 284(16–17): 3895–3903.
18. Ye GD, Wong K. W. An image encryption scheme based on time-delay and hyperchaotic system. Non-
linear Dynam.,2013, 71(1–2):259–267.
19. Sun SL. A novel hyperchaotic image encryption scheme based on DNA encoding, pixel-level scram-
bling and bit-level scrambling. IEEE Photonics J., 2018, 10(2):7201714.
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. Luo YL, Zhou RL, Liu JX, Cao Y, Ding XM. A parallel image encryption algorithm based on the piece-
wise linear chaotic map and hyper-chaotic map. Nonlinear Dynam., 2018, 93(3): 1165–1181.
22. Liu HJ, Kadir A. Asymmetric color image encryption scheme using 2D discrete-time map. Signal Pro-
cess., 2015, 113:104–112.
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. Sun SL, Guo YN, Wu RK. A novel plaintext-related image encryption algorithm based on stochastic sig-
nal insertion and block swapping. IEEE Access, 2019, 7: 123049–123060.
25. Yang QG, Bai ML. A new 5D hyperchaotic system based on modified generalized Lorenz system. Non-
linear Dynam., 2017, 88(1):189–221.
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. Li YP, Wang CH, Chen H. A hyper-chaos-based image encryption algorithm using pixel-level permuta-
tion and bit-level permutation. Opt. Laser. Eng., 2017, 90:238–246.
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. 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. 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. 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. Hua ZY, Yi S, Zhou YC. Medical image encryption using high-speed scrambling and pixel adaptive diffu-
sion. Signal Process., 2018, 144:134–144.
33. Hua ZY, Zhou YC. Design of image cipher using block-based scrambling and image filtering. Inform.
Sciences, 2017, 396:97–113.
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.