Cryptanalyzing and Improving an Image Encryption Algorithm Based on Chaotic Dual Scrambling of Pixel Position and Bit
Abstract
:1. Introduction
2. Description of the Original Encryption Algorithm
2.1. Chaotic System
2.2. Encryption Process
2.2.1. Global Scrambling of Pixel Positions
2.2.2. Scrambling and Diffusion Based on the Bit Level of Pixel Values
3. Security Analysis of Original Image Chaotic Encryption Algorithm
3.1. Cracking Diffusion Sequence S
3.2. Cracking Equivalent Bit Scrambling Matrix WT
3.3. Cracking of Global Scrambling Sequence T of Pixel Position
3.3.1. The Situation That the Number of Lines and Columns of Ciphertext Image C to Be Cracked Does Not Exceed 256
3.3.2. The Situation That the Number of Lines and Columns of Cracked Ciphertext Image C Is Greater than 256
4. Experimental Simulation
5. The Improved Algorithm and Its Decryption Algorithm
5.1. The Improved Encryption Algorithm
Algorithm 1: The improved encryption algorithm |
Input: Plaintext image A and encryption keys. Output: Ciphertext image C Step 1: Generate key streams t(i), d(i), and WT(i) Step 2: Convert the digital image matrix A into a one-dimensional sequence P and scramble the plaintext sequence P. for i = 1:m*n P’(i) = P(t(i)) End Step 3: Convert P’(i) into binary PBit (i), and then use WT(i) to scramble PBit(i) to obtain P’Bit (i) and convert P’Bit(i) into a decimal number C’(i) Step 4: Generate Vp(i), Sp(i) and Kt(i) Vp(1) = sum(C’)−C’(1) Sp(1) = mod(floor(Vp(1)*d(1)*1012/2565),256) For i = 2:m*n Vp(i) = Vp(i − 1)−C’(i − 1) Sp(i) = mod(floor(Vp(i)*d(i)*1012/2565),256) Kt(i) = floor(C’(i + 1)*(i − 1)/256) + 1 end Step 5: Generate the final ciphertext image. C(1) = mod(Sp(1) + C’(1),256) For i = 2:m*n − 1 C(i) = mod(Sp(i) + C’(i),256) ⊕ c(Kt(i)) End C(m*n) = mod(Sp(m*n) + C’(m*n),256) |
5.2. Decryption Algorithm of Improved Algorithm
6. Experimental Simulation and Security Analysis of Improved Algorithm
6.1. Experimental Simulation
6.2. Security Analysis of the Improved Algorithm
6.2.1. Information Entropy Analysis of Ciphertext Image
6.2.2. Pixel Correlation Analysis
6.2.3. Analysis of the Algorithm Sensitivity to the Plaintext Image
6.2.4. Key Sensitivity Analysis
6.2.5. Analysis of Anti Chosen-Plaintext Attack
6.2.6. Time Cost Analysis
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Lin, Y.-T.; Wang, C.-M.; Chen, W.-S.; Lin, F.-P.; Lin, W. A Novel Data Hiding Algorithm for High Dynamic Range Images. IEEE Trans. Multimed. 2016, 18, 196–211. [Google Scholar] [CrossRef]
- Diaconu, A.-V. Circular inter–intra pixels bit-level permutation and chaos-based image encryption. Inf. Sci. 2016, 355–356, 314–327. [Google Scholar] [CrossRef]
- Dragoi, I.-C.; Coltuc, D. On Local Prediction Based Reversible Watermarking. IEEE Trans. Image Process. 2015, 24, 1244–1246. [Google Scholar] [CrossRef] [PubMed]
- Li, C.; Lin, D.; Lu, J.; Hao, F. Cryptanalyzing an Image Encryption Algorithm Based on Autoblocking and Electrocardiography. IEEE MultiMed. 2018, 25, 46–56. [Google Scholar] [CrossRef] [Green Version]
- Zhu, S.; Deng, X.; Zhang, W.; Zhu, C. Secure image encryption scheme based on a new robust chaotic map and strong S-box. Math. Comput. Simul. 2023, 207, 322–346. [Google Scholar] [CrossRef]
- Fridrich, J. Image encryption based on chaotic maps. In Proceedings of the 1997 IEEE International Conference on Systems, Man, and Cybernetics, Computational Cybernetics and Simulation, Orlando, FL, USA, 12–15 October 1997. [Google Scholar]
- Yang, F.; Mou, J.; Ma, C.; Cao, Y. Dynamic analysis of an improper fractional-order laser chaotic system and its image encryption application. Opt. Lasers Eng. 2020, 129, 106031. [Google Scholar] [CrossRef]
- Zhu, S.; Zhu, C.; Wang, W. A New Image Encryption Algorithm Based on Chaos and Secure Hash SHA-256. Entropy 2018, 20, 716. [Google Scholar] [CrossRef] [Green Version]
- 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. [Google Scholar] [CrossRef]
- Hosny, K.; Kamal, S.; Darwish, M.; Papakostas, G. New Image Encryption Algorithm Using Hyperchaotic System and Fibonacci Q-Matrix. Electronics 2021, 10, 1066. [Google Scholar] [CrossRef]
- Zhu, S.; Wang, G.; Zhu, C. A Secure and Fast Image Encryption Scheme based on Double Chaotic S-Boxes. Entropy 2019, 21, 790. [Google Scholar] [CrossRef] [Green Version]
- Zhu, S.; Zhu, C. Image encryption algorithm with an avalanche effect based on a six-dimensional discrete chaotic system. Multimed. Tools Appl. 2018, 77, 29119–29142. [Google Scholar] [CrossRef]
- Li, X.; Yu, C.; Guo, J. Multi-Image Encryption Method via Computational Integral Imaging Algorithm. Entropy 2022, 24, 996. [Google Scholar] [CrossRef] [PubMed]
- Wang, P.; Wang, Y.; Xiang, J.; Xiao, X. Fast Image Encryption Algorithm for Logistics-Sine-Cosine Mapping. Sensors 2022, 22, 9929. [Google Scholar] [CrossRef] [PubMed]
- Rehman, A.U.; Liao, X.; Hahsmi, M.A.; Haider, R. An efficient mixed inter-intra pixels substitution at 2bits-level for image encryption technique using DNA and chaos. Optik 2018, 153, 117–134. [Google Scholar] [CrossRef]
- Zhu, S.; Zhu, C. Secure Image Encryption Algorithm Based on Hyperchaos and Dynamic DNA Coding. Entropy 2020, 22, 772. [Google Scholar] [CrossRef] [PubMed]
- Wang, T.; Wang, M.-H. Hyperchaotic image encryption algorithm based on bit-level permutation and DNA encoding. Opt. Laser Technol. 2020, 132, 106355. [Google Scholar] [CrossRef]
- Li, S.; Li, C.; Chen, G.; Bourbakis, N.G.; Lo, K.-T. A general quantitative cryptanalysis of permutation-only multimedia ciphers against plaintext attacks. Signal Process. Image Commun. 2008, 23, 212–223. [Google Scholar] [CrossRef] [Green Version]
- Chen, L.; Li, C.; Li, C. Security measurement of a medical communication scheme based on chaos and DNA coding. J. Vis. Commun. Image R. 2022, 83, 103424. [Google Scholar] [CrossRef]
- Munir, N.; Khan, M.; Jamal, S.S.; Hazzazi, M.M.; Hussain, I. Cryptanalysis of hybrid secure image encryption based on Julia set fractals and three-dimensional Lorenz chaotic map. Math. Comput. Simul. 2021, 190, 826–836. [Google Scholar] [CrossRef]
- Ma, Y.; Li, C.; Ou, B. Cryptanalysis of an image block encryption algorithm based on chaotic maps. J. Inf. Secur. Appl. 2020, 54, 102566. [Google Scholar] [CrossRef]
- Zhu, S.; Zhu, C. Security Analysis and Improvement of an Image Encryption Cryptosystem Based on Bit Plane Extraction and Multi Chaos. Entropy 2021, 23, 505. [Google Scholar] [CrossRef]
- Liu, S.; Li, C.; Hu, Q. Cryptanalyzing Two Image Encryption Algorithms Based on a First-Order Time-Delay System. IEEE MultiMed. 2022, 29, 74–84. [Google Scholar] [CrossRef]
- Zhang, Y. Cryptanalyzing an Image Cryptosystem Based on Circular Inter-Intra Pixels Bit-Level Permutation. IEEE Access 2020, 8, 94810–94816. [Google Scholar] [CrossRef]
- Deng, X.; Liao, C.; Zhu, C. An image encryption algorithm based on chaos and double scrambling of pixel position and bit. J. Commun. 2014, 35, 216–223. [Google Scholar]
- Zhang, X.; Li, J.; Xing, J.; Wang, P.; Fu, D. A kent chaos artificial bee colony algorithm based wavelet thresholding method for signal denoising. In Proceedings of the 2016 12th World Congress on Intelligent Control and Automation (WCICA), Guilin, China, 12–15 June 2016. [Google Scholar]
- Li, C.; Zhang, Y.; Xie, E.Y. When an attacker meets a cipher-image in 2018: A year in review. J. Inf. Secur. Appl. 2019, 48, 102361. [Google Scholar] [CrossRef] [Green Version]
- Shannon, C.E. A mathematical theory of communication. Bell Syst. Tech. J. 1948, 27, 379–423. [Google Scholar] [CrossRef] [Green Version]
Images | The Original Algorithm | The Improved Algorithm |
---|---|---|
rice | 7.9926 | 7.9984 |
cameraman | 7.9893 | 7.9978 |
autumn | 7.9897 | 7.9932 |
pepper | 7.9943 | 7.9958 |
Images | Horizontal | Vertical | Diagonal |
---|---|---|---|
The plaintext image of“Rice” | 0.9667 | 0.9243 | 0.9099 |
The ciphertext image of“Rice” | −0.0012 | 0.0147 | −0.0191 |
The plaintext image of“Cameraman” | 0.9609 | 0.9508 | 0.9365 |
The ciphertext image “Cameraman” | −0.0030 | −0.0169 | 0.0085 |
The plaintext image of“autumn” | 0.9709 | 0.9887 | 0.9809 |
The ciphertext image “autumn” | −0.0068 | 0.0108 | −0.0109 |
The plaintext image of“pepper” | 0.9809 | 0.9798 | 0.9832 |
The ciphertext image of“pepper” | 0.0043 | 0.0184 | −0.0193 |
Images | NPCR% | UACI% | ||||
---|---|---|---|---|---|---|
Max | Min | Average | Max | Min | Average | |
Rice | 99.8634 | 99.7026 | 99.7662 | 33.5587 | 33.3998 | 33.4819 |
autumn | 99.7932 | 99.6241 | 99.7310 | 33.6998 | 33.2584 | 33.4689 |
pepper | 99.9532 | 99.4897 | 99.6859 | 33.7983 | 33.3619 | 33.5418 |
camera | 99.7898 | 99.5698 | 99.6677 | 33.5492 | 33.2898 | 33.3598 |
Images | NPCR% | UACI% | ||||
---|---|---|---|---|---|---|
Max | Min | Average | Max | Min | Average | |
Rice | 99.8543 | 99.6826 | 99.7062 | 33.4569 | 33.3916 | 33.4819 |
autumn | 99.6687 | 99.5821 | 99.6315 | 33.6754 | 33.4508 | 33.6569 |
pepper | 99.9438 | 99.5839 | 99.6656 | 33.8543 | 33.4619 | 33.6418 |
camera | 99.7998 | 99.4668 | 99.5657 | 33.5487 | 33.2858 | 33.3578 |
Images | Size | The Encryption Time | The Decryption Time |
---|---|---|---|
Rice | 256 × 256 | 0.034876 | 0.049487 |
autumn | 206 × 345 | 0.094978 | 0.129496 |
peppers | 384 × 512 | 0.110982 | 0.130679 |
camera | 256 × 256 | 0.034567 | 0.051543 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 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
Zhu, S.; Zhu, C.; Yan, H. Cryptanalyzing and Improving an Image Encryption Algorithm Based on Chaotic Dual Scrambling of Pixel Position and Bit. Entropy 2023, 25, 400. https://doi.org/10.3390/e25030400
Zhu S, Zhu C, Yan H. Cryptanalyzing and Improving an Image Encryption Algorithm Based on Chaotic Dual Scrambling of Pixel Position and Bit. Entropy. 2023; 25(3):400. https://doi.org/10.3390/e25030400
Chicago/Turabian StyleZhu, Shuqin, Congxu Zhu, and Hanyu Yan. 2023. "Cryptanalyzing and Improving an Image Encryption Algorithm Based on Chaotic Dual Scrambling of Pixel Position and Bit" Entropy 25, no. 3: 400. https://doi.org/10.3390/e25030400
APA StyleZhu, S., Zhu, C., & Yan, H. (2023). Cryptanalyzing and Improving an Image Encryption Algorithm Based on Chaotic Dual Scrambling of Pixel Position and Bit. Entropy, 25(3), 400. https://doi.org/10.3390/e25030400