{'fraction_non_alphanumeric': 0.025998336106489186, 'fraction_numerical': 0.014697726012201887, 'mean_word_length': 4.45781309118426, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An Analysis and Comparison Performance of DNA and Chaotic Method Combination for Image Encryption

There is a variety of important and personal information stored in an image that is often shared via the internet. Cryptography is one way to protect these image files, so that private information cannot be read by malicious third parties. The DNA and Chaos methods are one of the cryptographic methods that are widely proposed and combined. Some previous research proposes a combination of these two methods with a sequence of different methods and different testing techniques where all the research claims the results are very good. This research aims to analyze and compare the performance of two methods namely DNA-Chaos and Chaos-DNA with more complete measurement tools such as PSNR and SSIM to measure results visually, there is also entropy to measure the probability of encryption results can be solved, NPCR and UACI to find out encryption strength from differential attacks and image histogram analysis. From the test results, it appears that both methods have their own strengths and weaknesses. Chaos-DNA is superior in entropy, and UACI, while DNA-Chaos is superior in PSNR, SSIM and NPCR values, but the difference is not significant, so it can be said that the performance of the two methods is quite identical. The results of the histogram analysis also showed that the shape of the histogram generated from the encrypted image was also quite similar.


Introduction
In an era with the development of computer technology that is very fast at this time, the storage of files in physical form turned into file storage in digital form. Multimedia files such as images, audio, and video are also increasing and are stored in the cloud through the internet network. Advances in internet technology have a negative effect because of openness and network sharing so that the security of digital files against serious threats during the transmission process [1]. As a result, we need a system that can secure the confidentiality of multimedia information. Among various methods of protection, image encryption techniques are one of the most efficient and common methods for protecting digital file information especially images [2]. One popular cryptographic algorithm is Chaos Map [3], where this algorithm performs randomization with certain patterns in a system. Chaotic systems have properties where and their initial values are sensitive, aperiodic, and non-convergent [4,5]. Properties in chaotic systems can be used to generate random sequences. Research on chaos-based cryptography has been widely implemented before on digital images. However, in these studies it is said, many encryption algorithms use a single chaotic function, making it vulnerable to interpretation [6] Another cryptographic algorithm, Deoxyribo Nucleic Acid (DNA), this algorithm can be combined with chaotic algorithms to increase its safety. The workings of the DNA method is inspired by how the DNA of living things works. Information stored in DNA is stored as a code consisting of four elements namely adenine (A), guanine (G), cytosine (C) and thymine (T). In binary form, 0 and 1 are a complement, 00 and 11 are also complement, 01 and 10 are also complement. From this basis the DNA algorithm is concluded as A is 00, C is 01, G is 10 and T is 11 [7][8][9]. Each DNA element is paired with each other where A is paired with T and C is paired with G. These pairs will form a unit called the base pair, where each base pair will complement one another. In some research predecessors like [2] and [6] proposed a hybrid encryption technique that combines Chaos and DNA methods to improve image encryption security. This encryption is also called super encryption because it combines two different methods [10]. The difference is the order in which the methods are used, such as in research [2] DNA is done first then followed by chaos method, while in research [6] have the reverse method sequence. In research [2] the DNA-Chaos method has been tested and proven that this method is resistant to exhaustive attacks and has good test results. In more detail, in research [2] the stages of the research are started from an original image that is converted into a binary number matrix which is then translated into DNA language and the addition of chaotic maps, where chaotic maps are used are 2D Logistic Maps. However, the trial results are only measured using PSNR, although the results are very good at 7,988 dB. However, because the measuring instrument used is still incomplete, more detailed testing is needed. Just as in research [2], research [6] also concluded that the Chaos-DNA method is also a good combination of encryption and resistance to attack, where the encryption results are measured using entropy and PSNR. The results are also very good where the resulting PSNR values range from 7.86 to 9.59 dB and entropy values of 7.98 to 7.99 bits. In this study, a comparison of the two methods, DNA-Chaos and Chaos-DNA, will be carried out with various types of measurements aimed at analyzing the results more accurately, so that the best formula for the combination of these methods is known.

Deoxyribo Nucleic Acid (DNA) Cryptography
DNA must be possessed by all living things ranging from the smallest creatures such as viruses to complex living things like humans. DNA carries a lot of information from a living thing. DNA is also a long polymer of a small unit called nucleotides [11]. DNA is a kind of molecule that forms a genetic sequence. DNA pieces containing the genetic code are known as genes. The information contained in genes is stored in DNA [12]. In DNA there are basic forms of DNA structure that are shaped like two helices that form hydrogen bonds, namely Cytosine (C), Thymine (T), Adenine (A) and Guanine (G) [8]. There is a principle called Watson-Crick base complementary principle which is the relationship between several pairs, namely A (adenine) with T (thymine) and C (Cytosine) with G (guanine) so that they form a series of the double helix. This principle is then implemented in a cryptographic method called DNA cryptography. You do this by changing bases A, C, T, and G into bases 00, 11, 10 and 01. Furthermore, 24 conditioning patterns are made which are presented in Table 1. Table 1 shows 24 encoding forms of the DNA algorithm, which are divided into 8 combinations of encoding patterns. The number 11001001 (2) is the same as 201 (10) if it is coded into a form of DNA in combination with column 8 is ATGC. The results of the coding will make a different interpretation when they want to be returned to the form of binary numbers when someone uses the combination form [12]. For example, by using a combination of column 7, the result of the ATGC encoding should be 201(10) to 1100011(2) = 198(10). In general, in the process of encrypting images with the DNA method, the original image will take the bit value in each pixel to be used as a key, then the key is converted to hexadecimal which is then used as a binary number matrix. After that, the value of R, G, B in the picture is taken its bit value then translated into a DNA code that is A, T, G, C. Then the formation of mRNA comes from the opposite of the DNA code that was formed earlier. The final step is to perform an XOR operation using a key that has been obtained with mRNA to form an encrypted image

Chaos Map
Chaos Map is a polynomial mapping that shows a pattern of irregular chaotic maps [13], where the encryption technique used in chaos maps is diffusion or pixel scrambling [14]. Equations in the chaotic map can be seen in the formula (1).
In the encryption process, later pixels that have been encrypted are randomized using a logistic function to make images more complicated to decrypt.

Proposed Method
In this research, the method to be proposed is two methods to be compared, namely the DNA-Chaos method which will be explained in Scheme 1 and Chaos-DNA in Scheme 2. Both of these schemes will be measured, analyzed and compared to find out if there are differences in performance and if there can be which schema performance is better. Each scheme will consist of encryption and decryption processes.
3.1. Scheme 1 Figure 1. DNA-Chaos Encryption Process The schematic of the scheme 1 encryption process in Figure 1 is detailed as follows: 1) For the key generation process, the key is taken from a plain image byte array and converted to a byte array that is encrypted with the SHA 256 function. 2) Plain image is set to RGB pixel value, then the pixel value is converted to bits.
3) The bits are converted into arrays and then translated into messages in DNA cryptography. 4) The array that has been translated then converted into its opposite to form mRNA. 5) After the array value has become mRNA, then the array is randomized with chaotic sequences and produces a new DNA code. 6) Then with the XOR operation, an encrypted image is formed.  Figure 2 can be explained in more detail as follows: 1) The encrypted image will be taken by the RGB value first.
2) The RGB values that have been obtained are then operated on with XOR, then the DNA code that has been obtained is randomized with chaotic sequences to their original form. 3) Then the encrypted DNA code is rewritten in reverse from before then the decryption image will be obtained. The schematic of the scheme 2 encryption process in Figure 3 is as follows:: 1) Plain image is taken RGB values from the matrix and then randomized with chaos sequences then performed XOR surgery. 2) Then the image that has been formed, the bit value is taken and converted to an array. Arrays that have been formed are translated into codes in the DNA algorithm.

Scheme 2
3) The key formation process is taken from the bit value of the original image into an array and changed with the SHA 256 function. 4) The array that has been translated then converted into its opposite to form mRNA. 5) New encrypted images are formed.  Figure 4 can be explained in more detail as follows: 1) From the encrypted image, the RGB value is taken, then translated into the DNA code.
2) After that, the DNA code obtained will be translated again with the opposite to produce mRNA. Then it was scrambled back like everything with chaos sequences. 3) After that, it is operated on with XOR so that the decrypted image is obtained In this study, the proposed image encryption method will be implemented in color images in RGB format. So that the test results are better, the images used are quite diverse where each image has a different size and extension. All processes in this research use the Python programming language 3.7.3. The image used is presented in Table 2. In the first stage, encryption with scheme 1 and scheme 2 with key input and the original image is performed, resulting in an encrypted image which is presented in Table 3. In table 3 also a PSNR value is calculated from the difference between the original image and the encrypted image. PSNR value can be calculated from the MSE value, where if the greater the MSE, the PSNR value will be smaller, and vice versa. In cryptography, the target PSNR value is as small as possible because the smaller the PSNR the more different the encryption results. In addition, SSIM values are also presented. SSIM is a wellknown quality metric that is relatively newer than PSNR, where the SSIM is measured measuring the degree of similarity between two images. SSIM has a value between 0-1, which means that if the value is getting closer to 1 then the image has a high level of similarity, and if getting closer to the number 0 then the similarity level of the two images is small. While the formula used to calculate SSIM and PSNR can be seen in research [15]. The results shown in table 3 show that the visual difference is not much different, but the DNA-Chaos method is slightly superior where the average PSNR produced is 27.9044 dB while the Chaos-DNA method produces a PSNR value of 27.91376 dB, as well as the SSIM method DNA-Chaos yields 0.0191 while the Chaos-DNA method produces values 0.0194. It can be concluded that visually the difference is very small and not as significant. In the next measurement the entropy, UACI, and NPCR values are tested. Entropy is a possible value that a file contains information about the key so that the file that has been mathematically encrypted can be decrypted [16]. Entropy can be calculated with equation (2).

Implementation and Testing
The NPCR and UACI first appeared in 2004 by Yaobin Mao and Guanrong Chen. Since then NPCR and UACI have become two of the most widely used methods of security analysis in encrypting images for differential attacks. The NPCR is centered on an exact number or an absolute number that indicates the value of how much the pixel's value changes. Whereas UACI focuses on the difference between the original image and the encrypted image [17]. NPCR has a distance between 0-1. If the NPCR shows the number 0 then all the pixels in picture A are the same as in picture B. And if the NPCR shows the number 1, then all the pixels in picture B change totally compared to picture A. The value in UACI also has a distance between 0-1 which indicates when the greater the value the difference in intensity between the two encryption images. Where in the case of image encryption, image A is the original image and image B is the encrypted image. The formula for calculating NPCR and UACI can be seen in research [17]. Whereas in Table 4 presents the value of Entropy, UACI, and NPCR. Based on Table 4 it can be seen that the method in scheme 1 is superior to the NPCR value while for entropy and UACI it is superior to the method contained in scheme 2. A histogram is a graphical representation of the color distribution of a digital image. This graphic consists of two axes namely Y or Vertical axes and X or Horizontal axes. The Y-axis represents the number of pixels of a gray level value, while the X-axis represents the gray level. The results of the histogram generated from the encrypted image are presented in Table 5. Where this histogram is a combination of all layers R, G, and B. Based on the results of the histogram presented in Table 5 it appears that the histograms of the two scheme schemes are quite similar. However, both of these methods also succeeded in significantly changing the shape of the image histogram.