An Image Encryption Algorithm Based on Random Hamiltonian Path
Abstract
:1. Introduction
- A method of building a random Hamiltonian path within digital images was designed, which is equivalent to permutation. On this basis, bit-level permutation of high efficiency was achieved.
- Following the thought of the random Hamiltonian path, arrays for grey levels’ substitution can be generated.
- An adjusted Bernoulli map is proposed, which is suitable for image encryption schemes.
- The ambiguous definition of diagonal direction is normalized to two orthogonal directions when calculating correlation coefficients.
2. Hamiltonian Path
2.1. Basic Theory of Hamiltonian Path
2.2. Hamiltonian Path Within Digital Images
2.3. Hamiltonian Path across Bit Planes
3. Adjusted Bernoulli Map
3.1. Bernoulli Map
3.2. Adjusted Bernoulli Map
4. Proposed Scheme
4.1. Encryption Algorithm
4.2. Discussion
4.3. Decryption Algorithm
5. Simulation Experiments
5.1. Secret Key Analysis
5.2. Histograms
5.3. Information Entropy
5.4. Differential Attack
5.5. Correlation Coefficients
5.6. Efficiency
6. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Khan, M.; Shah, T. A literature review on image encryption techniques. 3D Res. 2014, 5, 29. [Google Scholar] [CrossRef]
- Hua, Z.Y.; Zhou, Y.C.; Pun, C.M.; Chen, C.L.P. 2D sine logistic modulation map for image encryption. Inf. Sci. 2015, 297, 80–94. [Google Scholar] [CrossRef]
- Wu, Y.; Zhou, Y.; Agaian, S.; Noonan, J.P. 2D Sudoku associated bijections for image scrambling. Inf. Sci. 2016, 327, 91–109. [Google Scholar] [CrossRef]
- Ye, G.; Zhao, H.; Chai, H. Chaotic image encryption algorithm using wave-line permutation and block diffusion. Nonlinear Dyn. 2016, 83, 2067–2077. [Google Scholar] [CrossRef]
- Xu, M.; Tian, Z. A novel image cipher based on 3D bit matrix and latin cubes. Inf. Sci. 2019, 478, 1–14. [Google Scholar] [CrossRef]
- Diaconu, A.V. Circular inter-intra bit-level permutation and chaos-based image encryption. Inf. Sci. 2016, 355, 314–327. [Google Scholar] [CrossRef]
- Zhang, W.; Wong, K.; Yu, H.; Zhu, Z. A symmetric color image encryption algorithm using the intrinsic features of bit distributions. Commun. Nonlinear Sci. Numer. Simul. 2013, 18, 584–600. [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]
- Hua, Z.; Zhou, Y.; Chen, C.L.P. A new series-wound framework for generating 1D chaotic maps. In Proceedings of the 2013 IEEE Digital Signal Processing and Signal Processing Education Meeting, Napa, CA, USA, 11–14 August 2013; pp. 118–123. [Google Scholar]
- Lan, R.; He, J.; Wang, S.; Gu, T.; Luo, X. Integrated chaotic systems for image encryption. Signal Process. 2018, 147, 133–145. [Google Scholar] [CrossRef]
- Pak, C.; Huang, L. A new color image encryption using combination of the 1D chaotic map. Signal Process. 2017, 138, 129–137. [Google Scholar] [CrossRef]
- Zhou, Y.; Bao, L.; Chen, C.L.P. Image encryption using a new parametric switching chaotic system. Signal Process. 2013, 93, 3039–3052. [Google Scholar] [CrossRef]
- Chapaneri, S.; Chapaneri, R.; Sarode, T. Evaluation of Chaotic Map Lattice Systems for Image Encryption. In Proceedings of the 2014 International Conference on Circuits, Systems, Communication and Information Technology Applications (CSCITA), Mumbai, India, 4–5 April 2014; pp. 59–64. [Google Scholar]
- Tang, Y.; Wang, Z.; Fang, J. Image encryption using chaotic coupled map lattices with time-varying delays. Commun. Nonlinear Sci. Numer. Simul. 2010, 15, 2456–2468. [Google Scholar] [CrossRef]
- Bellman, R.; Cooke, K.L. The Konigsberg bridges problem generalized. J. Math. Anal. Appl. 1969, 25, 1–7. [Google Scholar] [CrossRef] [Green Version]
- Bax, E.T. Inclusion and exclusion algorithm for the Hamiltonian path problem. Inf. Process. Lett. 1993, 47, 203–207. [Google Scholar] [CrossRef]
- Bertossi, A.A. The edge Hamiltonian path problem is NP-complete. Inf. Process. Lett. 1981, 13, 157–159. [Google Scholar] [CrossRef]
- Conrad, A.; Hindrichs, T.; Morsy, H.; Wegener, I. Solution of the knight’s Hamiltonian path problem on chessboards. Discret. Appl. Math. 1994, 50, 125–134. [Google Scholar] [CrossRef] [Green Version]
- Schiermeyer, I. Problems remaining NP-complete for sparse or dense graphs. Discuss. Math. Gr. Theory 1995, 15, 33–41. [Google Scholar] [CrossRef]
- Baumgardner, J.; Acker, K.; Adefuye, O.; Crowley, T.S.; DeLoache, W.; Dickson, J.O.; Heard, L.; Martens, A.; Morton, N.; Ritter, M.; et al. Solving a hamiltonian path problem with a bacterial computer. J. Biol. Eng. 2009, 3, 11. [Google Scholar] [CrossRef] [Green Version]
- Oltean, M. Solving the Hamiltonian path problem with a light-based computer. Nat. Comput. 2007, 7, 57–70. [Google Scholar] [CrossRef] [Green Version]
- Zhang, W.; Zhu, Z.; Yu, H. A symmetric image encryption algorithm based on a coupled logistic–bernoulli map and cellular automata diffusion strategy. Entropy 2019, 21, 504. [Google Scholar] [CrossRef] [Green Version]
- Saito, A.; Yamaguchi, A. Pseudorandom number generator based on the Bernoulli map on cubic algebraic integers. Chaos Interdiscip. J. Nonlinear Sci. 2017, 28, 1054–1500. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Dong, L.; Yong, Z.; Ji, L.; Han, X. Study on the Pass Rate of NIST SP800-22 Statistical Test Suite. In Proceedings of the 2014 Tenth International Conference on Computational Intelligence and Security (CIS), Kunming, China, 15–16 November 2014; pp. 402–404. [Google Scholar]
- The USC-SIPI Image Database. Available online: http://sipi.usc.edu/database/database.php (accessed on 2 December 2019).
- Alvarez, G.; Li, S. Some basic cryptographic requirements for chaos-based cryptosystems. Int. J. Bifurc. Chaos 2006, 16, 2129–2151. [Google Scholar] [CrossRef] [Green Version]
- Castro, J.C.H.; Sierra, J.M.; Seznec, A.; Izquierdo, A.; Ribagorda, A. The strict avalanche criterion randomness test. Math. Comput. Simul. 2005, 68, 1–7. [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]
- 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. 2011, 7714, 31–38. [Google Scholar]
- Ji, X.; Bai, S.; Guo, Y.; Guo, H. A new security solution to JPEG using hyper-chaotic system and modified zigzag scan coding. Commun. Nonlinear Sci. Numer. Simul. 2015, 22, 321–333. [Google Scholar] [CrossRef]
- Maniccam, S.S.; Bourbakis, N.G. Image and video encryption using SCAN patterns. Pattern Recognit. 2004, 37, 725–737. [Google Scholar] [CrossRef]
- Ramasamy, P.; Ranganathan, V.; Kadry, S.; Damaševičius, R.; Blažauskas, T. An image encryption scheme based on block scrambling, modified zigzag transformation and key generation using enhanced logistic—Tent map. Entropy 2019, 21, 656. [Google Scholar] [CrossRef] [Green Version]
- Richter, T. Lossless coding extensions for JPEG. In Proceedings of the Data Compression Conference, Snowbird, UT, USA, 7–9 April 2015; pp. 143–152. [Google Scholar]
- Chai, X.; Zheng, X.; Gan, Z.; Han, D.; Chen, Y. An image encryption algorithm based on chaotic system and compressive sensing. Signal Process. 2018, 148, 124–144. [Google Scholar] [CrossRef]
Statistical Tests | P-value | Pass Rate (%) |
---|---|---|
Frequency | 0.798139 | 100.00 |
Block frequency | 0.108791 | 99.33 |
Cumulative Sums * | 0.282804 | 99.83 |
Runs | 0.588652 | 99.67 |
Longest run | 0.245072 | 99.33 |
Rank | 0.319084 | 100.00 |
FFT | 0.280306 | 99.00 |
Non overlapping template * | 0.468139 | 98.95 |
Overlapping template | 0.425059 | 98.00 |
Universal | 0.449672 | 99.33 |
Approximate entropy | 0.561227 | 99.67 |
Random excursions * | 0.533005 | 98.95 |
Random excursions variant * | 0.419542 | 99.27 |
Serial * | 0.464632 | 98.83 |
Linear complexity | 0.915745 | 99.33 |
Boat (512 × 512) | Couple (512 × 512) | Tank (512 × 512) | Male (1024 × 1024) | Clock (256 × 256) | ||
---|---|---|---|---|---|---|
Key sensitivity in encryption process | (x0 + Δ, α, β) | 0.499321 | 0.499997 | 0.500057 | 0.499904 | 0.501156 |
(x0, α + Δ, β) | 0.499923 | 0.500155 | 0.499765 | 0.499937 | 0.500164 | |
(x0, α, β + Δ) | 0.49994 | 0.500076 | 0.500499 | 0.500078 | 0.500856 | |
Key sensitivity in decryption process | (x0 + Δ, α, β) | 0.500289 | 0.499741 | 0.500082 | 0.499858 | 0.500328 |
(x0, α + Δ, β) | 0.500154 | 0.499415 | 0.5001 | 0.49992 | 0.501308 | |
(x0, α, β + Δ) | 0.499747 | 0.500337 | 0.499742 | 0.49986 | 0.499378 |
Plain Image | Cipher Image | |
---|---|---|
Chemical plant (256 × 256) | 50,326.4 | 248.469 |
Clock (256 × 256) | 282,062 | 248.328 |
Moon surface (256 × 256) | 135,688 | 248.094 |
Boat (512 × 512) | 1,535,880 | 1137.66 |
Couple (512 × 512) | 1,195,460 | 1002.11 |
Lena (512 × 512) | 632,254 | 986.281 |
Tank (512 × 512) | 8,103,600 | 1043.73 |
Airplane (1024 × 1024) | 115,199,000 | 3783.7 |
Airport (1024 × 1024) | 31,596,400 | 3832.03 |
Male (1024 × 1024) | 11,349,400 | 4412.8 |
Plain Image | Proposed Scheme | [2] | [4] | [28] | |
---|---|---|---|---|---|
Chemical plant(256 × 256) | 7.34243 | 7.99725 | 7.99716 | 7.99692 | 7.99683 |
Clock(256 × 256) | 6.70567 | 7.99727 | 7.99726 | 7.99692 | 7.99705 |
Moon surface(256 × 256) | 6.70931 | 7.99725 | 7.99738 | 7.9974 | 7.9972 |
Boat(512 × 512) | 7.19137 | 7.99922 | 7.99934 | 7.9994 | 7.99921 |
Couple(512 × 512) | 7.20101 | 7.99931 | 7.99934 | 7.99931 | 7.99936 |
Lena(512 × 512) | 7.44551 | 7.99932 | 7.99929 | 7.99934 | 7.99932 |
Tank(512 × 512) | 5.49574 | 7.99928 | 7.99934 | 7.99923 | 7.99934 |
Airplane(1024 × 1024) | 5.64145 | 7.99984 | 7.99984 | 7.99983 | 7.99981 |
Airport(1024 × 1024) | 6.83033 | 7.99984 | 7.99983 | 7.99981 | 7.99983 |
Male(1024 × 1024) | 7.52374 | 7.99981 | 7.99978 | 7.99981 | 7.99981 |
Index of Modified Pixel | NPCR (1 Round) | UACI (1 Round) | NPCR (2 Rounds) | UACI (2 Rounds) |
---|---|---|---|---|
0 | 0.996983 | 0.3349 | 0.995941 | 0.335169 |
255 | 0.99733 | 0.335224 | 0.996063 | 0.3338 |
511 | 0.996616 | 0.334727 | 0.996143 | 0.333902 |
65,151 | 0.99897 | 0.3355 | 0.996078 | 0.333911 |
65,407 | 0.998333 | 0.335641 | 0.996254 | 0.334896 |
130,560 | 0.996365 | 0.333719 | 0.995861 | 0.334763 |
130,816 | 0.99995 | 0.335614 | 0.996147 | 0.334734 |
131,071 | 0.999985 | 0.335876 | 0.996216 | 0.335797 |
196,096 | 0.999943 | 0.336146 | 0.995804 | 0.333875 |
196,352 | 0.999031 | 0.335429 | 0.996269 | 0.334645 |
261,632 | 0.9981 | 0.335204 | 0.996181 | 0.333829 |
261,888 | 0.999249 | 0.335551 | 0.996037 | 0.334519 |
262,143 | 0.997608 | 0.335361 | 0.995998 | 0.334605 |
Theoretical value | 0.996094 | 0.334635 | 0.996094 | 0.334635 |
Boat | Male | Clock | Figure 14a | Figure 15a | ||
---|---|---|---|---|---|---|
Plain image | Horizontal | 0.936502 | 0.978016 | 0.956658 | −0.0104305 | −0.0347679 |
Vertical | 0.970165 | 0.981711 | 0.973594 | −0.0262352 | −0.0253942 | |
Principal diagonal | 0.922103 | 0.965681 | 0.940988 | 0.0309025 | 1 | |
Minor diagonal | 0.924285 | 0.967724 | 0.934225 | 1 | 0.00261237 | |
Proposed scheme | Horizontal | −0.00790818 | −0.00530914 | −0.00627326 | 0.0106215 | 0.00724055 |
Vertical | −0.0032019 | −0.00593338 | −0.00787923 | 0.0000261687 | 0.00380631 | |
Principal diagonal | −0.00753223 | 0.0180877 | −0.00519652 | 0.000707789 | −0.0161754 | |
Minor diagonal | 0.001262 | 0.00994515 | −0.00729377 | −0.0060987 | 0.00262413 | |
[2] | Horizontal | 0.0272732 | 0.00444088 | 0.0105537 | 0.00498476 | −0.00189389 |
Vertical | −0.0321433 | −0.000856047 | −0.00733777 | −0.0126175 | 0.0129397 | |
Principal diagonal | −0.00603878 | −0.00964336 | −0.0138118 | 0.0118652 | −0.0067004 | |
Minor diagonal | −0.0013256 | 0.0046903 | −0.00501911 | 0.00299615 | −0.0185178 | |
[4] | Horizontal | 0.00361182 | −0.00595886 | −0.00236848 | 0.000340202 | −0.0171794 |
Vertical | 0.00145023 | −0.0103426 | −0.00437046 | 0.00520304 | 0.00879099 | |
Principal diagonal | 0.00395435 | 0.00305054 | −0.000705693 | −0.0120762 | −0.00874923 | |
Minor diagonal | −0.000165327 | 0.00232492 | 0.000369637 | −0.00743531 | −0.00299425 | |
[28] | Horizontal | 0.00899491 | 0.00754775 | 0.000411031 | 0.0057195 | −.00967912 |
Vertical | −0.0041634 | 0.000629605 | −0.00538419 | −0.00266845 | 0.0105734 | |
Principal diagonal | −0.00463651 | 0.00000710876 | 0.011115 | −0.0034216 | −0.00922371 | |
Minor diagonal | 0.0127711 | 0.00677395 | 0.00671256 | 0.0121195 | 0.00781511 |
Proposed Tcheme | [2] | [4] | [28] | |
---|---|---|---|---|
Chemical plant(256 × 256) | 0.008 s | 0.02 s | 0.004 s | 0.03 s |
Clock(256 × 256) | 0.008 s | 0.019 s | 0.003 s | 0.028 s |
Moon surface(256 × 256) | 0.008 s | 0.019 s | 0.003 s | 0.029 s |
Boat(512 × 512) | 0.029 s | 0.093 s | 0.011 s | 0.236 s |
Couple(512 × 512) | 0.03 s | 0.094 s | 0.012 s | 0.234 s |
Lena(512 ×512) | 0.028 s | 0.09 1s | 0.009 s | 0.239 s |
Tank(512 × 512) | 0.029 s | 0.091 s | 0.011 s | 0.243 s |
Airplane(1024 × 1024) | 0.129 s | 0.441 s | 0.032 s | 2.392 s |
Airport(1024 × 1024) | 0.121 s | 0.44 7s | 0.033 s | 2.388 s |
Male(1024 × 1024) | 0.116 s | 0.434 s | 0.033 s | 2.398 s |
Average throughput | 66.062 Mbps | 21.884 Mbps | 194.571 Mbps | 9.542 Mbps |
© 2020 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 (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, W.; Wang, S.; Han, W.; Yu, H.; Zhu, Z. An Image Encryption Algorithm Based on Random Hamiltonian Path. Entropy 2020, 22, 73. https://doi.org/10.3390/e22010073
Zhang W, Wang S, Han W, Yu H, Zhu Z. An Image Encryption Algorithm Based on Random Hamiltonian Path. Entropy. 2020; 22(1):73. https://doi.org/10.3390/e22010073
Chicago/Turabian StyleZhang, Wei, Shuwen Wang, Weijie Han, Hai Yu, and Zhiliang Zhu. 2020. "An Image Encryption Algorithm Based on Random Hamiltonian Path" Entropy 22, no. 1: 73. https://doi.org/10.3390/e22010073
APA StyleZhang, W., Wang, S., Han, W., Yu, H., & Zhu, Z. (2020). An Image Encryption Algorithm Based on Random Hamiltonian Path. Entropy, 22(1), 73. https://doi.org/10.3390/e22010073