30 November 2017 Chaotic image encryption scheme using two-by-two deoxyribonucleic acid complementary rules
Author Affiliations +
An image encryption technique has been proposed using deoxyribonucleic acid (DNA) operations and chaotic map in this scheme. First, initial conditions of row encryption and column encryption are calculated. Then, a two-dimensional sine iterative chaotic map with infinite collapse (ICMIC) modulation map (2D-SIMM) is adopted to produce chaotic sequences. Extended exclusive OR (XOR) is executed to enhance security. A mask matrix is produced by 2D-SIMM. It performs XOR operation with the DNA-encoded matrix. Finally, the revised DNA-encoded matrix is performed two-by-two DNA complementary rules and executed DNA decoding to obtain the cipher image. Experiment results prove that the proposed scheme is secure enough and can resist various attacks.



Recently, many image encryption methods have been proposed. The diffusion and confusion operations that are proposed by Shannon1 in cryptography are also used in image encryption. Traditional encryption methods are improper for image encryption such as low efficiency, enormous data, high correlation, and so on.2 Chen et al.3 presented a real-time cryptosystem. The confusion and diffusion operations of this scheme were performed based on a lookup table. Chen et al.4 also put forward an image encryption algorithm based on gray code. It was performed with high efficiency. The chaotic map is highly sensitive to initial values and system parameters, unpredictable, pseudorandom, and ergodic.5 It is very suitable for an image encryption system. Liu et al.6 proposed a double image encryption method based on random pixel exchanging and phase encoding in gyrator domains. Mao et al.7 presented a fast image encryption method, which was based on three-dimensional chaotic baker maps. Sivakumar and Venkatesan8 proposed an image encryption scheme. Knight’s travel path and true random number were adopted in this method. Wang et al.9 presented an efficient image encryption scheme using a two-step phase-shifting interference method, in fractional Fourier transform and random mixed encoding. Wang and Luan10 proposed an image encryption scheme using reversible cellular automata and chaos.

Since deoxyribonucleic acid (DNA) computing supports high parallelism, it is also superior in massive storage and extremely low power consumption. Many DNA-based methods have been proposed nowadays.1112.13.14.15 Zhen et al.12 presented an image encryption scheme based on chaotic sequence, DNA encoding, and entropy. Rehman et al.13 proposed a method that was based on chaos and DNA complementary rules for gray images. The most significant and least significant parts of each block were encoded with different methods. Wang et al.16 proposed an image encryption technique based on DNA sequence and coupled map lattice. The scheme could resist different attacks and enhance the system’s security. Wang et al.17 also designed an image encryption method based on a two-dimensional (2-D) logistic map and DNA sequence. DNA addition, DNA subtraction, and DNA complementary rules were used to obtain the ciphered image. Belazi et al.18 designed an equivalent mathematical model of the cryptosystem and algebraic analysis was given. By finding equivalent keys, key space was reduced. The authors also proposed a recovering scheme with lower complexity than the actual decryption method. In Ref. 19, a 2-D logistic map was employed for row circular permutation and column circular permutation. Initial values and system parameters of the chaotic system were calculated first. Abd-El-Hafiz et al.20 proposed two measures for the evaluation permutation skills. Two parameters were proposed in the program.

The rest of this paper is arranged as follows. Section 2 briefly introduces the two-dimensional sine iterative chaotic map with infinite collapse (ICMIC) modulation map (2D-SIMM), random number generation, DNA operations, and improved expanded exclusive OR (XOR) operation. Section 3 describes the proposed scheme. Section 4 depicts the simulation results. Section 5 presents security analysis and the conclusion is described in Sec. 6.


Preliminary Work


Two-Dimensional Sine ICMIC Modulation Map

2D-SIMM21 is defined as


where a and b are the positive system parameters. While a=1 and b=5, the system of 2D-SIMM is a hyper chaotic map. Compared with the 2-D sine logistic modulation map (2D-SLMM)22 and 2-D logistic map,17 2D-SIMM has better ergodicity, larger key space, more complex dynamical behaviors, and phase space trajectory.21 More secure chaotic sequences could be produced with the system. 2D-SIMM is employed in this paper to generate chaotic sequences.


Random Number Generation

The sequences produced by 2D-SIMM are decimal real numbers. The fractional part of a real number is changed into equivalent binary format. The former 16 bits of binary value are separated into two halves each with 8 bits.8 They are executed XOR operation to generate a random number finally.

The process can be described as follows. Suppose the value generated by 2D-SIMM is 0.63636. The binary bit streams of the fractional part are 10100010111010000111…..

The former 16 bits are 1010001011101000. The first half is (T158)=(10100010)2, and the other half is (T70)=(11101000)2. The generated random number (R)=T158 XOR T70=(01001010)2.


Deoxyribonucleic Acid Operations

DNA is two twisted strands, which are composed of four bases: adenine (A), cytosine (C), thymine (T), and guanine (G).13 (A) and (G), respectively, bond with complement (T) and (C), and vice versa. 00, 01, 10, and 11 are represented as A, C, G, and T, respectively. Each pixel is transformed into a DNA sequence with length 4 in. 8-bit gray image. The rule for DNA XOR is shown in Table 1.

Table 1

XOR operation of DNA sequence.


The DNA complementary rule must satisfy that17


where D(x) is different from x in at least 1-bit position.

There are six DNA complementary rules as follows:

  • 1. G → T, T → A, A → C, C → G;

  • 2. G → T, T → C, C → A, A → G;

  • 3. G → C, C → A, A → T, T → G;

  • 4. G → C, C → T, T → A, A → G;

  • 5. G → A, A → T, T → C, C → G; and

  • 6. G → A, A → C, C → T, T → G.

A complementary rule23 is defined, which processes the alphabet in doubles instead of one by one. Assume that (xx) is the token and D(xx) defines its complement.

Here, the same property must apply as follows:



Notice that the double complement of xx is D[D(xx)]. D{D[D(xx)]} is its triple complement and D15(xx) is its 15-fold complementary. The number of two-by-two complementary rules is 15! (1307674368000). It is far more than traditional complementary rules that total 3! (6) legal rules. The method could expand key space for a cryptographic system efficiently. A legal complementary rule is shown in Table 2.

Table 2

A legal two-by-two complementary rule.



Improved Expanded XOR Operation

The improved expanded XOR operation24 is applied to enhance the security and to increase the complexity of information. For two inputs x=i=07xi·2i and r=i=010ri·2i, the Extended XOR (eXOR) operation can be defined as


where not(x) flips a single bit x, and the “xy” represents the XOR operation. It has the following performance:

If eXOR(x,r)=t, then eXOR(t,r)=x.

This property can be proved by Table 3.

Table 3

The results of not (xi⊕ri⊕ri+3).



Image Encryption and Decryption Scheme


Secret Key and Random Number Generation

In this scheme, gray level images with the size of M×N are applied to demonstrate the proposed scheme. The initial values x0 and y0 could be calculated as follows:




where x010, x020, y010, y020, and N0 represent the initial secret keys. (x01,y01) denotes the initial condition of row encryption, and (x02,y02) denotes the initial condition of column encryption. “x mod y” refers to the module operation.


Matrix-Level Encryption


Row encryption

The steps of row encryption are displayed as follows:

  • Step 1. i=1. The initial values (x01,y01) are obtained by Eq. (5). Iterate 2D-SIMM N0 times and the sequences are discarded in order to avoid the transient effect.

  • Step 2. Continue to iterate 2D-SIMM again and then obtain the new values (x,y).

  • Step 3. The fractional parts of the values (x,y) are converted into binary streams (S,T).

  • Step 4. The 22 most significant bits of S are employed to build random numbers k1, and the 16 most significant bits of T are adopted to build random numbers k2.

    S2111first half11  bits,S100second half11  bits,and k1S2111XORS100.
    T158first half8  bits,T70second half8  bits,andk2T158XORT70.




    where k1, k2 are the integers, and k1[1,2047], k2[1,N1].

  • Step 5. For i’th row pixels P(i,), do P(i,)=eXOR[P(i,),k1].

  • Step 6. A k2-bit right cyclic shift is performed on P(i,).

  • Step 7. i=i+1 and update (x,y) by


    where s1 is the mean of P(i,).

  • Step 8. Do steps 1 to 7 again until i>M.


Column encryption

The steps of column encryption are shown as follows:

  • Step 1. j=1. The initial values (x02,y02) are produced by Eq. (6). Iterate 2D-SIMM N0 times and the sequences are discarded for avoiding transient effect.

  • Step 2. Iterate 2D-SIMM once again and get new (x,y).

  • Step 3. The fractional part of the values (x,y) is converted into binary streams (U,V).

  • Step 4. The 22 most significant bits of U are employed to build random numbers k3, and the 16 most significant bits of V are employed to build random numbers k4.

    U2111first half11  bits,U100second half11  bits,andk3U2111XORS100.
    V158first half8bits,V70second half8  bits,andk4U158XORS70.




    where k3, k4 are the integers, and k3[1,2047], k4[1,M1].

  • Step 5. For j’th column pixels P(·,j), do P(·,j)=eXOR[P(·,j),k3].

  • Step 6. Connect P(·,j) into a circle. Shift the pixels to up k4 steps.

  • Step 7. j=j+1 and update (x,y) by


    where s2 is the mean of P(·,j).

  • Step 8. Do steps 1 to 7 in a loop until j>N.

New pixel matrix P is obtained finally.


DNA-Level Encryption

DNA encryption is depicted as follows:

  • Step 1. DNA encoding is performed on the new matrix P, and DNA-encoded matrix Pb is obtained with size M×4N.

  • Step 2. A chaotic sequence C=(c1,c2,,cMN) is generated under initial condition x01 and y02 using Eq. (1). Here, ci=xi(i=1,2,,MN).

  • Step 3. Convert ci (1iMN) into corresponding binary format. The former 8 bits are encoded using DNA encoding rule. The length of sequence C1 is 4MN.

  • Step 4. Rearrange the sequence C1 to form a matrix Q with size M×4N.

  • Step 5. The two matrices Q and Pb are executed DNA XOR operation to generate matrix H,



  • Step 6. Iterate 2D-SIMM once again and get the new (x,y)


    z is the number of the two-by-two complementary rule that has been chosen for image encryption and z[1,15!].

  • Step 7. Iterate 2D-SIMM N0 times and the sequences are discarded with the initial values x02 and y01.

  • Step 8. Iterate 2D-SIMM f0 [f0=max(M,2N)] times again. Then, two chaotic sequences E=(x1,x2,,xM) and F=(y1,y2,,y2N) are generated.

  • Step 9. Transform E and F into matrices K1(M,1) and K2(1,2N). Multiply K1 and K2 to obtain matrix K with size M×2N


    i[1,M], j[1,2N], and L(i,j)1,15.

  • Step 10. Use the z’th two-by-two DNA complementary rule to operate on matrix H.

    for i=1: M

     for j=1: 2N

      if L(i,j) is equal to w and w is integer,

      Then, change H(i,2j1) and H(i,2j) to be Dw[H(i,2j1)H(i,2j)]



    Here, w1, 15, and Dw(xx) means its w’th complement.

  • Step 11. Convert DNA cipher matrix H into decimal number.

  • Step 12. Cipher image is obtained finally.


Image Decryption

The decryption algorithm is the reverse process of the encryption algorithm. It could be described briefly as follows. First, DNA decryption is applied. Then, column decryption and row decryption are performed. Finally, the plain image is obtained.


Simulation Results

The experiments of the proposed algorithm are simulated on the MATLAB 2010b platform. In this paper, Lena, Baboon, peppers, Terrace, and Jokul are used as original images. The size of the plain image is 256×256, as shown in Fig. 1. The initial keys are set (x010, x020, y010, y020, and N0) = (0.3462, 0.5484, 0.7425, 0.8562, and 150).

Fig. 1

Plain images: (a) Lena, (b) Terrace, (c) peppers, (d) Jokul, and (e) Baboon.


The experimental results are demonstrated in Fig. 2. Figures 2(a)2(c) are plain images, cipher images, and decrypted images.

Fig. 2

Cipher and decrypted images (Baboon, Terrace, and Lena): (a) plain image, (b) cipher image, and (c) decrypted image.


The decrypted image is lossless and the same as the plain image with the proposed scheme.

Two schemes of Ref. 16 and 21 are employed for contrasts of performance evaluations. Encrypted images with different methods are shown in Fig. 3.

Fig. 3

Plain image and cipher image with different methods: (a) plain image, (b) Liu’s scheme,21 (c) proposed scheme, and (d) Wang’s scheme.16



Security Analysis

An excellent encryption algorithm could resist many kinds of attacks, such as a statistical attack, brute-force attack, differential attack, and plaintext attack, and so on.


Key Space and Sensitivity Analysis

An excellent image encryption algorithm should be very sensitive to secret keys, and key space should be large enough to resist the brute-force attack. In the proposed scheme, the secret keys are x010, x020, y010, y020, and N0. The number of two-by-two DNA complementary rules is a factorial of 15 (15!). If the precision of the system is 1016, then the key space of the proposed scheme is 1016×1016×1016×1016×1016×15!1.3×1076. It will be large enough to withstand an exhaustive attack.

In the paper, secret keys are set (x010, x020, y010, y020, and N0) = (0.3462, 0.5484, 0.7425, 0.8562, and 150). If a tiny alteration (106) is brought in one of the initial values, the others remain the same. The decrypted images are depicted in Fig. 4. The difference between improper decrypted images [Figs. 4(b)4(f)] and the plain image is almost 99.7%. So, the proposed scheme is very sensitive to the system key.

Fig. 4

Decrypted images with different secret keys: (a) decrypted image using the right key, (b) decrypted image with x010+106, (c) decrypted image with x020+106, (d) decrypted image with y010+106, (e) decrypted image with y020+106, and (f) decrypted image with N0+1.



Histogram Analysis

An excellent encryption scheme should provide the flat histogram of the encrypted image. The histograms of a plain image and its encrypted image are shown in Fig. 5. It indicates that the numbers of every pixel value of the encrypted image are nearly even. It demonstrates that a statistical attack is invalid to the proposed algorithm. Histograms of plain and cipher images are displayed in Figs. 5(a) and 5(b).

Fig. 5

Histograms of plain and cipher images (Baboon, Terrace, and Lena): (a) histogram of plain image and (b) histogram of encrypted image.



Correlation Analysis

The correlation coefficient rxy between two adjacent pixels x and y are defined as


where cov(x,y)=1Ni=1N[xiE(x)][yiE(y)], E(x)=1Ni=1Nxi, D(x)=1Ni=1N[xiE(x)]2.

7225 pairs of adjacent pixels from the plain image and encrypted image are chosen in the horizontal, vertical, and diagonal directions. Figure 6 shows the correlation of two adjacent pixels in the Lena image and its cipher image. It can be shown that correlation is very high in the plain image but correlation is extremely low in the cipher image.

Fig. 6

Correlation analysis in three directions of plain image and cipher image: upper frame with horizontal distribution, center with vertical distribution, and lower with diagonal distribution.


Table 4 shows the values of correlation coefficients of two adjacent pixels in Fig. 6. The results in the proposed scheme are compared with the results in Refs. 16, 21, 22, and 25. The results reveal that the proposed algorithm is rather good.

Table 4

Analysis of correlation coefficients.

Plain image0.94250.97010.9248
Ref. 160.00280.00320.0052
Ref. 210.00330.00280.0039
Ref. 220.00480.00370.0034
Ref. 250.00620.00760.0053


Information Entropy

Information entropy is one of the most important features of randomness. If m is the information source, then information entropy is calculated as follows:


where p(mi) denotes the probability of symbol mi and L is the total number of mi. The maximum information entropy is 8. The information entropy of cipher images is listed in Table 5.

Table 5

Information entropy of cipher image.



Differential Attack

Number of pixels change rate (NPCR) and unified average changing intensity (UACI) are two parameters that are most widely adopted to measure the sensitivity to the plain image.21 NPCR and UACI are used to test the system to resist differential attacks. NPCR and UACI are calculated as




D(i,j)={0,if  C1(i,j)=C2(i,j)1,else.

NPCR=99.61% and UACI=33.32%. The experiments demonstrate that the proposed scheme could effectively resist a plaintext attack and differential attack.


Noise Attack

During processing, transmission or an attack from an intruder, the encrypted image will be inevitable to confront with noise. The robust image encryption scheme should withstand a slight noise attack. Figure 7 shows the decrypted Lena with different kinds of noises and intensities.

Fig. 7

Results of antinoise. Decrypted image of Lena with (a) salt and pepper, 0.02; (b) salt and pepper, 0.05; (c) salt and pepper, 0.1; (d) Gaussian, 0.02; (e) Gaussian, 0.05; and (f) Gaussian, 0.1.


As shown in Fig. 7, the decrypted image can be recovered even the encrypted image with noise.


Known-Plaintext and Chosen-Plaintext Attacks

In the proposed scheme, the iteration condition of 2D-SIMM will be changed by the encrypted pixel value. Even if an invader uses all black or white images as the chosen plain image, the proposed scheme could resist attacks. That is because row encryption, column encryption, and DNA-level encryption will be different if the plain image is changed. Therefore, the proposed scheme could resist known-plaintext and chosen-plaintext attacks.



In this paper, an image encryption scheme is proposed based on two-by-two DNA complementary rules and 2D-SIMM. First, the plain image is performed confusion and permutation operations. Then, DNA-level encryption is executed. The extended XOR operation is applied to help the image encryption scheme to resist plaintext attacks. The experimental results prove that the scheme could afford a differential attack, brute-force attack, statistical attack, and plaintext attack. The security of the system is very high. The proposed method is suitable for practical application.


I declare that there is no conflict of interest in the manuscript.


This research was financially supported by the National Natural Science Foundation of China (Grant No. 61272469), the Natural Science Foundation of Fujian Province (Grant No. 2016J05153), and the Outstanding Youth Scientific Research Training Program of Fujian Province (2017).


1. E. Shannon, “Communication theory of secrecy systems,” Bell Labs. Tech. J. 28(4), 656–715 (1949). http://dx.doi.org/10.1002/j.1538-7305.1949.tb00928.x Google Scholar

2. Z. Liu and S. Liu, “Double image encryption based on iterative fractional Fourier transform,” Opt. Commun. 275, 324–329 (2007).OPCOB80030-4018 http://dx.doi.org/10.1016/j.optcom.2007.03.039 Google Scholar

3. J. Chen et al., “An efficient image encryption scheme using lookup table–based confusion and diffusion,” Nonlinear Dyn. 81(3), 1151–1166 (2015).NODYES0924-090X http://dx.doi.org/10.1007/s11071-015-2057-6 Google Scholar

4. J. Chen et al., “An efficient image encryption scheme using gray code based permutation approach,” Opt. Laser. Eng. 67, 191–204 (2015).OLENDN0143-8166 http://dx.doi.org/10.1016/j.optlaseng.2014.11.017 Google Scholar

5. H. Liu et al., “Image encryption using DNA complementary rule and chaotic maps,” Appl. Soft Comput. 12(5), 1457–1466 (2012). http://dx.doi.org/10.1016/j.asoc.2012.01.016 Google Scholar

6. Z. Liu et al., “Double image encryption scheme by using random phase encoding and pixel exchanging in the gyrator transform domains,” Opt. Laser. Technol. 47(1), 152–158 (2013).OLTCAS0030-3992 http://dx.doi.org/10.1016/j.optlastec.2012.09.007 Google Scholar

7. Y. Mao et al., “A novel fast image encryption scheme based on 3D chaotic baker maps,” Int. J. Bifurcat. Chaos 14(10), 3613–3624 (2011).IJBEE40218-1274 http://dx.doi.org/10.1142/S021812740401151X Google Scholar

8. T. Sivakumar and R. Venkatesan, “A new image encryption method based on Knight’s travel path and true random number,” J. Inf. Sci. Eng. 32(1), 133–152 (2016). http://dx.doi.org/10.6688/JISE.2016.32.1.8 Google Scholar

9. Q. Wang et al., “Double image encryption using phase-shifting interferometry and random mixed encoding method in fractional Fourier transform domain,” Opt. Eng. 52(8), 084101 (2013). http://dx.doi.org/10.1117/1.OE.52.8.084101 Google Scholar

10. X. Wang and D. Luan, “A novel image encryption algorithm using chaos and reversible cellular automata,” Commun. Nonlinear Sci. 18(11), 3075–3085 (2013).1007-5704 http://dx.doi.org/10.1016/j.cnsns.2013.04.008 Google Scholar

11. H. Mousa et al., “Data hiding based on contrast mapping using DNA medium,” Int. Arab J. Inf. Technol. 8(2), 147–154 (2011). Google Scholar

12. P. Zhen et al., “Chaos-based image encryption scheme combining DNA coding and entropy,” Multimed. Tools Appl. 75(11), 6303–6318 (2016). http://dx.doi.org/10.1007/s11042-015-2573-x Google Scholar

13. A. U. Rehman et al., “Selective encryption for gray images based on chaos and DNA complementary rules,” Multimed. Tools Appl. 74(13), 4655–4677 (2015). http://dx.doi.org/10.1007/s11042-013-1828-7 Google Scholar

14. J. Zhang et al., “Image encryption algorithm based on DNA encoding and chaotic maps,” Math. Probl. Eng. 2014, 1–10 (2014). http://dx.doi.org/10.1155/2014/917147 Google Scholar

15. S. Sun, “A novel secure image steganography using improved logistic map and DNA techniques,” J. Internet Technol. 18(3), 647–652 (2017). Google Scholar

16. X. Wang et al., “A novel chaotic image encryption scheme using DNA sequence operations,” Opt. Laser. Eng. 73, 53–61 (2015).OLENDN0143-8166 http://dx.doi.org/10.1016/j.optlaseng.2015.03.022 Google Scholar

17. X. Wang et al., “A novel image encryption scheme based on 2-D logistic map and DNA sequence operations,” Nonlinear Dyn. 82(3), 1269–1280 (2015).NODYES0924-090X http://dx.doi.org/10.1007/s11071-015-2234-7 Google Scholar

18. A. Belazi et al., “Algebraic analysis of a RGB image encryption algorithm based on DNA encoding and chaotic map,” Nonlinear Dyn. 76(4), 1989–2004 (2014).NODYES0924-090X http://dx.doi.org/10.1007/s11071-014-1263-y Google Scholar

19. X. Chai et al., “A novel chaos-based image encryption algorithm using DNA sequence operations,” Opt. Laser. Eng. 88, 197–213 (2017).OLENDN0143-8166 http://dx.doi.org/10.1016/j.optlaseng.2016.08.009 Google Scholar

20. S. K. Abd-El-Hafiz et al., “Novel permutation measures for image encryption algorithms,” Opt. Laser. Eng. 85, 72–83 (2016).OLENDN0143-8166 http://dx.doi.org/10.1016/j.optlaseng.2016.04.023 Google Scholar

21. W. Liu et al., “A fast image encryption algorithm based on chaotic map,” Opt. Laser. Eng. 84, 26–36 (2016).OLENDN0143-8166 http://dx.doi.org/10.1016/j.optlaseng.2016.03.019 Google Scholar

22. Z. Hua et al., “2D sine logistic modulation map for image encryption,” Inform. Sci. 297(C), 80–94 (2016). http://dx.doi.org/10.1016/j.ins.2014.11.018 Google Scholar

23. A. Khalifa and A. Atito, “High-capacity DNA-based steganography,” in Informatics and Systems, pp. 76–80, IEEE, Cairo, Egypt (2012). Google Scholar

24. X. Wang and H. Zhang, “A color image encryption with heterogeneous bit-permutation and correlated chaos,” Opt. Commun. 342, 51–60 (2015).OPCOB80030-4018 http://dx.doi.org/10.1016/j.optcom.2014.12.043 Google Scholar

25. X. Wang et al., “A fast image algorithm based on rows and columns switch,” Nonlinear Dyn. 79(2), 1141–1149 (2015).NODYES0924-090X http://dx.doi.org/10.1007/s11071-014-1729-y Google Scholar


Shuliang Sun received his BS degree from Hangzhou Dianzi University in 2003, his MS degree from Guangxi University in 2006, and his PhD from Tongji University in 2011. He is a teacher at the School of Electronics and Information Engineering, Fuqing Branch of Fujian Normal University, China. His research interests include optical pattern recognition, optical image processing, and optical communication.

© The Authors. Published by SPIE under a Creative Commons Attribution 3.0 Unported License. Distribution or reproduction of this work in whole or in part requires full attribution of the original publication, including its DOI.
Shuliang Sun, Shuliang Sun, } "Chaotic image encryption scheme using two-by-two deoxyribonucleic acid complementary rules," Optical Engineering 56(11), 116117 (30 November 2017). https://doi.org/10.1117/1.OE.56.11.116117 . Submission: Received: 21 July 2017; Accepted: 13 November 2017
Received: 21 July 2017; Accepted: 13 November 2017; Published: 30 November 2017

Back to Top