A Color-Image Encryption Scheme Using a 2D Chaotic System and DNA Coding

. This paper proposes a method of encrypting images with password protection for secure sharing based on deoxyribonucleic acid (DNA) sequence operations and the tangent-delay ellipse reﬂecting the cavity-map system (TD-ERCS). The initial values of the TD-ERCS system are generated from a user’s password, and the TD-ERCS system is used to scramble the pixel locations of the R, G, and B matrices of the original image. Next, three DNA-sequence matrices are generated by encoding the permuted color image such that it can be transformed into three matrices. Then, the TD-ERCS system is employed to generate three chaotic sequences before encoding the DNA into the three matrices. Thereafter, a DNA exclusive OR (XOR) operation is executed between the DNA sequences of the permuted image and the DNA sequences generated by the TD-ERCS system to produce three encrypted scrambled matrices. Finally, the matrices of the DNA sequences are decoded, and the R, G, and B channels are recombined to form an encrypted color image. The results of simulation and security tests reveal that the proposed algorithm oﬀers robust encryption and demonstrates the ability to resist exhaustive, statistical, and diﬀerential attacks.


Introduction
With recent developments in technology and Internet-based activities, computer networks have fundamentally transformed human communication.Individuals can now join a variety of different networks to access and share various types of multimedia and data.However, online networks are not without risks, and due to the open nature of many networks, public concerns regarding the security and safety of data that is exchanged online are now higher than ever [1].
Digital images play a large role in multimedia communication, and thus, it is critical that appropriate mechanisms are in place to protect this information.Traditional block encryption approaches, such as AES, IDEA, and DES, can encrypt images effectively and ensure their safety to an extent.However, they cannot protect against transmission noise, which can be introduced to a digital image during the transmission process [2].
erefore, research must be conducted to investigate algorithms that can provide increased protection via more comprehensive image encryption.
Developments in the field of chaos theory have created new opportunities for image-encryption techniques.Chaosbased image-encryption algorithms are fast and secure methods that offer many beneficial features, such as ergodicity, mixing, and strong sensitivity to initial conditions and system parameters [3].erefore, they represent promising encryption approaches that can potentially provide the protection required to enhance the security of images shared via digital networks.
Since the 1990s, scholars have observed a close correlation between cryptography and chaos [4], and chaos can potentially be employed within the permutation-diffusion architecture proposed by Mao, Guan, and Pareek et al. [5][6][7].
is architecture has attracted the interest of researchers worldwide and has led to the expansion of chaos-based encryption.Despite the fact that these procedures have demonstrated some advances, chaos-based encryption is still considered to be weak against known/chosen plaintext attacks [8].A range of chaos-based innovations have emerged in this field, spanning various systems, including novel permutation techniques [9][10][11][12][13], new diffusion approaches [14,15], hyperchaotic map systems [16,17], a simultaneous image encryption-compression scheme [18,19], and novel transform domains [20,21].
However, many of these image-encryption schemes have been deciphered without knowing the secret keys.For instance, the chaos-based encryption in [4] is still reported to be weak against known/chosen plaintext attacks [22].In addition, a cryptographic analysis has been introduced in [23] to break a chaotic encryption scheme that employs autoblocking and electrocardiography, which produces a sequence of random numbers using a logistic map and a 2D Arnold map.Furthermore, another chaotic image cryptanalysis scheme based on image entropy has been proposed in [24]; however, it still retains the insecurity issues of the chaotic image cryptosystem.
One area of particular interest is deoxyribonucleic acid (DNA) coding-based cryptosystem.
ese revolutionary approaches to encryption exploit the vast storage space, immense parallelism, and ultralow power consumption of DNA computing [25].Given the significant potential of this area, researchers have studied a range of cryptosystem that combine chaos theory with DNA encoding [26][27][28][29][30][31][32][33][34][35][36][37].In [27,30,31,33], a logistic map and its variants were employed as key stream generators, whereas hyperchaotic systems within a DNA coding collaboration are introduced in [26,28,29,32,35,37]. e logistic map has some drawbacks for information encryptions, such as small key space, insufficient complexity, and low security, which allow easy decryption of the encryption schemes [38].Hyperchaotic systems within a DNA coding method have proven to be insecure by proposing a chosen plaintext attack method by Feng and He [39].
To overcome this problem, this paper proposes a new image-encryption approach that employs secure image sharing based on DNA-sequence operations and tangentdelay ellipse reflecting cavity-map system (TD-ERCS) maps.
e TD-ERCS system is used as chaotic map for its complexity and has proved to be immune against differential attacks [40].e preliminary values for the TD-ERCS system are produced by calculating SHA-256 from a user's password.
e encryption approach employs diffusion and confusion.e generated TD-ERCS system is used to permute the positions of the pixels in the original image, thereby confusing it.Subsequently, the permuted image is DNA encoded before the TD-ERCS system and DNA encoding are employed to generate a mask image.Next, DNA XOR is performed between the mask image and permuted image to generate the scrambled image.Finally, DNA decoding is applied to the scrambled image to generate an encrypted image and, in doing so, achieve diffusion.e remainder of this paper is organized as follows: Section 2 provides preliminaries, while Section 3 introduces the encryption scheme.Section 4 presents the experimental results and discussion, and Section 5 concludes the paper.

Preliminaries
In this section, a brief discussion of the TD-ERCS system and DNA sequences is provided.

DNA-Sequence Operations
2.2.1.DNA Encoding and Decoding.DNA is a biological material present in nearly all living organisms.Parents' DNA is transmitted to a child, thus causing the child to inherit the parents' features.In humans, DNA is shaped like a twisted ladder and contains four nucleobases: adenine (A), cytosine (C), guanine (G), and thymine (T) [44].Watson and Crick published an article in 1953 [45] that presented the DNA complementary rule. is rule states that adenine (A) bonds with thymine (T) and that guanine (G) bonds with cytosine (C). Figure 2 illustrates the structure of DNA.
A computer system deals with binary numbers and is composed of two numbers only: 0 and 1 that can be opposite or complementary.For instance, numbers 00 and 11 are complementary, as are 01 and 10. e four DNA bases A, C, G, and Tare used to represent a binary sequence of 00, 11, 10, and 01, respectively, in the DNA sequence.Eight coding rules convert the binary sequence into DNA code, as demonstrated in Table 1 [46].

Advances in Multimedia
A digital image comprises pixels of intensities in the range of 0 to 255.For an image pixel to be displayed, it is first transformed into a binary sequence of length 8 and then expressed as a DNA sequence of length 4. For instance, if the image pixel value is 89 (binary sequence: 01011001), it can be encoded into a DNA sequence (AATA) according to encoding rule #3.

DNA Exclusive OR Operation.
Due to the rapid development of DNA computing, several biological and algebraic operations have been proposed for DNA sequences, such as the XOR operation [47]. is operation is executed for a DNA sequence in the same way as a traditional XOR operation is executed in a binary sequence.Because there are eight DNA encoding rules, there are also eight DNA XOR rules.Table 2 presents the DNA XOR operations [48].

Proposed Algorithm
e encryption algorithm in this paper comprises two components: encryption and decryption.e algorithm has a pair of chaotic sequences (x, y) created by employing a TD-ERCS and three generated chaotic sequences: x, y, and z from a single map.In this study, x and y were used for position scrambling and x, y, and z were used for pixel  scrambling via the DNA XOR method.Figure 3 illustrates the proposed encryption and decryption schemes.

Key Generation.
e proposed encryption scheme employs a user's password to generate secret keys.First, SHA-256 is used to generate a message digest of 256 bits for the password.e 64 hash values of the message digest are then divided into eight hexadecimal groups: k 1 , k 2 , . .., k 8 .Each group contains eight hexadecimal values and is converted into a floating decimal number via the following equation: where j � 1, 2, . .., 8. e first set of the TD-ERCS initial values (μ, x 0 , α, and m) is computed by e second set of initial values (μ, x 0 , α, and m) for the TD-ERCS system is calculated as (4)

Image Encryption.
e process of encryption involves the following steps: Step 1. Conversion of the original color image to three matrices: R(m, n), G(m, n), and B(m, n).
Step 3. Use of the method outlined below to prepare the x and y chaotic sequences: where [•, •] � sort, (•) represents the type of index function, fx represents the new series of the X sequence, lx represents the index value of fx, and ly is equal to lx.
Step 4. Application of the combination (x new , y new ) for scrambling R, G, and B positions using Step where k ranges from 0 to M × N. us, the mask image is generated.
Advances in Multimedia Step 7. Conversion of X e , Y e , and Z e to binary matrices.DNA encoding is then employed to encode these matrices.is results in three remodeled coding matrices: X dna , Y dna , and Z dna , sized (m, n ×4).
Step 8. Execution of the DNA XOR operation among (R dna and X dna ), (G dna and Y dna ), and (B new and Z dna ). is results in three encrypted matrices: R c , G c , and B c .Step 9. Generation of the final encrypted image by performing a DNA decoding operation for R c , G c , and B c .
is results in three new matrices with values ranging from 0 to 255: R enc , G enc , and B enc .

Image Decryption.
e image decryption steps are as follows: Step 1. Conversion of encrypted color image to three matrices: R(m, n), G(m, n), and B(m, n).
Step 2. Conversion of R, G, and B to binary matrices.DNA encoding is then employed to encode these binary matrices, as detailed in Section 2.1.is results in three remodeled coding matrices: R dna , G dna , and B dna , sized (m, n ×4).
Step 3. Generation of three chaotic sequences X i � (x 1 , x 2 , . .., x mn ), Y i � (y 1 , y 2 , . .., y mn ), and is employs the starting values of the second set, μ, x 0 , α, and m, as discussed in Section 3.1.e generated values are then converted into range of 0 to 256 according to X e (k) � round abs X i (k)  × 1000 mod 256 , Y e (k) � round abs Y i (k)  × 500 mod 256 , Z e (k) � round abs Z i (k)  × 1000 mod 256 , (8) where k ranges from 0 to M × N. us, the mask image is generated.
Step 4. Conversion of X e , Y e , and Z e to binary matrices.
en, DNA encoding is employed to encode these matrices.is results in three remodeled coding matrices: X dna , Y dna , and Z dna , sized (m, n ×4).
Step 5. Execution of the DNA XOR operation among (R dna and X dna ), (G dna and Y dna ), and (B dna and Z dna ).
is results in three decrypted matrices: R d , G d , and B d .Step 6.Generation of a pair of chaotic sequences, x new � (x 1 , x 2 , . .., x mn ) and y new � (y 1 , y 2 , . .., y mn ), via a TD-ERCS chaotic map. is uses the first set of starting values, μ, x 0 , α, and m, as detailed in Section 3.1.
Step 7. Use of the method outlined below to prepare the x and y chaotic sequences: where [•, •] � sort, (•) represents the type of index function, fx represents the new series of the X sequence, lx represents the index value of fx, and ly is equal to lx.
Step 8. Application of the combination (x new , y new ) for recovering R d , G d , and B d positions using en, the final decrypted image is constructed by recombining these three matrices into a color image.
e first two rows show the USC-SIPI images, and the next two rows show the UCID images.Performance analysis was performed for the proposed encryption scheme in terms of histogram analysis, correlation coefficient analysis, and differential attack resistance using the number of pixels change rate (NPCR) and the unified average changing intensity (UACI).Simulation experiments were performed on a personal computer with Intel Core i7-6500U, 3.0 GHz, 4 GB using Matlab R2017a and the Windows 10 operating system.

Key Space Analysis.
For a secure cryptosystem, the key space must be large enough to withstand all kinds of bruteforce attacks.Furthermore, the key space of the proposed encryption scheme is represented by the TD-ERCS seed parameters.If the precision is set to 10 − 15 for all the parameters, the key space size is 10 90 .is key space is large enough to resist brute-force attacks.

Histogram Analysis.
Histograms of an image are used to represent the pixel distribution for each color intensity level.An ideal image-encryption algorithm produces a histogram of the encrypted image with a uniform distribution.e histograms of the original and encrypted image (Lena) are displayed in Figures 5(a)-5(d) for the red, green, and blue components, respectively.It should be noted that the histograms of encrypted images are flat and thus differ from the original images.
erefore, the proposed encryption scheme can resist statistical attacks.

Mean-Square Errors and Peak Signal-to-Noise Ratio.
e peak signal-to-noise ratio (PSNR) and mean-square error (MSE) are two error measures that are widely used for comparing image quality.e MSE refers to the cumulative square error between the original image and encrypted image.
e higher the value of the MSE, the higher the probability that the encrypted images are distorted and noisy.e MSE can be calculated according to where x(i, j) refers to the original image, y(i, j) refers to the encrypted image, and (i, j) refers to the coordinates of the image pixels of size M × N. e PSNR represents the noise ratio between the original image and the encrypted image and is measured in decibels (dB).Low PSNR values indicate that the encryption scheme results in high degradation of the encrypted images.Equation ( 12) is used to calculate the PSNR: where I max is the maximum intensity of the image.For an 8bit image, I max is set to 255.Table 3 displays the computed MSE and PSNR values for the test images.ese results demonstrate that the proposed encryption scheme can produce ciphered images with high degradation.

Correlation Coefficient Analysis.
Correlation refers to the linear relation between two variables.For images, it is used to indicate the relation between two adjacent pixels.Normally, plain images possess a high correlation between adjacent pixels.us, a secure encryption scheme should reduce the correlation between adjacent encrypted image pixels to resist a statistical analysis attack.To evaluate the correlation between two adjacent pixels, 4,000 pairs of neighboring pixels in the vertical, horizontal, and diagonal directions were randomly selected from a plain image and corresponding encrypted image.e correlation coefficient was computed according to where (r xy ) is the correlation coefficient, x and y are the graylevel values of two adjacent pixels, N is the number of pairs (x i , y i ), E(x) is the x i mean, and E(y) is the y i mean.Figure 6 illustrates the correlation coefficient for the original image (airplane) and the corresponding encrypted image.e correlation coefficient was computed for all test images vertically, horizontally, and diagonally; Table 4 provides the results.e results reveal that the correlation coefficient of the encrypted images is close to zero or negative.erefore, there is no correlation between adjacent image pixels.
Along with this analysis, the proposed scheme was compared to two representative methods from other schemes [34,35,49,50]; Table 5 presents the correlation coefficient results for the encrypted Lena image.e proposed scheme obtained results superior to those of the reference methods, as the encrypted image correlation coefficient values were smaller than those obtained by the reference methods.

Entropy Information.
In information theory, entropy information is defined as the uncertainty of information content and can be used to measure the randomness of a data sequence.It is expressed as follows:  Advances in Multimedia 7 where H is the image entropy and p(m i ) refers to the probability of symbol m.For digital images with 2 8 pixels of, the maximum information entropy is 8. e higher the entropy value of the encrypted image, the more uniform the distribution.Table 6 presents the information entropy results.From these results, it is evident that the entropy values of the test images are very close to the ideal value.is indicates that the proposed encryption scheme is secure   Advances in Multimedia against an entropy attack.In addition, Table 7 presents an average entropy analysis for the five images for the proposed method and the other reference methods from [36,37,43,51].e results indicate that the proposed scheme has superior performance, as demonstrated by its higher entropy values.
4.6.Differential Attack.Usually, the p attacker introduces a minor alteration (e.g., changing one pixel) to an unaltered image and, by doing so, creates a pair of cipher images that employ an identical encryption algorithm.e attacker then breaks into the cryptosystem by following the variations of this pair of encrypted images; this is referred to as a differential attack.
To examine what happens to an encrypted image when a single pixel is altered in the original image, the NPCR was calculated, as given in ( 15) and ( 16), and the UACI was computed, as given in (13): where M represents the width of the encrypted image, N represents the height, L is the pixel number, and T is the In the numerical experiment that follows, the original image was encrypted.A single pixel was then selected at random from the image, and a small modification was performed.
en, the plain image was reencrypted with modifications employing identical means.e UACI RGB and NPCR RGB values were then calculated using a pair of cipher images.Table 8 presents the relevant data for these experiments.As Table 8 demonstrates, this methodology resulted in sizable UACI and NPCR levels.us, the proposed algorithm could detect minuscule alterations to the plaintext and was able to repel a differential attack.
e proposed method was also compared with reference methods [36,37,43,51] for the encrypted Lena image, as presented in Table 9. e NPCR and UACI values for the proposed method are superior, as they are higher than the values obtained using the reference methods.

Analysis of Noise and Data Loss Attacks.
ere are several different types of noise existing in public multimedia channels such as Internet and wireless communication networks.Such noise belongs to a kind of attack that has no intentions; they decrease the image quality.Common types of noise include salt-and-pepper noise and Gaussian noise; they are different kinds of image noise.A wide range of noise is present in open interactive media channels such as wireless communication and the Internet.Such noise is a sort of attack that has no goals; it just distorts the image quality.Salt-and-pepper noise and Gaussian noise are the two types of image-noise attack.e experimental results in Figures 7 and 8 show the performance of the proposed algorithm after exposure to a noise attack.e experimental effect is illustrated in Figures 7 and 8; the top row shows the encrypted images after applying salt-and-pepper noise and Gaussian noise attacks on the test images.e bottom row shows the images reconstructed from the noisy images.Notably, the reconstructed images affected by the noise attack still retain most of the plain image information.ese experimental outcomes prove that the proposed algorithm has excellent performance against noise attacks.e original images can be recovered even if the communication channel is noisy.
e test against a data loss attack is shown in Figure 9. e top rows show the encrypted images after cutting parts of them in different sizes and locations, and the bottom rows Table 7: Average entropy analysis for the proposed method and other reference methods.

Proposed scheme
Reference [36] Reference [37] Reference [43] Reference   Advances in Multimedia 11 show the reconstructed images after cropping.e reconstructed images after the attack obviously contain most of the original image data and can still be recognized.

Conclusion
In this paper, a new image-encryption algorithm is proposed using a TD-ERCS chaotic system, DNA-sequence operation, and Secure Hash SHA-256.From the above discussion, the positions of the image pixels are permuted by the TD-ERCS system, and the pixel gray values of the plain image are scrambled using DNA-sequence XOR operations.Based on the experimental results and security analysis, the efficiency of the algorithm encryption is found to be good.Furthermore, the proposed algorithm is able to resist most common attacks, such as statistical analysis, exhaustive attacks, differential attacks, and noise attacks.All these features make the algorithm efficient for secure digital image transmission.

Figure 3 :
Figure 3: Encryption and decryption in the proposed scheme.

Figure 5 :
Figure 5: (a) Original image.(b-d) Histograms of the R, G, and B channels of the original image, respectively.(e) Encrypted image.(f-h) Histograms of the R, G, and B channels of the encrypted image, respectively.

Figure 6 :
Figure 6: Correlation coefficient analysis.(a, c, e) Vertical, horizontal, and diagonal correlation coefficients for the original image, respectively.(b, d, f ) Vertical, horizontal, and diagonal correlation coefficients for the encrypted image, respectively.

Table 3 :
PSNR and MSE test values.

Table 4 :
Correlation coefficients for original images and encrypted images.

Table 5 :
Correlation coefficient comparison for encrypted Lena image.

Table 6 :
Entropy analysis for five images.

Table 9 :
Comparison of NPCR and UACI between different schemes for the encrypted Lena image.