An Image Encryption Algorithm Using Cascade Chaotic Map and S-Box
Abstract
:1. Introduction
2. Introduction of Chaotic Map
2.1. Cascade Chaotic Map
2.2. Performance Evaluation
2.2.1. Chaotic Trajectory
2.2.2. Bifurcation Diagram
2.2.3. Lyapunov Exponent
2.2.4. NIST Test
2.2.5. Information Entropy
3. New Encryption Algorithm Design
3.1. Keys Generation
Algorithm 1 Generation of the encryption keys |
Input: Plain image , initial keys Output: The encryption keys 1: Read the size: = size 2: Obtain the sum of all pixels and add scramble number 3: Calculate the mean of the all pixels 4: 5: 6: 7: 8: 9: |
3.2. S-Box Generation
3.2.1. S-Box Generation Algorithm
- Step 1:
- Obtain the length of the sequence that needs to be shuffled;
- Step 2:
- Generate a random number with a value between ;
- Step 3:
- Shuffle the values of the two positions according to and , then exchange the values of and ;
- Step 4:
- Subtract 1 from to obtain the new position;
- Step 5:
- Repeat step1~step4 until .
Algorithm 2 Generation of S-box |
Input: encryption keys
Output: S-box 1: for from to 1512: Substituting into Equation (1) if >1000: obtain the 512-length chaotic sequences 2: Divide into two subsequences of length 256 ; obtain the ascending sort index of the ; and assign it to and 3: Read the size: 4: while : Obtain a random number Swap the value of Set 5: If transform into matrix and assign it to 6: Obtain S-box |
3.2.2. Performance Test of the Proposed S-Box
3.3. Bit-Level Encryption
3.3.1. Pixel Value Split
3.3.2. Improved Diagonal Diffusion
Algorithm 3 Matrix rearrange |
Input: upper 4-bits sequence
, random sequence Output: irregular matrices 1: Obtain the size of , = size 2: Set an empty list and 3: While : 4: |
Algorithm 4 Diagonal diffusion order |
Input: irregular matrices
Output: order sequence 1: Obtain the size of = size 2: Set tow empty list , 3: for from 1 to : Obtain the size of for from 1 to : 4: Obtain the size of 5: for from 1 to : Obtain the size of ) for from 1 to : |
3.3.3. Permutation and Diffusion Process
- Step 1:
- Generate S-boxes according to the S-box generation method proposed in Section 3.2.;
- Step 2:
- Generate the encryption key and process the image to obtain according to Algorithm 1 and ;
- Step 3:
- Iterate over as the control parameter and initial value of the 2D-CLSM chaos map to generate two chaotic sequences of length ;
- Step 4:
- Process the chaotic sequence to obtain the random numbers for array rearrangement;
- Step 5:
- Based on the resulting upper 4-bit matrix and the random sequence , the upper 4-bit matrix is rearranged by Algorithm 3 to obtain a new irregular matrix ;
- Step 6:
- Perform a diffusion operation on the irregular matrix obtained in step 4. For computational convenience, we first transform the irregular matrix into a one-dimensional matrix by means of Algorithm 4;
- Step 7:
- Diffusion operation based on the 1D matrix obtained in step 6 to obtain ;
- Step 8:
- Process the chaotic sequence to obtain chaotic values for the lower four positions;
- Step 9:
- Based on the resulting the lower four bits of the matrix are permutated.
3.3.4. Pixel-Level Encryption
4. Simulation Experiments
4.1. Security Analysis
4.1.1. Key Space Analysis
4.1.2. Key Sensitivity Analysis
4.1.3. Histogram Analysis
4.1.4. Plaintext Sensitivity Analysis
4.1.5. Correlation Analysis
4.1.6. Information Entropy Analysis
4.1.7. Anti-Cropping Attack Analysis
4.1.8. Speed Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Wang, M.; Liu, H.; Zhao, M. Bit-level image encryption algorithm based on random-time S-Box substitution. Eur. Phys. J. Spec. Top. 2022, 24, 3225–3237. [Google Scholar] [CrossRef]
- Xiang, H.; Liu, L. An improved digital logistic map and its application in image encryption. Multimed. Tools Appl. 2020, 79, 30329–30355. [Google Scholar] [CrossRef]
- Ratan, R.; Yadav, A. Security analysis of bit-plane level image encryption schemes. Def. Sci. J. 2021, 71, 209–221. [Google Scholar] [CrossRef]
- Pareek, N.K.; Patidar, V.; Sud, K.K. Image encryption using chaotic logistic map. Image Vis. Comput. 2006, 24, 926–934. [Google Scholar] [CrossRef]
- Farhan, A.K.; Al-Saidi, N.M.G.; Maolood, A.T. Entropy analysis and image encryption application based on a new chaotic system crossing a cylinder. Entropy 2019, 21, 958. [Google Scholar] [CrossRef] [Green Version]
- Luo, Y.; Lin, J.; Liu, J. A robust image encryption algorithm based on Chua’s circuit and compressive sensing. Signal Process. 2019, 161, 227–247. [Google Scholar] [CrossRef] [Green Version]
- Zhou, W.; Wang, X.; Wang, M. A new combination chaotic system and its application in a new Bit-level image encryption scheme. Opt. Lasers Eng. 2022, 149, 106782. [Google Scholar] [CrossRef]
- Zheng, J.; Liu, L.F. Novel image encryption by combining dynamic DNA sequence encryption and the improved 2D logistic sine map. IET Image Process. 2020, 14, 2310–2320. [Google Scholar] [CrossRef]
- Lan, R.; He, J.; Wang, S. Integrated chaotic systems for image encryption. Signal Process. 2018, 147, 133–145. [Google Scholar] [CrossRef]
- Wang, T.; Ge, B.; Xia, C. Multi-Image Encryption Algorithm Based on Cascaded Modulation Chaotic System and Block-Scrambling-Diffusion. Entropy 2022, 24, 1053. [Google Scholar] [CrossRef]
- Adams, C.; Tavares, S. The structured design of cryptographically good s-boxes. J. Cryptol. 1990, 3, 27–41. [Google Scholar] [CrossRef]
- Arslan, S.; Fawad, A. Image encryption using dynamic S-box substitution in the wavelet domain. Wirel. Pers. Commun. 2020, 115, 2243–2268. [Google Scholar]
- Yang, C.; Wei, X.; Wang, C. S-Box design based on 2D multiple collapse chaotic map and their application in image encryption. Entropy 2021, 23, 1312. [Google Scholar] [CrossRef] [PubMed]
- Li, Y.; Ge, G.; Xia, D. Chaotic hash function based on the dynamic s-box with variable parameters. Nonlinear Dyn. 2016, 84, 2387–2402. [Google Scholar] [CrossRef]
- Zhou, S.; He, P.; Kasabov, N. A dynamic DNA color image encryption method based on SHA-512. Entropy 2020, 22, 1091. [Google Scholar] [CrossRef]
- Wang, X.; Yang, J. A novel image encryption scheme of dynamic s-boxes and random blocks based on spatiotemporal chaotic system. Optik 2020, 217, 164884. [Google Scholar] [CrossRef]
- Belazi, A.; El-Latif, A. A simple yet efficient S-box method based on chaotic sine map. Optik 2017, 130, 1438–1444. [Google Scholar] [CrossRef]
- Beg, S.; Baig, F.; Hameed, Y. Thermal image encryption based on laser diode feedback and 2D logistic chaotic map. Multimed. Tools Appl. 2022, 81, 26403–26423. [Google Scholar] [CrossRef]
- Liu, H.; Liu, J.; Ma, C. Constructing dynamic strong S-Box using 3D chaotic map and application to image encryption. Multimed. Tools Appl. 2022, 81, 12069. [Google Scholar] [CrossRef]
- Zheng, J.M.; Zeng, Q.X. An image encryption algorithm using a dynamic s-box and chaotic maps. Appl. Intell. 2022, 52, 15703–15717. [Google Scholar] [CrossRef]
- Özkaynak, F. Construction of robust substitution boxes based on chaotic systems. Neural Comput. Appl. 2019, 31, 3317–3326. [Google Scholar] [CrossRef]
- Wang, X.; Çavuşoğlu, Ü.; Kacar, S. S-Box based image encryption application using a chaotic system without equilibrium. Appl. Sci. 2019, 9, 781. [Google Scholar] [CrossRef] [Green Version]
- Wang, J.; Zhu, Y.; Zhou, C. Construction method and performance analysis of chaotic s-box based on a memorable simulated annealing algorithm. Symmetry 2020, 12, 2115. [Google Scholar] [CrossRef]
- Zhou, G.; Zhang, D.; Liu, Y. A novel image encryption algorithm based on chaos and Line map. Neurocomputing 2015, 169, 150–157. [Google Scholar] [CrossRef]
- Zhou, Y.; Hua, Z.; Pun, C.M. Cascade chaotic system with applications. IEEE Trans. Cybern. 2014, 45, 2001–2012. [Google Scholar] [CrossRef]
- Alawida, M.; Samsudin, A.; Teh, J.S. Digital cosine chaotic map for cryptographic applications. IEEE Access 2019, 7, 150609–150622. [Google Scholar] [CrossRef]
- Lu, Q.; Zhu, C.; Deng, X. An efficient image encryption scheme based on the LSS chaotic map and single s-box. IEEE Access 2020, 8, 25664–25678. [Google Scholar] [CrossRef]
- Hua, Z.Y. 2D Logistic-Sine-Coupling map for image encryption. Signal Process. 2018, 149, 148–161. [Google Scholar] [CrossRef]
- Zhang, Y. The unified image encryption algorithm based on chaos and cubic s-box. Inf. Sci. 2018, 450, 361–377. [Google Scholar] [CrossRef]
- Wang, X.; Su, Y.; Liu, L. Color image encryption algorithm based on Fisher-Yates scrambling and DNA subsequence operation. Vis. Comput. 2021, 37, 2311. [Google Scholar] [CrossRef]
- Liu, H.; Kadir, A.; Xu, C. Cryptanalysis and constructing S-box based on chaotic map and backtracking. Appl. Math. Comput. 2020, 376, 125153. [Google Scholar] [CrossRef]
- Farwa, S.; Muhammad, N. A Novel Image Encryption Based on Algebraic s-box and Arnold Transform. 3D Res. 2017, 8, 26. [Google Scholar] [CrossRef]
- Lu, Q.; Zhu, C.; Wang, G. A novel s-box design algorithm based on a new compound chaotic system. Entropy 2019, 21, 1004. [Google Scholar] [CrossRef] [Green Version]
- Biham, E.; Shamir, A. Differential cryptanalysis of DES-like cryptosystems. J. Cryptol. 1991, 4, 3–72. [Google Scholar] [CrossRef]
- Wang, X.; Du, X. Chaotic image encryption method based on improved zigzag permutation and DNA rules. Multimed. Tools Appl. 2022, 81, 13012. [Google Scholar] [CrossRef]
Serial Number | Test Items | 2D-CLSM | 2D-LSCM | ||
---|---|---|---|---|---|
p Value | Test Results | p Value | Test Results | ||
1 | Frequency | 0.1422 | Success | 0.0767 | Success |
2 | Block Frequency | 0.7165 | Success | 0.9936 | Success |
3 | Cumulative Sums | 0.2472 | Success | 0.0692 | Success |
4 | Runs | 0.8561 | Success | 0.7405 | Success |
5 | Longest Run of Ones | 0.7310 | Success | 0.4477 | Success |
6 | Rank | 0.1691 | Success | 0.1514 | Success |
7 | Discrete Fourier Transform | 0.8330 | Success | 0.1766 | Success |
8 | Nonperiodic Template Matchings | 0.6254 | Success | 0.4721 | Success |
9 | Overlapping Template Matchings | 0.6886 | Success | 0.9365 | Success |
10 | Universal | 0.9992 | Success | 0.9583 | Success |
11 | Approximate Entropy | 0.9309 | Success | 0.7040 | Success |
12 | Random Excursions | 0.1319 | Success | 0.2175 | Success |
13 | Random Excursion Variant | 0.1025 | Success | 0.4166 | Success |
14 | Serial | 0.9068 | Success | 0.1638 | Success |
15 | Linear Complexity | 0.9250 | Success | 0.5041 | Success |
S-Box | Generate Time | Fixed Point | After Fisher–Yates |
---|---|---|---|
Ref. [17] | 0.9415 | 2, 17, C7, CB | None |
Ref. [21] | 0.0487 | 0D, 33, 77, 95 | None |
Ref. [22] | 0.7593 | None | None |
i\j. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 100 | 62 | 60 | 203 | 217 | 27 | 159 | 103 | 77 | 112 | 134 | 236 | 2 | 167 | 219 | 96 |
1 | 228 | 29 | 18 | 170 | 113 | 39 | 64 | 127 | 87 | 90 | 1 | 160 | 94 | 183 | 7 | 125 |
2 | 199 | 54 | 55 | 193 | 104 | 246 | 146 | 129 | 79 | 14 | 162 | 137 | 237 | 63 | 191 | 174 |
3 | 148 | 115 | 109 | 99 | 225 | 13 | 202 | 187 | 17 | 250 | 185 | 41 | 110 | 25 | 139 | 177 |
4 | 50 | 15 | 76 | 238 | 114 | 34 | 12 | 107 | 207 | 222 | 45 | 102 | 249 | 75 | 220 | 200 |
5 | 98 | 195 | 47 | 0 | 151 | 51 | 67 | 3 | 82 | 230 | 184 | 204 | 241 | 117 | 35 | 130 |
6 | 36 | 254 | 156 | 196 | 227 | 178 | 248 | 68 | 145 | 31 | 126 | 149 | 153 | 5 | 43 | 181 |
7 | 19 | 157 | 30 | 154 | 121 | 231 | 86 | 201 | 239 | 101 | 189 | 72 | 69 | 71 | 119 | 37 |
8 | 131 | 11 | 118 | 10 | 83 | 24 | 215 | 140 | 247 | 74 | 38 | 152 | 46 | 206 | 8 | 106 |
9 | 59 | 208 | 164 | 150 | 136 | 192 | 255 | 9 | 84 | 235 | 229 | 88 | 213 | 171 | 147 | 92 |
A | 166 | 48 | 97 | 28 | 224 | 180 | 23 | 144 | 85 | 4 | 190 | 122 | 111 | 173 | 108 | 243 |
B | 52 | 188 | 210 | 209 | 197 | 58 | 182 | 233 | 143 | 40 | 26 | 163 | 33 | 244 | 218 | 211 |
C | 120 | 89 | 20 | 16 | 124 | 57 | 53 | 232 | 142 | 179 | 73 | 172 | 22 | 44 | 175 | 70 |
D | 176 | 212 | 32 | 216 | 91 | 194 | 49 | 245 | 155 | 80 | 161 | 234 | 141 | 42 | 226 | 198 |
E | 186 | 135 | 205 | 61 | 240 | 123 | 223 | 251 | 105 | 21 | 95 | 133 | 253 | 221 | 252 | 242 |
F | 66 | 93 | 169 | 116 | 81 | 165 | 78 | 128 | 138 | 132 | 214 | 56 | 65 | 6 | 168 | 158 |
S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | |
---|---|---|---|---|---|---|---|---|
NL(s) | 108 | 106 | 108 | 106 | 108 | 108 | 110 | 106 |
0.4196 | 0.4235 | 0.4196 | 0.5647 | 0.4823 | 0.5137 | 0.5450 | 0.5294 |
0.4549 | 0.5019 | 0.4509 | 0.5019 | 0.5490 | 0.4705 | 0.4352 | 0.5176 |
0.5960 | 0.4862 | 0.4980 | 0.5137 | 0.5607 | 0.5333 | 0.5607 | 0.5176 |
0.4980 | 0.5137 | 0.5490 | 0.4980 | 0.4392 | 0.4862 | 0.5450 | 0.5490 |
0.5019 | 0.5294 | 0.5294 | 0.4980 | 0.4392 | 0.4862 | 0.5450 | 0.5490 |
0.5019 | 0.4509 | 0.5647 | 0.5176 | 0.5137 | 0.4980 | 0.5137 | 0.4392 |
0.4666 | 0.5333 | 0.4823 | 0.4235 | 0.4549 | 0.5450 | 0.5294 | 0.4235 |
0.4705 | 0.5333 | 0.4823 | 0.4549 | 0.5490 | 0.5294 | 0.5019 | 0.4980 |
S-Box | Nonlinearity | SAC | BIC-SAC | BIC-Nonlinearity | DP | Generate Time | ||
---|---|---|---|---|---|---|---|---|
Min | Max | Avg | ||||||
ours | 106 | 110 | 107.5 | 0.4996 | 0.5009 | 104 | 10 | 0.0066 |
Ref. [18] | 100 | 106 | 104 | 0.4988 | 0.5006 | 104 | 10 | 0.3071 |
Ref. [19] | 102 | 108 | 104 | 0.4988 | 0.5052 | 104 | 10 | 0.0091 |
Ref. [20] | 106 | 108 | 106 | 0.4916 | 0.5058 | 104.14 | 10 | 0.0160 |
Ref. [22] | 99 | 106 | 103.5 | 0.5065 | 0.5013 | 103.357 | 12 | 0.7593 |
t | μ | θ | x | y | Δm |
---|---|---|---|---|---|
0.9 | 0.5 | 0.2 | 0.5 | 0.2 | 5001 |
Image | Baboon | House | Cameraman | Peppers |
---|---|---|---|---|
0.1202650498467574 | 0.9477909907361988 | 0.2160499006239973 | 0.0961937648047185 | |
0.9349678430636638 | 0.9505574749633823 | 0.9210123850695779 | 0.9032945073229159 | |
0.0664003944646814 | 0.6920508714375233 | 0.2309975836114158 | 0.977565451998436 | |
0.0264462005880243 | 0.4490902428109265 | 0.1811279735456482 | 0.1440190683132808 | |
0.0664003944646814 | 0.6920508714375233 | 0.2309975836114158 | 0.977565451998436 | |
20.512754134641057 | 16.49739814853646 | 22.592144200059774 | 11.400485742889497 |
Image | Plain Image | Ours | Ref. [18] | Ref. [19] | Ref. [20] | Ref. [22] |
---|---|---|---|---|---|---|
Baboon | 47,065.25 | 233.35 | 270.33 | 270.68 | 271.31 | 237.31 |
House | 28,706.41 | 217.75 | 255.35 | 263.38 | 246.16 | 246.76 |
Cameraman | 10,5149.27 | 247.92 | 269.91 | 249.93 | 265.32 | 259.79 |
Peppers | 35,550.14 | 246.04 | 234.49 | 242.46 | 240.74 | 242.06 |
Average | 54,513.19 | 236.26 | 257.52 | 256.61 | 255.88 | 246.48 |
Image | NPCR | UACI | |
---|---|---|---|
Baboon | Ours | 99.6246% | 33.4949% |
Ref. [18] | 99.4863% | 32.1574% | |
Ref. [19] | 99.5616% | 33.0145% | |
Ref. [20] | 99.6551% | 33.4146% | |
Ref. [22] | 99.5256% | 33.3324% | |
House | Ours | 99.6292% | 33.5274% |
Ref. [18] | 99.4515% | 33.1501% | |
Ref. [19] | 99.5849% | 33.3829% | |
Ref. [20] | 99.6149% | 33.5051% | |
Ref. [22] | 99.5951% | 33.1216% | |
Cameraman | Ours | 99.6231% | 33.4488% |
Ref. [18] | 99.5987% | 33.2151% | |
Ref. [19] | 99.5739% | 33.3015% | |
Ref. [20] | 99.6032% | 33.5028% | |
Ref. [22] | 99.5897% | 32.7981% | |
Peppers | Ours | 99.5941% | 33.5739 % |
Ref. [18] | 99.4782% | 33.4131% | |
Ref. [19] | 99.5801% | 33.4466% | |
Ref. [20] | 99.6337% | 33.5884% | |
Ref. [22] | 99.6111% | 33.0147% |
Image | Directions | Ours | Ref. [18] | Ref. [19] | Ref. [20] | Ref. [22] |
---|---|---|---|---|---|---|
Horizontal | 0.0007 | −0.0284 | −0.0027 | 0.0039 | 0.0034 | |
Baboon | Vertical | −0.0030 | 0.0147 | 0.0023 | 0.0103 | −0.0019 |
Diagonal | 0.0080 | 0.0459 | 0.0088 | −0.0070 | 0.0005 | |
Horizontal | −0.0020 | 0.0497 | 0.0047 | −0.0063 | 0.0098 | |
House | Vertical | −0.0147 | 0.0327 | 0.0030 | 0.0035 | −0.0342 |
Diagonal | 0.0086 | −0.0154 | −0.0039 | 0.0103 | 0.0196 | |
Horizontal | −0.0055 | 0.0120 | −0.0027 | 0.0047 | 0.0023 | |
Cameraman | Vertical | −0.0008 | 0.0478 | 0.00025 | 0.0018 | 0.0044 |
Diagonal | −0.0005 | 0.0354 | 0.0039 | −0.0019 | −0.0048 | |
Horizontal | −0.0029 | −0.0654 | −0.0008 | 0.0028 | 0.0051 | |
Peppers | Vertical | 0.0089 | −0.0259 | 0.0083 | −0.0017 | −0.0049 |
Diagonal | −0.0088 | −0.0351 | −0.0012 | −0.0103 | 0.0078 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zheng, J.; Bao, T. An Image Encryption Algorithm Using Cascade Chaotic Map and S-Box. Entropy 2022, 24, 1827. https://doi.org/10.3390/e24121827
Zheng J, Bao T. An Image Encryption Algorithm Using Cascade Chaotic Map and S-Box. Entropy. 2022; 24(12):1827. https://doi.org/10.3390/e24121827
Chicago/Turabian StyleZheng, Jiming, and Tianyu Bao. 2022. "An Image Encryption Algorithm Using Cascade Chaotic Map and S-Box" Entropy 24, no. 12: 1827. https://doi.org/10.3390/e24121827
APA StyleZheng, J., & Bao, T. (2022). An Image Encryption Algorithm Using Cascade Chaotic Map and S-Box. Entropy, 24(12), 1827. https://doi.org/10.3390/e24121827