Image Encryption Algorithm Using 2-Order Bit Compass Coding and Chaotic Mapping
Abstract
:1. Introduction
2. Pseudo-Random Integer Sequence Generator
Algorithm 1 Random Integer Sequence |
Require: µ ∈ [3.7, 4] ∨ ∈ (0, 1) ∨ , ∈ N ∨ times, n ∈ N+ |
1 ⇐ Convert , to binary sequence of long n. 2 for i = 1: times do 3 ⇐ ∼; 4 (end) ⇐ abs ((end) − 1); 5 1 ⇐ µ ∗ ∗ (1 − ); 6 ⇐ floor( ∗ 100)); /*Extract two integers after the decimal point.*/ 7 ⇐ floor( ∗ 100)); 8 ⇐ bitxor(circshift(, mod(, n)), circshift(, mod(, n))); 9 ⇐ Convert to a decimal; 10 ⇐ ; ⇐ ; ⇐ 11 Output: R ⇐ unique(R, ‘stable’) |
3. Bit-Compass Coding
Algorithm 2 A Time Coding of |
Require: , is two plaintext binary sequence of long m. k is rotation angle of outer wheel disc. |
1: ⇐ bitxor(, circshif t(, mod(k, m))); |
Algorithm 3 Pseudo-Random Sequence of the |
1 Input → Vector A with length n. |
2 Abit ⇐ Each element of vector A is transformed into a binary sequence of length m. 3 z ⇐ Abit(1,:); 4 k ⇐ mn−1; 5 for i = 0: k − 1 do 6 c = n − 2; 7 for j = 2: n do 8 t ⇐ floor(i/mc); 9 z ⇐ bitxor(z, circshif t(Abit(j,:), t)) 10 c = c − 1; 11 ⇐ i − t × mc; 12 end for 13 z ⇐ [r; z]; 14 end for 15 B ⇐ Each row of the matrix r converts m bits into a decimal number. 16 Output → Vector B with length mn − 1 |
4. Bit-Compass Decoding
Algorithm 4 Random Integer Sequence |
Require: µ ∈ [3.7, 4] ∨∈ (0, 1) ∨,∈ N ∨ times, n ∈ N+ Require:,is two cipher-text binary sequence of long n.,is rotation angle of outer disk,. First bit,of inner disk |
1 i ⇐ 1; n1 ⇐ n;⇐ zeros(1, l); 2 while i < n do 3 ⇐ mod( + , n); 4 if == 0 then 5 ⇐ n; 6 end if 7 temp ⇐ mod( − , n); 8 if temp == 0 then 9 temp ⇐ 1; 10 end if 11 if () == () then 12 (temp) ⇐ (); 13 else 14 (temp) ⇐ () + 1,2); 15 end if 16 ⇐ temp; i ⇐ i + 1; 17 end while 18 b ⇐ [(n − + 1: n), (1: n − )] 19 ⇐ mod( + , n); 20 for i = 1: n do 21 if (i) == 1 then 22 (i) ⇐ mod(b(i) + 1, 2) 23 else (i) ⇐ b(i) 24 end if 25 end for 26 temp ⇐ 27 ⇐ 28 ⇐ 29 if == 1 then 30 ⇐ mod( + 1, 2); 31 ⇐ mod( + 1, 2); 32 end if 33 Output: R |
5. Proposed Scheme of Image Encryption
Algorithm 5 Pixel Scrambling |
R equire: Original image I with size M × N and the vector R longer than M × N |
1 k ⇐ 1; 2 for i= 1:M do 3 4 if == 0 then 5 ⇐ I(R(k), R(k + 1)); 6 k ⇐ k + 2; 7 end for 8 end for Output Ir |
- Step 1: Each element of Ir is transformed into an 8-bit binary code to generate matrix.
- Step 2: Any even number greater than 2 can be written as the sum of two prime numbers [36]. Decompose an even number 8N into the sum of two prime numbers.
- Step 3: Extract the first and ( + 1)-th bit from the odd rows of matrix to construct the matrix . In the decoding process, the first code of the external roulette comes from the matrix .
- Step 4: Keep the order of elements in unchanged and construct the matrix . The missing number can be replaced by 0.
- Step 5: 16 bits 0 and 1 in each row of matrix are converted into a decimal integer to generate a key vector key with a length of m16. The vector key is saved as a key. In later decryption, the first element of the bit compass code and the rotation angle of the outer disk (cyclic shift amount) can be determined from the vector key. The algorithm can refer to Algorithm 6.
Algorithm 6 Key Generation 1 Input → The image Ir with size M × N
2: Convert image Ir into 8-bit binary matrix
3⇐ [Ib(2: 2: r, 1); Ib(2: 2: r, c1 + 1)]4 Ikey ⇐ reshape(, floor(length()/16), 16)
5 for i = 1: length()/16 do
6 key(i) ⇐ ConverteIkey(i,:) to decimal integer.
7 end for
8 Output → key
- Step 1: Extract elements from key, and use the Algorithm 4 to generate vectors Ekey with length of 2M, where .
- Step 2: The adjacent two rows of the matrix are encrypted in turn.
Algorithm 7 Data Encryption |
1 Input → the matrixand the vectors Ekey. 2 while i< M do 3 Select four consecutive numbers from the vector Ekey. The first two modulo operations withget , and the last two modulo operations withget , ; |
4 (i + 1, 2: 2: ) ← abs( (i + 1, 2: 2: ) − 1) 5 (i + 1, + 2: 2: c ∗ n) ←abs( (i + 1, + 2: 2: c ∗ n) − 1)/*Change the correlation of adjacent pixels.*/ 6 if then 7 EIB ← The first numbers of i-line and (i + 1)-line of Ib are encrypted by and the keys are , 8 else EIB ← The first c1 numbers of i-line and (i + 1)-line of Ib are encrypted by and the keys are , + 1; 9 end if 10 if then 11 EIB ← The first numbers of i-line and (i + 1)-line of Ib are encrypted by and the keys are , 12 else EIB ← The first c1 numbers of i-line and (i + 1)-line of Ib are encrypted by and the keys are , + 1; 13 end if 14 i ← i + 2; 15 Delete the first four numbers from the vectors Ekey. 16 end while 17 EI ← Every 8 bits in matrix EIB are converted into a decimal number. 18 Onput → The matrix EI |
6. Results and Analysis
6.1. Key Space
6.2. Histogram Analysis
6.3. The Text
6.4. Correlation Coefficient Text
6.5. Peak Signal-to-Noise Ratio
6.6. Information Entropy
6.7. Gray Value Distribution
6.8. Differential Attack Analysis
6.9. Speed Performance
7. Conclusions
Author Contributions
Funding
Conflicts of Interest
References
- Masood, F.; Masood, J.; Zhang, L.; Jamal, S.S.; Boulila, W.; Rehman, S.U.; Khan, F.A.; Ahmad, J. A new color image encryption technique using DNA computing and Chaos-based substitution box. Soft Comput. 2022, 26, 7461–7477. [Google Scholar] [CrossRef]
- Liao, X.; Yin, J.; Guo, S.; Li, X.; Sangaiah, A.K. Medical JPEG image steganography based on preserving inter-block dependencies. Comput. Electr. Eng. 2018, 67, 320–329. [Google Scholar] [CrossRef]
- Usman, M.A.; Usman, M.R. Using image steganography for providing enhanced medical data security. In Proceedings of the IEEE Consumer Communications & Networking Conference, Las Vegas, NV, USA, 12–15 January 2018; pp. 1–4. [Google Scholar]
- Etoundi, C.M.L.; Nkapkop, J.D.D.; Tsafack, N.; Ngono, J.M.; Ele, P.; Wozniak, M.; Shafi, J.; Ijaz, M.F. A Novel Compound-Coupled Hyperchaotic Map for Image Encryption. Symmetry 2022, 14, 493. [Google Scholar] [CrossRef]
- Hosny, K.M.; Darwish, M.M. Robust color image watermarking using invariant quaternion Legendre-Fourier moments. Multimed. Tools Appl. 2018, 77, 24727–24750. [Google Scholar] [CrossRef]
- Kamal, S.T.; Hosny, K.M.; Elgindy, T.M.; Darwish, M.M.; Fouda, M.M. A new image encryption algorithm for grey and color medical images. IEEE Access 2021, 9, 37855–37865. [Google Scholar] [CrossRef]
- Fridrich, J. Symmetric Ciphers Based on Two-Dimensional Chaotic Maps. Int. J. Bifurc. Chaos 1998, 8, 1259–1284. [Google Scholar] [CrossRef]
- Blackburn, S.R.; Murphy, S.; Paterson, K.G.; Nandi, S.; Chaudhuri, P.P. Comments on “Theory and applications of cellular automata in cryptography”. IEEE Trans. Comput. 1997, 46, 637–639. [Google Scholar] [CrossRef] [Green Version]
- Kaur, M.; Kumar, V. Color image encryption technique using differential evolution in non-subsampled contourlet transform domain. IET Image Process. 2018, 12, 1273–1283. [Google Scholar] [CrossRef]
- Huo, D.; Zhu, Z.; Wei, L.; Han, C.; Zhou, X. A visually secure image encryption scheme based on 2D compressive sensing and integer wavelet transform embedding. Opt. Commun. 2021, 492, 126976. [Google Scholar] [CrossRef]
- Wang, W.; Wang, X.; Xu, B.; Chen, J. Optical image encryption and authentication using phase-only computer-generated hologram. Opt. Lasers Eng. 2021, 146, 106722. [Google Scholar] [CrossRef]
- 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]
- Ye, G.D.; Pan, C.; Dong, Y.X.; Shi, Y.; Huang, X.L. Image encryption and hiding algorithm based on compressive sensing and random numbers insertion. Signal Process. 2020, 172, 107563. [Google Scholar] [CrossRef]
- Brahim, A.H.; Pacha, A.A.; Said, N.H. Image encryption based on compressive sensing and chaos systems. Opt. Laser Technol. 2020, 132, 106489. [Google Scholar] [CrossRef]
- Ye, G.; Liu, M.; Wu, M. Double image encryption algorithm based on compressive sensing and elliptic curve. Alex. Eng. J. 2021, 61, 6785–6795. [Google Scholar] [CrossRef]
- Zhang, Y.; Chen, A.; Tang, Y.; Dang, J.; Wang, G. Plaintext-related image encryption algorithm based on perceptron-like network. Inf. Sci. 2020, 526, 180–202. [Google Scholar] [CrossRef]
- Chen, L.; Peng, B.; Gan, W.; Liu, Y. Plaintext attack on joint transform correlation encryption system by convolutional neural network. Opt. Express 2020, 28, 28154–28163. [Google Scholar] [CrossRef]
- Zhang, R.; Yu, L.; Jiang, D.; Ding, W.; Song, J.; He, K.; Ding, Q. A Novel Plaintext-Related Color Image Encryption Scheme Based on Cellular Neural Network and Chen’s Chaotic System. Symmetry 2021, 13, 393. [Google Scholar] [CrossRef]
- Wu, J.; Liu, Z.; Wang, J.; Hu, L.; Liu, S. A compact image encryption system based on Arnold transformation. Multimed. Tools Appl. 2021, 80, 2647–2661. [Google Scholar] [CrossRef]
- Matthews, R. On the derivation of a chaotic encryption algorithm. Cryptologia 1989, 13, 29–42. [Google Scholar] [CrossRef]
- Chen, L.; Yin, H.; Yuan, L.; Machado, J.T.; Wu, R.; Alam, Z. Double color image encryption based on fractional order discrete improved Henon map and Rubik’s cube transform. Signal Process. Image Commun. 2021, 97, 116363. [Google Scholar] [CrossRef]
- Zhao, H.; Xie, S.; Zhang, J.; Wu, T. A dynamic block image encryption using variable-length secret key and modified Henon map. Optik 2021, 230, 166307. [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]
- Guesmi, R.; Farah, M.A.B. A new efficient medical image cipher based on hybrid chaotic map and DNA code. Multimed. Tools Appl. 2021, 80, 1925–1944. [Google Scholar] [CrossRef]
- Wang, X.; Yang, J. A novel image encryption scheme of dynamic Sboxes and random blocks based on spatiotemporal chaotic system. Optik 2020, 217, 164884. [Google Scholar] [CrossRef]
- Ahmad, J.; Khan, M.A.; Ahmed, F.; Khan, J.S. A novel image encryption scheme based on orthogonal matrix, skew tent map, and XOR operation. Neural Comput. Appl. 2018, 30, 3847–3857. [Google Scholar] [CrossRef]
- Arora, A.; Sharma, R.K. Known-plaintext attack (KPA) on an image encryption scheme using enhanced skew tent map (ESTM) and its improvement. Optik 2021, 244, 167526. [Google Scholar] [CrossRef]
- Zhang, S.; Liu, L. A novel image encryption algorithm based on SPWLCM and DNA coding. Math. Comput. Simul. 2021, 190, 723–744. [Google Scholar] [CrossRef]
- Xu, J.; Zhao, C.; Mou, J. A 3D Image Encryption Algorithm Based on the Chaotic System and the Image Segmentation. IEEE Access 2020, 8, 145995–146005. [Google Scholar] [CrossRef]
- Xiao, D.; Kulsoom, A.; Hashmi, M.A.; Abbas, S.A. Block mode image encryption technique using two-fold operations based on chaos, MD5 and DNA rules. Multimed. Tools Appl. 2019, 78, 9355–9382. [Google Scholar]
- Wang, X.; Feng, L.; Zhao, H. Fast image encryption algorithm based on parallel computing system. Inf. Sci. 2019, 486, 340–358. [Google Scholar] [CrossRef]
- Luo, Y.; Yu, J.; Lai, W.; Liu, L. A novel chaotic image encryption algorithm based on improved baker map and logistic map. Multimed. Tools Appl. 2019, 78, 22023–22043. [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]
- Wiggins, S. Introduction to Applied Nonliner Dynamical Systems and Chaos; Texts in Applied Mathematics; Springer: New York, NY, USA; Berlin/Heidelberg, Germany; Hong Kong, China; London, UK; Milan, Italy; Paris, France; Tokyo, Japan, 1990; Volume 2. [Google Scholar]
- Dospinescu, O.; Brodner, P. Integrated Applications with Laser Technology. Inform. Econ. 2013, 17, 53–61. [Google Scholar] [CrossRef]
- Hardy, G.H.; Wright, E.M. An Introduction to the Theory of Numbers; Oxford Clarendon Press: Oxford, UK, 1979. [Google Scholar]
- Zhang, X.; Zhao, Z.; Wang, J. Chaotic image encryption based on circular substitution box and key stream buffer. Signal Process. Image Commun. 2014, 29, 902–913. [Google Scholar] [CrossRef]
- Zhang, Y.-Q.; Wang, X.-Y. A symmetric image encryption algorithm based on mixed linear–nonlinear coupled map lattice. Inf. Sci. 2014, 273, 329–351. [Google Scholar] [CrossRef]
- Khanzadi, H.; Eshghi, M.; Borujeni, S.E. Image Encryption Using Random Bit Sequence Based on Chaotic Maps. Arab. J. Sci. Eng. 2013, 39, 1039–1047. [Google Scholar] [CrossRef] [Green Version]
- Boussif, M.; Aloui, N.; Cherif, A. Images encryption algorithm based on the quaternion multiplication and the XOR operation. Multimed. Tools Appl. 2019, 78, 35493–35510. [Google Scholar] [CrossRef]
- Kaur, M.; Kumar, V. A Comprehensive Review on Image Encryption Techniques. Arch. Comput. Methods Eng. 2018, 27, 15–43. [Google Scholar] [CrossRef]
- Zhang, X.; Ye, R. A novel RGB image encryption algorithm based on DNA sequences and chaos. Multimed. Tools Appl. 2020, 80, 8809–8833. [Google Scholar] [CrossRef]
Image | The Total Key Space2 |
---|---|
108 × 224 × 2256 × 2 | |
108 × 224 × 2256 × 2 | |
108 × 224 × 22956 + 2215 | |
1 (108 × 224 × 2256 × 2)3 | |
108 × 224 × 2256 + 366 |
Image | Original | BCIES | Ref [40] | Ref [13] | ||||
---|---|---|---|---|---|---|---|---|
I1 | 1.097 × 107 | 2.119 × 104 | 266.2 | 312.2 | 289.4 | 453.2 | 290.3 | 1022.3 |
I2 | 1.102 × 105 | 1.089 × 105 | 242.9 | 240.8 | 277.7 | 543.1 | 277.9 | 729.5 |
I3 | 5.635 × 106 | 5.630 × 108 | 287.1 | 7974.6 | 290.2 | 8472.7 | 1075.4 | 121,821.5 |
I4 | 8.769 × 104 | 2.631 × 105 | 223.9 | 717.9 | 278.2 | 1206.3 | * - | - |
I5 | 3.427 × 104 | 6.938 × 104 | 252.6 | 513.6 | 254.1 | 723.1 | 289.3 | 1295.6 |
Image | Original | Bcies | Ref [40] | Ref [13] | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
I1 | 0.9520 | 0.9612 | 0.9643 | 0.0102 | 0.0180 | 0.0126 | 0.0012 | 0.0332 | −0.0214 | 0.0010 | 0.0014 | 0.0081 |
I2 | 0.9632 | 0.9323 | 0.9129 | 0.0070 | −0.0078 | 0.0034 | −0.0841 | 0.0103 | 0.0064 | 0.0131 | 0.0039 | 0.0056 |
I3 | 0.9078 | 0.9073 | 0.8430 | 0.0120 | 0.0102 | −0.0206 | 0.0237 | 0.0100 | 0.0081 | 0.0060 | −0.0092 | 0.0044 |
I4 | 0.9408 | 0.9399 | 0.9338 | −0.0171 | 0.0062 | 0.0023 | −0.0037 | 0.0106 | 0.0085 | - | - | - |
I5 | 0.8743 | 0.9200 | 0.8446 | 0.0027 | −0.0078 | 0.0016 | 0.0083 | −0.0127 | 0.0027 | 0.0065 | −0.0109 | 0.0028 |
Image | BCIES | Ref [40] | Ref [13] | ||||||
---|---|---|---|---|---|---|---|---|---|
Entropy | GVD | PSNR | Entropy | GVD | PSNR | Entropy | GVD | PSNR | |
I1 | 7.9999 | 0.9976 | 51.1714 | 7.9645 | 0.9231 | 55.2192 | 7.9951 | 0.9122 | 51.9992 |
I2 | 7.9972 | 0.9263 | 8.324 | 7.9130 | 0.9111 | 8.6530 | 7.9014 | 0.9862 | 8.3452 |
I3 | 7.9997 | 0.9493 | 9.5822 | 7.9968 | 0.9298 | 9.4089 | 7.9921 | 0.8907 | 9.4582 |
I4 | 7.9991 | 0.9295 | 8.1895 | 7.9903 | 0.9029 | 0.9875 | - | - | - |
I5 | 7.9985 | 0.8953 | 8.7628 | 7.9977 | 0.8929 | 8.9982 | 7.9900 | 0.9145 | 8.7322 |
Average | 7.9989 | 0.9396 | - | 7.9559 | 0.9234 | - | 7.9697 | 0.9259 | - |
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
Chen, J.; Wu, Y.; Sun, Y.; Yang, C. Image Encryption Algorithm Using 2-Order Bit Compass Coding and Chaotic Mapping. Symmetry 2022, 14, 1482. https://doi.org/10.3390/sym14071482
Chen J, Wu Y, Sun Y, Yang C. Image Encryption Algorithm Using 2-Order Bit Compass Coding and Chaotic Mapping. Symmetry. 2022; 14(7):1482. https://doi.org/10.3390/sym14071482
Chicago/Turabian StyleChen, Jinlin, Yiquan Wu, Yeguo Sun, and Chunzhi Yang. 2022. "Image Encryption Algorithm Using 2-Order Bit Compass Coding and Chaotic Mapping" Symmetry 14, no. 7: 1482. https://doi.org/10.3390/sym14071482
APA StyleChen, J., Wu, Y., Sun, Y., & Yang, C. (2022). Image Encryption Algorithm Using 2-Order Bit Compass Coding and Chaotic Mapping. Symmetry, 14(7), 1482. https://doi.org/10.3390/sym14071482