A New Chaotic Image Encryption Algorithm Based on Transversals in a Latin Square
Abstract
:1. Introduction
- An n-transversal in a Latin square is used for image encryption. This combinatorial structure has two functions: classify all the positions of a square and generate two new orthogonal Latin squares.
- We permutated the pixels of the image group by group in the first round of substitution according to an n-transversal. Two suitable Latin squares were used for auxiliary diffusion, and another pair of orthogonal Latin squares was also used for the second scrambling.
- The experimental results indicated that this algorithm can make full use of the new combinatorial structure. It passed various tests and had a high security level and a fast speed. The comparison results indicated that it outperformed many of the latest papers.
2. Preliminaries
2.1. Latin Squares and Transversals
2.2. Logistic Map
3. The Proposed Image Encryption Algorithm
3.1. The Generation of Latin Squares and an n-Transversal
Algorithm 1: The generation of and an n-transversal. |
Input: An plain image Q, encryption key , public parameter a. Output: Latin squares and the truncated decomposition array D. Step 1: Compute the sum of all pixels in Q, denoted as . Let
Step 2: Generate a logistic sequence of length n with system parameter and initial value . Sort as follows: Step 3: Redefine the operations of addition and multiplication in , then generate a finite field with character p. Denote . Select , , and (mod p), and generate three Latin squares with the ()th entry , , and , respectively. According to Theorem 2, are pairwise orthogonal. Step 4: Generate the truncated decomposition array D with the ()th entry (). Then, the column set of D is an n-transversal of M. |
3.2. Image Encryption
Algorithm 2: The proposed encryption algorithm. |
Input: An plain image Q, encryption key , public parameters a, , and . Output: Ciphertext image . Step 1: Make use of Algorithm 1, , and a to generate , and D. Step 2: Scramble Q for the first time. At first, convert D into a natural column index array by bijection . Starting from the first transversal, the first pixel of Q at is placed at the position , the second pixel at the position is placed at the position , and so on, until the last pixel at the position is placed at the position . After scrambling n times based on n transversals, we can obtain a temporary image . The specific process is shown below.
Figure 3 shows a fourth-order example to illustrate the scrambling process in this step. In Figure 3a, a Latin square M (generated on the field of Example 1) is converted into digital form. Select an element , then generate with the th entry , resulting in a four-transversal D, distinguished by four different colors. All 16 positions of a fourth-order matrix are divided into four pairwise disjoint groups. Because , , we can scramble Q according to D. In Figure 3b, starting from the first transversal, the first pixel ‘1’ at (0,0) is placed at (1,2), the second pixel ‘7’ at (1,2) is placed at (2,3), the third pixel ‘12’ at (2,3) is placed at (3,1), and finally, the fourth pixel ‘14’ at (3,1) is placed at (0,0), as is the scrambling of the other transversals. Because D is a four-transversal, the first scrambling can be completed after four times. Step 3: Firstly, convert into a row vector , then generate another new chaotic sequence of length with system parameter and initial value . To eliminate the effect of the initial value, delete the first 100 digits and the rest form a new chaotic sequence . M and are transposed into row vectors and , which are used as two pseudo-random sequences for auxiliary diffusion to form a new row vector . The detailed diffusion formula is as follows.
Step 4: Transpose to an array . By using the orthogonality of and , we conducted the second scrambling according to (6), and the final ciphertext image was obtained.
|
3.3. Image Decryption
4. Simulation Results and Security Analysis
4.1. Key Space and Sensitivity Analysis
4.1.1. Key Space Analysis
4.1.2. Key Sensitivity Analysis
4.2. Statistical Analysis
4.2.1. Histogram Analysis
4.2.2. Correlation Test
4.2.3. Information Entropy Analysis
4.3. Differential Attack Analysis
4.4. Robustness Test
4.5. Computational Complexity and Time Efficiency
4.6. Resistance to Classical Types of Attacks
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Proof of Theorem 2
References
- Wang, X.; Liu, C.; Jiang, D. A novel triple-image encryption and hiding algorithm based on chaos, compressive sensing and 3D DCT. Inform. Sci. 2021, 574, 506–527. [Google Scholar] [CrossRef]
- Zhou, S.; Wang, X.; Zhang, Y.; Ge, B.; Wang, M.; Gao, S. A novel image encryption cryptosystem based on true random numbers and chaotic systems. Multimed. Syst. 2022, 28, 95–112. [Google Scholar] [CrossRef]
- Nardo, L.G.; Nepomuceno, E.G.; Bastos, G.T.; Santos, T.A.; Butusov, D.N.; Arias-Garcia, J. A reliable chaos-based cryptography using Galois field. Chaos Interdiscip. J. Nonlinear Sci. 2021, 31, 091101. [Google Scholar] [CrossRef] [PubMed]
- Li, S.; Chen, G.; Mou, X. On the dynamical degradation of digital piecewise linear chaotic maps. Int. J. Bifurc. Chaos 2005, 15, 3119–3151. [Google Scholar] [CrossRef] [Green Version]
- Zhang, X.; Wu, T.; Wang, Y.; Jiang, L.; Niu, Y. A novel chaotic image encryption algorithm based on latin square and random shift. Comput. Intel. Neurosci. 2021, 2021, 2091053. [Google Scholar] [CrossRef]
- Hua, Z.; Zhu, Z.; Chen, Y.; Li, Y. Color image encryption using orthogonal Latin squares and a new 2D chaotic system. Nonlinear Dyn. 2021, 104, 4505–4522. [Google Scholar] [CrossRef]
- Liu, J.; Zhang, M.; Tong, X.; Wang, Z. Image compression and encryption algorithm based on 2D compressive sensing and hyperchaotic system. Multimed. Syst. 2022, 28, 595–610. [Google Scholar] [CrossRef]
- Liu, H.; Wang, X. Color image encryption based on one-time keys and robust chaotic maps. Comput. Math. Appl. 2010, 59, 3320–3327. [Google Scholar] [CrossRef] [Green Version]
- Wang, X.; Zhang, Y.; Bao, X. A novel chaotic image encryption scheme using DNA sequence operations. Opt. Lasers Eng. 2015, 73, 53–61. [Google Scholar] [CrossRef]
- Chai, X.; Chen, Y.; Broyde, L. A novel chaos-based image encryption algorithm using DNA sequence operations. Opt. Lasers Eng. 2017, 88, 197–213. [Google Scholar] [CrossRef]
- Dong, W.; Li, Q.; Tang, Y.; Hu, M.; Zeng, R. A robust and multi chaotic DNA image encryption with pixel-value pseudorandom substitution scheme. Opt. Commun. 2021, 499, 127211. [Google Scholar] [CrossRef]
- Abdullah, A.H.; Enayatifar, R.; Lee, M. A hybrid genetic algorithm and chaotic function model for image encryption. AEU-Int. J. Electron. Commun. 2012, 66, 806–816. [Google Scholar] [CrossRef]
- Premkumar, R.; Anand, S. Secured and compound 3-D chaos image encryption using hybrid mutation and crossover operator. Multimed. Tools Appl. 2018, 78, 9577–9593. [Google Scholar] [CrossRef]
- Zhang, Y.; He, Y.; Li, P.; Wang, X. A new color image encryption scheme based on 2DNLCML system and genetic operations. Opt. Lasers Eng. 2020, 128, 106040. [Google Scholar] [CrossRef]
- Xu, Q.; Sun, K.; Cao, C.; Zhu, C. A fast image encryption algorithm based on compressive sensing and hyperchaotic map. Opt. Lasers Eng. 2019, 121, 203–214. [Google Scholar] [CrossRef]
- Khan, J.S.; Kayhan, S.K. Chaos and compressive sensing based novel image encryption scheme. J. Inf. Secur. Appl. 2021, 58, 102711. [Google Scholar] [CrossRef]
- Wang, X.; Gao, S. Image encryption algorithm for synchronously updating Boolean networks based on matrix semi-tensor product theory. Inform. Sci. 2020, 507, 16–36. [Google Scholar] [CrossRef]
- Wang, X.; Gao, S. Image encryption algorithm based on the matrix semi-tensor product with a compound secret key produced by a Boolean network. Inform. Sci. 2020, 539, 195–214. [Google Scholar] [CrossRef]
- Nardo, L.G.; Nepomuceno, E.G.; Arias-Garcia, J.; Butusov, D.N. Image encryption using finite-precision error. Chaos Soliton. Fract. 2019, 123, 69–78. [Google Scholar] [CrossRef]
- Nepomuceno, E.G.; Nardo, L.G.; Arias-Garcia, J.; Butusov, D.N.; Tutueva, A. Image encryption based on the pseudo-orbits from 1D chaotic map. Chaos Interdiscip. J. Nonlinear Sci. 2019, 29, 061101. [Google Scholar] [CrossRef]
- Xian, Y.; Wang, X. Fractal sorting matrix and its application on chaotic image encryption. Inform. Sci. 2021, 547, 1154–1169. [Google Scholar] [CrossRef]
- Wu, Y.; Zhou, Y.; Noonan, J.P.; Agaian, S. Design of image cipher using latin squares. Inform. Sci. 2014, 264, 317–339. [Google Scholar] [CrossRef] [Green Version]
- Li, G. A digital image scrambling method based on orthogonal Latin square. J. North China Univ. Tech. 2001, 13, 14–16. [Google Scholar]
- Xu, M.; Tian, Z. A novel image encryption algorithm based on self-orthogonal Latin squares. Optik 2018, 171, 891–903. [Google Scholar] [CrossRef]
- Wang, X.; Su, Y.; Xu, M.; Zhang, H.; Zhang, Y. A new image encryption algorithm based on Latin square matrix. Nonlinear Dyn. 2021, 107, 1277–1293. [Google Scholar] [CrossRef]
- Xu, M.; Tian, Z. A novel image cipher based on 3D bit matrix and latin cubes. Inform. Sci. 2019, 478, 1–14. [Google Scholar] [CrossRef]
- Zhou, J.; Zhou, N.; Gong, L. Fast color image encryption scheme based on 3D orthogonal Latin squares and matching matrix. Opt. Laser Technol. 2020, 131, 106437. [Google Scholar] [CrossRef]
- Li, T.; Shi, J.; Li, X.; Wu, J.; Pan, F. Image encryption based on pixel-level diffusion with dynamic filtering and DNA-level permutation with 3D Latin cubes. Entropy 2019, 21, 319. [Google Scholar] [CrossRef] [Green Version]
- Sam, I.S.; Devaraj, P.; Bhuvaneswaran, R. An efficient quasigroup based image encryption using modified nonlinear chaotic maps. Sens. Imaging 2014, 15, 1–21. [Google Scholar] [CrossRef]
- Shannon, C.E. Communication theory of secrecy systems. Bell Syst. Tech. J. 1949, 28, 656–715. [Google Scholar] [CrossRef]
- Evans, A.B. Orthogonal Latin Squares Based on Groups; Springer Science and Business Media LLC: Cham, Switzerland, 2018; Volume 57, pp. 13–14. [Google Scholar]
- Colbourn, C.J.; Dinitz, J.H. Handbook of Combinatorial Designs, 2nd ed.; CRC Press/Chapman & Hall: Boca Raton, FL, USA, 2007; pp. 143, 345–348. [Google Scholar]
- Liu, H.; Zhao, B.; Huang, L. A novel quantum image encryption algorithm based on crossover operation and mutation operation. Multimed. Tools Appl. 2019, 78, 20465–20483. [Google Scholar] [CrossRef]
- Cao, C.; Sun, K.; Liu, W. A novel bit-level image encryption algorithm based on 2D-LICM hyperchaotic map. Signal Process. 2018, 143, 122–133. [Google Scholar] [CrossRef]
- Wang, X.; Gao, S.; Ye, X.; Zhou, S.; Wang, M. A new image encryption algorithm with cantor diagonal scrambling based on the PUMCML system. Int. J. Bifurc. Chaos 2021, 31, 2150003. [Google Scholar] [CrossRef]
- Wang, M.; Wang, X.; Zhao, T.; Zhang, C.; Xia, Z.; Yao, N. Spatiotemporal chaos in improved cross coupled map lattice and its application in a bit-level image encryption scheme. Inf. Sci. 2021, 544, 1–24. [Google Scholar] [CrossRef]
- Jin, C.; Liu, H. A color Image encryption scheme based on arnold scrambling and quantum chaotic. IJ Netw. Secur. 2017, 19, 347–357. [Google Scholar] [CrossRef]
- Patro, K.A.K.; Acharya, B. Secure multi-level permutation operation based multiple colour image encryption. J. Inf. Secur. Appl. 2018, 40, 111–133. [Google Scholar] [CrossRef]
- 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. [Google Scholar] [CrossRef]
- Behnia, S.; Akhshani, A.; Mahmodi, H.; Akhavan, A. A novel algorithm for image encryption based on mixture of chaotic maps. Chaos Soliton. Fract. 2008, 35, 408–419. [Google Scholar] [CrossRef]
- Sun, X. Image Encryption Algorithm and Practice-Based on C Sharp Language Implementation; Science Press: Beijing, China, 2013; pp. 313–315. [Google Scholar]
- Wu, Y.; Noonan, J.P.; Agaian, S. NPCR and UACI randomness tests for image encryption. Cyber J. Multidiscip. J. Sci. Technol. J. Sel. Areas Telecommun. (JSAT) 2011, 1, 31–38. [Google Scholar]
- Wang, X.; Li, Z. A color image encryption algorithm based on Hopfield chaotic neural network. Opt. Lasers Eng. 2019, 115, 107–118. [Google Scholar] [CrossRef]
The Comparison Ciphers | Figure 5a | Figure 5b | Figure 5c |
---|---|---|---|
Number of different pixels | 65,270 | 65,276 | 65,288 |
Percentage | 99.5941% | 99.6033% | 99.6216% |
Original and Decrypted Image | Figure 6a | Figure 6b | Figure 6c |
---|---|---|---|
Number of different pixels | 65,274 | 65,290 | 65,227 |
Percentage | 99.6002% | 99.6246% | 99.5285% |
Image | Testing Direction | Average Value | Variance | Entropy | ||
---|---|---|---|---|---|---|
H | V | D | ||||
Lena | 0.94034 | 0.97136 | 0.92288 | 0.94486 | 41,398.1016 | 7.42489 |
Ciphertext image of Lena | −0.00064 | −0.00356 | −0.00157 | 0.00192 | 195.7656 | 7.99784 |
Baboon | 0.78885 | 0.74049 | 0.68020 | 0.73651 | 46,866.8281 | 7.37811 |
Ciphertext image of Baboon | −0.00291 | −0.00005 | 0.00402 | 0.00233 | 238.9062 | 7.99737 |
Cameraman | 0.96099 | 0.97463 | 0.92712 | 0.95425 | 105,604.8672 | 7.03056 |
Ciphertext image of Cameraman | 0.00198 | 0.00045 | 0.00202 | 0.00148 | 227.3594 | 7.99748 |
Clock | 0.95009 | 0.97750 | 0.93230 | 0.95330 | 282,061.5625 | 6.70567 |
Ciphertext image of Clock | 0.00135 | 0.00365 | −0.00194 | 0.00231 | 205.8984 | 7.99775 |
Couple | 0.87446 | 0.88660 | 0.80207 | 0.85438 | 86,692.7031 | 7.05625 |
Ciphertext image of Couple | −0.00067 | −0.00159 | −0.00023 | 0.00083 | 252 | 7.99723 |
Man | 0.93943 | 0.95108 | 0.91287 | 0.93446 | 37,058.7812 | 7.53608 |
Ciphertext image of Man | 0.00347 | −0.00098 | −0.00128 | 0.00191 | 234.7734 | 7.99741 |
Image | Testing Direction | Average Value | Entropy | NPCR (%) | UACI (%) | Encryption Time (s) | Decryption Time (s) | ||
---|---|---|---|---|---|---|---|---|---|
H | V | D | |||||||
Ciphertext image in the proposed algorithm | −0.0006 | −0.0036 | −0.0016 | 0.0019 | 7.9978 | 99.617 | 33.5426 | 0.3077 | 0.2709 |
Ciphertext image in [5] | 0.0023 | 0.0158 | 0.0147 | 0.0583 | – | 99.6101 | 33.4583 | 0.325 | – |
Ciphertext image in [24] | 0.0179 | 0.022 | 7 × 10−6 | 0.0133 | 7.9970 | 99.6107 | 33.4232 | 0.425 | – |
Ciphertext image in [25] | 0.0018 | 0.0016 | −0.0027 | 0.002 | 7.9974 | 99.6095 | 33.4649 | 0.2–0.23 | 0.13–0.17 |
Ciphertext image in [33] | 0.0009 | 0.0001 | 0.0000 | 0.0003 | 7.9974 | 99.6102 | 33.3915 | 0.1062 | – |
Ciphertext image in [34] | −0.0059 | −0.0146 | 0.0211 | 0.0139 | 7.9973 | 99.6100 | 33.4800 | 0.3243 | – |
Ciphertext image in [2] | −0.0003 | −0.0007 | −0.0001 | 0.0004 | 7.9977 | 99.6000 | 33.4500 | 1.3 | – |
Ciphertext image in [35] | 0.0026 | 0.0051 | 0.0003 | 0.0027 | 7.9973 | 99.5800 | 33.5400 | – | – |
Ciphertext image in [36] | −0.0005 | 0.0012 | 0.0008 | 0.0008 | 7.9975 | 99.6037 | 33.4606 | – | – |
Location | (209,232) | (33,234) | (162,26) | (72,140) |
---|---|---|---|---|
NPCR | 99.6353 | 99.6185 | 99.6292 | 99.6246 |
UACI | 33.4139 | 33.4155 | 33.416 | 33.4107 |
Image | NPCR (%) | UACI (%) |
---|---|---|
Lena | 99.6170 | 33.5426 |
Baboon | 99.6307 | 33.4622 |
Cameraman | 99.6292 | 33.2594 |
Clock | 99.6124 | 33.51 |
Couple | 99.6307 | 33.5925 |
Man | 99.6078 | 33.3822 |
Image | PSNR Values (dB) | PSNR Values (dB) | ||||||
---|---|---|---|---|---|---|---|---|
Cut 1/16 | Cut 1/8 | Cut 1/4 | Cut 1/2 | Salt and Pepper Noise (0.05) | Salt and Pepper Noise (0.1) | Gaussian Noise (0.01) | Gaussian Noise (0.1) | |
Lena | 18.4952 | 15.6102 | 12.7567 | 10.3489 | 19.3543 | 16.5183 | 13.2037 | 11.9735 |
Baboon | 18.5505 | 15.5962 | 12.7419 | 10.4122 | 19.3658 | 16.2732 | 13.1195 | 11.9209 |
Cameraman | 17.6986 | 14.8126 | 12.0811 | 9.6798 | 18.4388 | 15.6301 | 12.2959 | 11.1939 |
Clock | 16.6901 | 13.6156 | 10.7295 | 8.1282 | 17.4574 | 14.4200 | 11.0870 | 9.9733 |
Couple | 18.8945 | 15.8033 | 12.9758 | 10.5872 | 19.4215 | 16.4731 | 13.0921 | 12.0530 |
Man | 17.7603 | 14.6126 | 11.7237 | 9.4005 | 18.1337 | 15.3696 | 11.7741 | 10.7375 |
Image | Encryption Time (s) | Decryption Time (s) |
---|---|---|
Lena | 0.30769 | 0.27087 |
Baboon | 0.30816 | 0.27063 |
Cameraman | 0.30946 | 0.27259 |
Clock | 0.30812 | 0.27233 |
Couple | 0.30727 | 0.27219 |
Man | 0.30769 | 0.27266 |
Image 256 × 256 | Testing Direction | Average Value | Variance | Entropy | NPCR (%) | UACI (%) | ||
---|---|---|---|---|---|---|---|---|
H | V | D | ||||||
All-black | −0.00260 | 0.00045 | −0.00286 | 0.00197 | 282.6875 | 7.99688 | 99.6292 | 33.2993 |
All-white | −0.00308 | 0.00091 | −0.00193 | 0.00197 | 277.7813 | 7.99693 | 99.5728 | 33.2807 |
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
Shen, H.; Shan, X.; Xu, M.; Tian, Z. A New Chaotic Image Encryption Algorithm Based on Transversals in a Latin Square. Entropy 2022, 24, 1574. https://doi.org/10.3390/e24111574
Shen H, Shan X, Xu M, Tian Z. A New Chaotic Image Encryption Algorithm Based on Transversals in a Latin Square. Entropy. 2022; 24(11):1574. https://doi.org/10.3390/e24111574
Chicago/Turabian StyleShen, Honglian, Xiuling Shan, Ming Xu, and Zihong Tian. 2022. "A New Chaotic Image Encryption Algorithm Based on Transversals in a Latin Square" Entropy 24, no. 11: 1574. https://doi.org/10.3390/e24111574