A DNA Cryptographic Solution for Secured Image and Text Encryption

In recent days, DNA cryptography is gaining more popularity for providing better security to image and text data. This paper presents a DNA based cryptographic solution for image and textual information. Image encryption involves scrambling at pixel and bit levels based on hyperchaotic sequences. Both image and text encryption involves basic DNA encoding rules, key combination, and conversion of data into binary and other forms. This new DNA cryptographic approach adds more dynamicity and randomness, making the cipher and keys harder to break. The proposed image encryption technique presents better results for various parameters, like Image Histogram, Correlation co-efficient, Information Entropy, Number of Pixels Change Rate (NPCR), and Unified Average Changing Intensity (UACI), Key Space, and Sensitivity compared with existing approaches. Improved time and space complexity, random key generation for text encryption prove that DNA cryptography can be a better security solution for new applications. Keywords—DNA cryptography; image encryption; text encryption; DNA digital coding; DNA sequences


I. INTRODUCTION
Security is often a crucial necessity for sensitive data transmission over communication networks. Various security techniques used to provide information privacy bring benefits to an organization or individual businesses [1]. There exist many benchmarks symmetric and asymmetric cryptographic algorithms such as Advanced Encryption Standard (AES), IDEA (International Data Encryption Algorithm), and RSA (Proposed by Rivest, Shamir, and Adleman) to provide security to text data. But the survey provides evidence that these algorithms are not suitable for image encryption [2,3,10,24]. Image data characteristics like pixel correlation, bulk space, and high redundancy among pixel values make image encryption more challenging compared to text encryption [3,10]. Image Encryption plays a vital role in secured multimedia communication but the existing symmetric and asymmetric algorithms suffer from side-channel attack, Brute Force attack, Differential attack, and other statistical attacks [4]. There is a marked lack of better image cryptographic system. The proposed DNA based image Cryptosystem makes use of chaotic sequences to overcome existing limitations of symmetric and asymmetric cryptographic systems along with its confusion and diffusion properties [3]. To bring dynamicity, better storage, and time complexity, high parallelism, and low power consumption Adleman introduced DNA computing in 1994, which makes DNA cryptography the right choice for today's Internet applications [5]. DNA computing is still an area of interest for many researchers for its massively parallel processing capabilities and high resistance to brute force attacks [6]. The existing image encryption standards and mathematical models combined with DNA cryptography show defects in terms of CPU time, memory consumption, and battery usage [11]. The proposed DNA based approach for image encryption employs a chaotic sequence, which is deterministic and can produce a non-linear sequence [7]. It brings the advantages of unpredictability, pseudo randomness, and extremely sensitive to system control parameters and initial values [4,7,10,13,24,27]. Also, Chaos systems can eventually return to the original state from the proceeded state [8][9][10]. The proposed approach involves a sequence of steps, such as the use of five-dimensional hyperchaotic sequences that produce a strong ciphered image, scrambling at the pixel level and bit level. The analysis of various parameters like Image Histogram, Correlation coefficient, Information Entropy, NPCR, and UACI, Key Space, and Sensitivity shows that the proposed technique overcomes the limitations of the existing image encryption techniques. This paper also presents DNA based text encryption technique, which is based on the motivation of Kerckhoff's principle, which states that secrecy of transmitted message depends on key during decryption and not on an algorithm for encryption and decryption. At a high level, the algorithm is secure if the cryptanalyst is unable to deduce the key to obtain plaintext from the corresponding ciphertext [26]. This DNA based text encryption method uses the knowledge of random key generation to produce different sequences for the same input to achieve enhanced security performance. The proposed text encryption method outperforms the existing encryption techniques in terms of time and space complexities [11]. In this paper, Section 2 presents a preliminary study of the proposed approach; Section 3 covers image encryption in detail with result analysis. Section 4 discusses text encryption with two cases and time and space requirement analysis.

II. PRELIMINARY STUDY
Traditional algorithms, including symmetric and asymmetric, are having many drawbacks concerning the exchange or use of a key. Compared to these, DNA cryptography can provide multifold security [45]. It provides an enriched security level [15,16]. Conventional block cipher algorithms are not suitable for secured multimedia communication over public networks [2,9,24,36,37]. On the other hand, DNA cryptography is gaining more attention with a variation of chaos-based substitution permutation architecture [8,16,29,30,34,36,37]. It can run with lesser www.ijacsa.thesai.org memory and reduced computational overhead when compared with other standards like Elliptic Curve Cryptography, Packet wavelet, Fourier transform, Cellular automata, etc. [3,8,12]. The chaos method combined with DNA cryptography proved secure against a chosen-plaintext attack and differential attacks based on the previous studies [3,17]. Boriga et al. proposed a 1D chaotic image encryption map that would be found weaker [23]. As there is a single variable is used, which makes easy prediction of initial values. Fidrich proposed use of 2D chaotic maps proved better diffusion properties. But, the use of a limited key space makes it easy to decode [18,19]. Chen et al. proposed 3D chaotic maps proved better confusion and diffusion properties [20,23]. Chen et al. presented a high complex 4D hyperchaotic system that brought many security advantages [38]. However, lower dimensional chaotic systems can be crackable as computer machines having limited precision. Understandably, only a portion of plaintext or ciphertext will help to get the key back [17]. Hence these are weaker against differential attacks [23].
The following are the demerits of previous works identified:  Low dimensional chaos methods face difficulty in providing high security [30].
 Existing image encryption techniques work well only for a homogeneous image dataset, like medical or satellite images.
 There is no such practically used chaos-based DNA cryptography that exists worldwide in different application areas [4].

A. Our Contributions
The following are the major contributions of this proposed work:  Capable of encrypting and retrieving highly sensitive images those are heterogeneous. The main features of these images are continuity, the large volume of data, and the strong association of adjacent pixels.
 During image encryption, pixel-level and bit-level permutation will render stronger cipher, which is difficult for an attacker to crack.
 The use of a 5D hyperchaotic system can ensure enhanced complexity and hence able to achieve improved security.
 Both image and text encryptions are possible over a single framework with better CPU latency.

III. DNA BASED IMAGE ENCRYPTION
The proposed image encryption technique performs a series of operations like scrambling using a 5D (fivedimensional) hyperchaotic method, XOR operations, and complementary rules to produce a solid ciphered image. [12,36]. It also includes scrambling at pixel and bit levels along with basic encoding rules and decomposition operations [17,18]. Scrambling at the pixel level can be made according to a predefined concept [35,36]. DNA cryptography with a chaotic system depends on mathematical applications [19].
Edward Lorenz proposed the chaos theory in 1963 for the first time [35]. Confusion and Diffusion are two main properties of a chaotic system. With the confusion property, we can ensure the exchange of image pixel position randomly without affecting actual pixels. Diffusion mainly focuses on substituting one-pixel value with other pixel values by applying some mathematical operations over image pixels.
Here only pixels will be permuted. Scrambling at bit level can make more difficulty in breaking the cipher by an attacker inducing reordering at bit levels. The proposed solution is a mixture of all these that can result in increased complexity for processes of encryption and decryption, making it harder for an attacker to crack.
Where A represents the binary value 00(Decimal Value 0), C represents the binary value 01(Decimal Value1), G represents binary value 10(Decimal Value 2) and T represents the binary value 11(Decimal Value 3) [16]. Every pixel represents a DNA sequence of length 4 in an 8-bit grayscale image. The proposed approach uses complementary rules for every character produced using DNA sequences. The complementary rule says about the base pairs. The bases, Adenine and Thymine can make one pair, and Cytosine and Genuine can make another pair [11][12][13][14][21][22][23].
Suppose be the set of bases A, T, C and G. Then complementary principle says the base string of the encoding bases as follows: Where and are complementary and are base pairs. According to above statements, six complementary rules are as follows: For each base of DNA sequence in terms of A, T, G, C their encrypted values will not remain same or equal [22].
DNA encoding and decoding operations are needed to map binary sequences into DNA bases and vice versa. Table II shows DNA encoding rules. There are 8 rules which satisfy the Watson-Crick complementary model [17,19,21,24,36,37]. Here the selection of DNA bases such as A, T, C, and G can be made by following the DNA encoding rules. We consider two digits of the binary value for the mapping at a time.
Assume the original image P has scale matrix M X N. To bring out-diffusion property for an image P, Scrambling at pixel and bit levels are performed [15][16][17]. It permutes the bits of an image by considering the pixel values. Also it uses 5-D hyperchaotic system to obtain chaotic sequences as discussed below.

B. Hyperchaotic System
The proposed system uses five-dimensional (5-D) chaotic systems to enhance security and to bring increased complexity for image encryption [18]. It is covered below. A hyperchaotic 5-D system represented as the following equations (1): Where t, u, v, w, x, y, z are system control parameters and c 1 , c 2 , c 3 , c 4 and c 5 are system state variables. There are many existing approaches which used different algorithms to bring security for encryption. Since image data is highly sensitive, the chaotic sequence approach could be better to maintain security as there is the ability to overcome dependency on image pixels by confusion and diffusion properties [19][20][21].

C. Scrambling at Pixel Level
First, compute the initial values c 1 , c 2 , c 3 , c 4 and c 5 of the 5-D hyper chaotic system as shown in equations (2) below: Where c 0 1 , c 0 2 , c 0 3 , c 0 4 and c 0 5 are initial keys [22]. Producing chaotic series for image encryption might cause a transient effect that is impermanent and can have a sudden change of the state. Scrambling at the pixel and bit levels of an image can cause transient effect by internal or nearby values. So, there is a need for having several cycles to avoid such transient effect over hyperchaotic system N times, as shown in equation (3) below: By continuing the cycles or iterations over this chaotic system up to MN times, three chaotic sequences s 1 , s 2 and s 3 are obtained.
Suppose the original plain image is P and its positions are (x, y). Let P' be the scrambled image of P and its positions are (x', y'). Then x' and y' can be calculated as below equations (4): Where absolute values of x and y indicates the rounding of nearest integer values either lesser or equal to x and y.

D. Scrambling at Bit Level
Scrambled image P' is now converted into a sequence of one-dimensional values for P' from P'(1) to P'(MN) beginning with leftmost upper side to rightmost lower side of an image. Now generate chaotic sequence s 3 as follows (6): Where r = 1, 2,…MN, Scrambled image P' and decimal sequenced values of will be then transformed into binary sequences respectively. Then scrambled sequence C is obtained by having a circular shift over binary sequence P'(r) by considering the least bit of s 3 ' as following equation (7): Finally, conversion from binary sequences into its equivalent decimal values can be required.
Then Constructed sequences can be converted into DNA sequences. DNA sequence F(i) is obtained by using XOR operation as below (15): Where i=1,2,…,4MN.
By using DNA replacement operation and complementary rules, get F'(i). F' can now be decoded to binary sequence G. Binary sequence G then translated into a decimal sequence.
Finally, an encrypted image R is obtained as below equations (16):

F. DNA Decryption
The decryption procedure is described as follows: First, the chaotic sequences are generated and used (as shown above). Then decimal sequence D is obtained by the following equations (17): By following DNA complementary rules and reverse replacement operations, now able to get F(i) as the DNA sequences. Now conversion from F(i) DNA sequence to C sequence is done by having bit-level scrambling. Then Convert C sequence into pixel-level scrambled image P'. Finally, the original image P is recovered from ciphered image P'.
Where D(i) is the value of the decimal sequence, a(i) is the value of the chaotic sequence, and R(i-1) is the value of the previous cipher pixel and R(i) is the value of the output cipher. Fig. 1 shows the flowchart of the proposed image encryption system. The original image is converted into DNA sequences by the use of chaotic sequences obtained from the 5D hyperchaotic system and scrambling at pixel and bit levels. The DNA sequences are then converted into an encrypted image by following DNA XOR and Complementary rules [22,41,42]. Table III shows the images that were considered in the proposed approach.   Histogram "MRI" (k) Encrypted "MRI" Image (l) Final Image Histogram "MRI" (m) Original "Peppers" Image (n) ) Initial Image Histogram " Peppers " (o) Encrypted " Peppers " Image (p) Final Image Histogram " Peppers " (q) Original "Ultrasound_Thyroid" Image (r) Initial Image Histogram " Ultrasound_Thyroid " (s) Encrypted " Ultrasound_Thyroid" Image (t) Final Image Histogram " Ultrasound_Thyroid" (u) Original " Aerial" Image (v) Initial Image Histogram "Aerial" (w) Encrypted "Aerial" Image (x) Final Image Histogram "Aerial". www.ijacsa.thesai.org

G. Image Encryption Results
1) Image histogram analysis: Image histogram represents the numbers of pixels that make an Image. Histogram Analysis helps us to understand the quality of image encryption [24]. A ciphered image histogram should have a uniform distribution [3,10,17,18,24,32]. Fig. 2 shows some centralized values for plain images(b,f,j,n,r,v) whereas there are more flat values for ciphered images(d,h,l,p,t,x) exists, which makes that the proposed system could withstand statistical attacks.
Key sensitivity refers to how much change in the key can impact to produce a ciphered image. Again this can be measured by parameters such as NPCR and UACI discussed above [18,19]. A good approach is always sensitive, even a small change in the key to bringing out more diffusion or permutation in an image [39]. Hence the proposed approach is said to be resistive against differential and statistical attacks.

3) Correlation co-efficient analysis:
Correlation coefficient values indicate the relationship between the pixels which are adjacent to each other [16,17]. Smaller the values of correlation co-efficient show the greater security against attacks as resisting ability against them [5,16,27,31]. Table IV lists the correlation coefficient values of six different images with diagonal, horizontal, and vertical values.
The proposed system could able to produce smaller coefficient values either in diagonal, horizontal, or vertical directions when compared to existing approaches listed in the following Table IV for   Where p and q are adjacent pixels. is the covariance between two pixels p and q. It is given as follows (19): Where ( ) ∑ ( ) ∑ 4) Information entropy: Shannon introduced Information Entropy in the year 1948, which describes how much information is provided by an image. It helps us to understand the uncertainty or randomness level of an image [3,16,29,43]. Uncertainty level before and after image encryption is measured. Reduced value of entropy indicates lesser the information provided by the encrypted image [18,27,31,32]. The entropy of information should be 8 for an 8 bit image [30]. And it must be having the range 0 through 8. Table V shows Information entropy values for six different images considered. The proposed approach can produce a higher value of information entropy for an image sample Peppers when compared to some existing approaches.
Let n be the source of information. So the entropy of information can be measured as follows (20): Where p(n i ) is the probability of appearance of variable n i and L indicates the length of an information in terms of total number of pixel variables.

5) Analysis of NPCR and UACI metrics:
The NPCR (Number of Pixels Change Rate) represents the number of different pixels in two images. In other words, NPCR helps us to understand the effect of change of single-pixel over an image. The UACI (Unified Average Changing Intensity) represents the difference in average pixel values of intensity between two images [1-5, 16-18,27, 29, 30-32]. Here the original image and an encrypted image for computations are considered. Ciphered image will significantly change if there is a tiny change in the pixel of a plain image.
Suppose C 1 , C 2 are two ciphered images. Assume that these ciphered images are having a single pixel difference with their corresponding plain images. Let C 1 (i,j) and C 2 (i,j) at row i and column j respectively are two gray-level representations of the ciphered images C 1 and C 2 .
The NPCR is obtained as follows (21): Where

{
The UACI is calculated as follows (22): Where W and H correspond to the width and height of the image. Table VI shows the values of NPCR and UACI of various images. It is found that when compared with existing approaches, the proposed approach can obtain a higher UACI value for the encrypted Lena picture. The NPCR value for encrypted Lena image is almost nearer to existing approaches. A higher value of the NPCR and UACI means the system is safer against differential attacks.

IV. DNA BASED TEXT ENCRYPTION
Symmetric algorithms are quicker in performing computations. One problem with these algorithms is more security breaches since single key usage. It means if an intruder receives the single key shared over a public channel, it can hack the entire network [9,28]. Public key cryptographic algorithms, on the other hand, have proved adequate security for the systems. But here, more time is required to perform computations. There are some recent works in which the concept of DNA cryptography is combined with traditional algorithms such as AES, RSA, and ECC have provided better security for text-related encryption and transmission in the current computing age [20,23,33]. Due to its uniqueness, randomness, increased storage capabilities, high parallelism DNA Computing is gaining more popularity in cloud computing, Ubiquitous computing areas [15].
This section discusses, along with the study of its performance, DNA-based text encryption and decryption processes.

A. DNA based Text Encryption/Decryption
The text encryption/decryption uses DNA encoding rules including a single-point fusion, mutation, and complementary rules. Single-point cross over is the one where two bases are merged in order to build other bases. Mutation means modification in a DNA sequence by some means [25]. Here in every encryption, a random key will be generated and is used to encrypt data. The same is used during decryption to decrypt the ciphertext. It is important to generate random keys that are to be used to preserve the dynamicity of the proposed work [26,28]. It means different transactions use different keys to produce different ciphertexts. It makes a more difficult cipher to break by an attacker. The Algorithm below shows the stepby-step procedure for the text encryption method of the proposed model. The decryption technique is precisely the reverse of an encryption process [44,46]

B. Text Encryption Results
The proposed system can support Image and text encryption under a single framework. Text encryption begins upon selecting the -Text‖ radio button followed by clicking the Process Encryption and Decryption Operation button, as shown in Fig. 3. In this proposed approach DNA cryptographic functions are designed and implemented with the use of Python script. The front end and the algorithm calling functions are designed using C # language written over Microsoft Visual C # Express. The following results were obtained on running python scripts over Spyder (Python 3.6) platform. The above example illustrates the proposed model for text encryption using DNA sequences with a text sample as -Hello‖. First, the key will be computed then it can be used to produce initial and final DNA sequences. Meantime, DNA encoding rules along with single-point crossover, mutation, and complementary rules are used to obtain encrypted text [46]. During the decryption process, the same procedure is repeated and reversed, with the same key value as shown in Case 1 [47].
When there is another communication session with the same text input as -Hello‖ as shown in Case 2, then it computes a key value that is different than the previous session key. This will bring the proposed approach to high dynamicity and randomness. Since the keys generated and used were different during the various sessions/transactions makes it difficult to access the key computationally. Hence plaintext recovery is infeasible for an attacker. Table VII shows time required values in seconds for encryption and decryption processes. The time required for encryption and decryption is often found to be comparatively closer and takes less time. The decryption needs little more time than the encryption. Table VIII shows the memory allocation (in bytes) of the proposed DNA Cryptographic method for encryption on disk. Table values indicate there is no need for more memory than the input file size.