An image encryption algorithm based on a new memristor chaotic system and DNA variation

In this paper, a new memristor chaotic system is designed based on Chua’s memristor chaotic system. To get the complete picture of the brain of a three-dimensional chaotic attractor, red and blue 3D glasses is used to observe the chaotic attractor, and using Lyapunov exponent spectrum, SE complexity and C0 complexity to analyze dynamical characteristics of new memristor chaotic system. The results illustrate that the chaotic state of the new memristor chaotic system is distributed over a large parameter range, which shows that the new memristor chaotic system is more suitable for image encryption applications. To verify the image encryption application of the new memristor chaotic system, a novel image encryption algorithm is designed based on the new memristor chaotic system and DNA variation. The security performances of the designed algorithm indicate that the proposed algorithm can effectively encrypt image and has better security performance.


Introduction
In 1971, memristor is proposed by Chua, it is considered to be the fourth circuit element in addition to the other three well-known basic components of the circuit. In 2008, Stan Williams found the first prototype memristor used nanoscale coupling ions and electrons [1]. In addition, memristor has many potentially unique applications, such as spintronic devices, ultra-dense information storage, neural circuits, and programming electronic devices [2][3][4]. Memristor is a nonlinear element, and it can produce complex nonlinear phenomena. Therefore, there is more and more interest in studying the nonlinear system of memristor.
Memristor has typical nonlinear behaviors, chaotics phenomena haves been found in many memristor circuits. For example, Muthuswamy and Chua proposed a three-dimensional simplest chaotic circuit [5]. Based on Wien-bridge, Ye et al. designed a new hyperchatoic memristor circuit and the circuit was implemented by the actual circuit element hardware [6]. On the base of Chua's circuit, a four-dimensional hyperchatoic circuit was proposed by Yang et al. [7]. Leng et al. designed a simplest four-dimensional hyperchatoic circuit and analyzed its dynamic characteristics [8]. A simple third-order memristive was obtained by band pass filter circuit in Ref [9]. Dynamic performance of a mixed memristor chaotic circuit was analyzed by Ye et al. [10]. Mou et al. [11] analyzed dynamic characteristic of four-dimensional fractional-order hyperchatoic memristor circuit. And a series of memristor chaotic circuit systems are researched in Ref [12][13][14][15][16][17][18][19][20]. In the background of the memristor above, in this paper, we designed a new memristor chaotic system based on Chua's circuit, and used red and blue 3D glasses method to observed chaotic trajectory of the new memristor chaotic system. Image encryption is an important research direction in chaotic secure communication. At present, there are some image encryption algorithms based on chaotic system [21][22][23][24][25][26][27][28][29][30][31][32][33][34]. Such as Yang et al. [35,36] designed image encryption algorithm by using fractional-order chaotic system. Chai et al. [37] proposed an image compression and encryption algorithm based on chaotic system and compression sensing. An image encryption scheme by high dimensional chaotic system is introduced by Tong et al. [38]. Yang et al. [39] designed an image encryption algorithm through complex chaotic system. On the base of hyperchatoic map and compression sensing, Xu et al. [40] proposed an fast image compression and encryption scheme. Chai et al. [41] designed a visually secure image encryption algorithm through skew tent map and compression sensing.
To improve security performance of image encryption algorithm, DNA operation is used to image encryption scheme. There are many image encryption algorithms through DNA operation and chaotic system [42][43][44][45][46][47][48]. For instance, Liu et al. [48] using DNA complementary rules and chaotic system proposed an image encryption algorithm. An image encryption scheme through DNA computing and chaotic system is designed in Ref [49]. Based on chaotic map and DNA addition rules, an color image encryption scheme is designed by Yang et al. [50]. Liu et al. [51] proposed an image encryption algorithm by chaotic system and DNA operation. Based on DNA deletion and DNA insertion, an image encryption scheme is designed in [52]. So far, image encryption algorithm not using DNA variation. Therefore, we designed an image encryption algorithm based on DNA variation in this paper.
The rest of the paper is organized in the following. In section 2, a new memristor system is obtained and analyzed its dynamic characteristics. The principle of DNA is introduced in section 3. In section 4, we designed an image encryption algorithm based on memristor system and DNA variation. Performance of the designed algorithm is explored in section 5. In section 6, we have given some conclusions.

Mathematical model of the system
As a comparison, the expression of the classical Chua's circuit is given. In order to show their correspondence more clearly, the shape of the classical Chua's circuit is written as follows 1 2 where -γz represents the additional resistance of the inductor, the nonlinear term f(x) is The mathematical model of Chua's circuit composed of memristor elements as 1 2 where w(x) is memristor, the volt-ampere characteristics as follows On the base of Eq.(3)-Eq.(6), the mathematic model of the new memristor chaotic system is obtained as For the mathematic model of the new memristor chaotic system, when parameters α 1 =16.4, α 2 =6.56, α 3 =16.4, β=15, γ=0.5, a=0.2, b=0.4, initial value (x, y, z, u)=(0.2, 0.1, 0.1, 0.1), the Lyapunov exponents are 0.3329, 0, -0.0066 and -7.8613, so the new memristor system is chaotic system.

Red and blue 3D attractor phase diagram of the system
For the traditional method of observe three-dimensional chaotic attractor, although it works, but it is a 2D plane method, it is not able to give full play to the nature of information processing between human eyes and brain information. To get a complete picture of the brain of a three-dimensional chaotic attractor, the effect can be achieved using red and blue 3D glasses. The method of red and blue 3D glasses is described as follows.  A conical projection method is shown in Fig.1. Fig. 1(a) is a description of the chaotic attractor.
Assumption three-dimensional origin of chaotic system is O 1 , the equation variables of the phase trajectory are x, y and z，the coordinates of the moving point P is (x, y, z). Let x run from left to right, y run from bottom to top, and z run from O 1 run from eye to eye. In Fig. 1(b), Display midpoint position is O 2 , and there are two display images, a red image for the left eye and a blue image for the right eye.
The two points of P point in chaotic phase diagram are Q L (x L , y L ) and Q R (x R , y R ) respectively. L is the position of the left eye, R is the position of the right eye, the midpoint between L and R is O 3 . Setting the distance between O 1 and O 2 is m, the distance between O 2 and O 3 is m, the distance between L and R is 2d. The graphs of Q L (x L , y L ) and Q R (x R , y R ) can be obtained from the above relation, and the correlation function can be determined.
The projection point QL and QR ordinate principle of point P on the display is shown in Fig.2.
The principle of the two abscissa coordinates of point P on the display is Fig.3.

Fig.3
The two horizontal coordinates of point P on the display.
According to Fig. 3, their relationship is described as follows.

Fig.4
Attractor phase trajectories of the red and blue 3D glasses.
Based on above to observe the principle, by using write a program, we get the chaotic phase diagram of system (7) as Fig.4. The Fig.4 illustrate that using red and blue 3D glasses not only sees immersive 3D chaotic attractors, but also has significant effects.

Dynamic performances of the system
In this section, to investigate the dynamical performances of the new memristor chaotic system, In order test random of chaotic sequence, the SE complexity and C0 complexity tested structural complexity and sequence complexity of chaotic sequence. Based on SE complexity and C0 complexity algorithm, fixing other parameter values and initial values, the parameterα 1 ∈[15.2, 16.6] and α 2 ∈[6.3, 7.3], then the corresponding complexity results are shown in Fig.6. The Fig.6 shows that chaotic sequence produced by the new memristor chaotic system has good randomness in structure and sequence. Therefore, the chaotic sequences which are produced by the new memristor chaotic system are suitable in secure communication.

DNA coding rule
For a DNA sequence, it is constituted by nucleic acid bases A, T, C and G, where A and T are complementary, C and G are complementary. In the modern theory of electronic computers, all information is represented in binary, but in DNA coding theory, all information is represented by DNA sequences with four nucleic acid bases A, T, C and G. In binary sequence, 0 and 1 are complementary, it can be deduced that sequence 00 and 11 are complementary, and sequence 01 and 10 are complementary. Therefore, 00, 01, 10 and 11are used to code DNA sequence. All coding schemes are 4!=24, but only 8 coding schemes conform to the Watson Crick complementary rule, the corresponding result is shown in Table.1. In the process of image encryption, the gray value of each 8bit pixel can be represented by 4 coded DNA sequences. For example, A, T, C and G are used to represent 00, 11, 10 and 01 respectively.
Then, the point with a pixel gray value of 121 and the binary sequence are represented as [01111001], the DNA sequence encoded according to code rule 0 in Table 1 is represented as [CTGC].

Addition and subtraction rule of DNA
With the rapid development of DNA computing, biological and algebraic operations based on DNA sequences have emerged. The addition and subtraction of DNA sequences is similar to that of traditional algebra, such as 01+11 = 00, 01-10 = 11.When using the encoding scheme 0 in Table.1, 00, 11, 01 and 10 respectively represent A, T, C and G, and the detailed corresponding addition and subtraction operations are shown in Table.2.

Table.2 Addition and subtraction of DNA
It can be seen from Table 2 that DNA plus operation shows double helix structure, which conforms to Watson Crick complementary rule. DNA subtraction is the opposite of addition, but does not conform to the double helix structure.

DNA variation rule
DNA mutation refers to the abnormal changes in the structure, replication or phenotypic functions of individual dNMP (deoxymonophosphate) residues or even fragments of DNA, also known as DNA damage. According to the type of gene structure change, mutations can be divided into four types: base replacement, transcoding, deletion and insertion. In this paper, we selected base replacement mutations for application in image encryption algorithms. To get a better idea of how base replacement works, a diagram of base replacement mutations is shown in Fig.7.

DNA complementary rule
For the DNA complementary rule, it meets the following principles: where F(x) represents the base pair of x, it is a injective mapping to guarantee the DNA complementary rules. There are six groups of DNA complementary rules as follows.
4 Image encryption and decryption algorithm based on chaotic system and DNA Table.3 The secret key structure

The secret key structure
For the designed image encryption algorithm, it's the secret key structure is shown in Table.3. In the Table.3, α 1 , α 2 , α 3 , β, γ, a and b are parameters of the new memristor chaotic system, x 0 , y 0 , z 0 and u 0 represent initial values of the new memristor chaotic system, r is DNA coding rule in Table.1, c 0 means the initial nucleic acid bases.

Image encryption algorithm
In this section, an image encryption algorithm is designed based on the new memristor chaotic system and DNA operations. The algorithm mainly includes the row and column scrambling, DNA transition, DNA complementary and DNA addition operation. The flowchart of encryption algorithm is shown in Fig.8. The corresponding of specific step is described as follows.  Fig. 8 Design of encryption algorithm flowchart.
Step 1 Inputting a plain image I, its size is H×W. Step where br, bc, x 1 and y 1 are used to image scrambling algorithm.
Step 3 According to br and x 1 , the plain image I is scrambled by where T 1 is the row scrambling result, i=1, 2, …..H.
Step 4 According to bc and y 1 , the row scrambled result T 1 is scrambled as where T is the final scrambling result, j=1, 2, …..W.
Step 5 Setting the parameters and initial values as Step 2, on the base of four order Runge-Kutta algorithm, the new system memristor system (7) where K is the new sequence.
Step 6 Selected DNA coding rule 1 in Table.1, then the new sequence K is coded, a (H, 4×W) DNA matrix K 1 is obtained.
Step 7 Based on DNA coding rule 1 in Table.1, the scrambled result T is coded, then a (H, 4×W) DNA matrix T 2 is generated.
Step 8 According to DNA base replacement mutations in section 2.3, the DNA matrix T 2 is transited by Step 9 For the DNA base replacement mutations result of DNA matrix T 2 , selected initial nucleic acid bases is G, then based on DNA complementary rule in section 2.4, a DNA complementary result T 3 is obtained.
Step 10 For the DNA complementary result T 3 and DNA matrix K 1 , according to DNA addition rule in section 2.2, then a new DNA matrix C 1 .
Step 11 The DNA addition result C 1 is decoded as decimalism (H×W) matrix, then the cipher image C is generated.

Image decryption algorithm
The decryption algorithm is similar to encryption algorithm, which the inverse of encryption algorithm. In this paper, decryption algorithm mainly includes DNA subtraction, DNA inverse of complementary, DNA inverse of base replacement and row and column inverse scrambling. The design of decryption algorithm flowchart is shown in Fig.9. The corresponding of steps described as follows.  Fig. 9 Design of decryption algorithm flowchart.
Step 1 Inputting the cipher image C, its size is H×W.
Step 2 Selecting the DNA coding rule 1 in section 2.1, then cipher image C is coded (H, 4×W) DNA matrix C 1 .
Step 3 Setting the parameters and initial values as Step 2, on the base of four order Runge-Kutta algorithm, the new memristor system (7) is iterated (n+H×W) times. The chaotic sequences x, y, z and u are disposed by Eq. (19). The new sequence F is obtained.
Step 4 Selecting the DNA coding rule 1 in section 2.1, then the new sequence F is coded (H, 4×W) DNA matrix F 1 .
Step 4 Based on DNA subtraction in section2.2, DNA matrix F 1 and DNA matrix C 1 are operated, and then DNA subtraction result C 2 is generated.
Step 5 DNA inverse complementary result C 3 is obtained by the DNA complementary rules in section 2.4.
Step 6 DNA inverse transition result C 4 is obtained based on Eq. (20).
Step 7 DNA inverse transition result C 4 is decoded, then obtained decimalism (H×W) matrix C 5 .
Step 8 The same as Step 2 in encryption algorithm, getting the inverse scrambling algorithm br 1 , bc 1 , x 2 and y 2 .
Step 9 The inverse scrambling result T 1 is obtained by Step 10 The inverse scrambling result T 1 is restored to plain image I.

Simulation test results
In this paper, to verity the designed image encryption algorithm, gray scale images Lena, Camera,

Security performances analysis
To verity algorithm performances, in this section, the following experiment is performed, such as the secret key space analysis, histogram distribution analysis, information entropy analysis, correlation analysis, key sensitivity analysis. In addition, for each analysis method is introduced in detail.

The secret key space analysis
For an encryption algorithm, if its secret key space is large enough, it can resist brute-force attacks. For our algorithm, according to the secret key structure in section 4.1, we have done many experiments, when α 1 , α 2 , α 3 , β, γ, a, b x 0 , y 0 , z 0 and u 0 within error 10 -15 , the cipher image is decrypted.
So secret key space is 10 165 =2 548 , it is much bigger than 2 100 . Therefore our designed algorithm has lager enough secret key space to resist brute-force attacks.

Histogram distribution analysis
Histogram reflects the distribution of each pixel value in the image. If histogram distribution of the encrypted by ideal encryption algorithm more smooth, which indicates that the proposed encryption algorithm is better.

Correlation analysis
The adjacent pixels of the original image have a high degree of correlation. Reducing the correlation of adjacent pixels is one of the methods to measure the effectiveness of the encryption algorithm. In this experiment, 2000 pairs of adjacent pixels before and after encryption are randomly selected from horizontal, vertical and diagonal directions respectively, and then the correlation where u and v are adjacent pixels value, r uv is correlation coefficient of the adjacent pixels. Fig.12 shows the correlation of adjacent pixels between plaintext and cipher images in horizontal, vertical and diagonal directions. Fig.12 illustrates that the adjacent pixels of the original image are linearly distributed, and the correlation between adjacent pixels of the encrypted image is greatly reduced.  Table. 4. The results illustrate that correlation coefficient values of the original images are close to 1, the correlation coefficient values of the cipher images are close to 0. Therefore, correlation of adjacent pixels is reduced by encryption algorithm, which indicates that the designed algorithm can prevent some level of statistical attack. In addition,

Information entropy analysis
Information entropy is used to measure system complexity, and also used to evaluate performance of encryption algorithm. According to information entropy definition, the information entropy of image where m i is pixel value, p(m i ) represent the probability of each pixel value appearing. Information entropy of image reflects pixel distribution. The information entropy value is closer to ideal value of 8, which show that the more consistent the distribution of pixel values in the cipher image.   Table. 7, the results illustrate that the proposed algorithm has a better advantage in information entropy.

Fig. 13 The secret key sensitivity analysis
For the secret key structure in section 4.1, the α 1 , β, γ, x 0 , y 0 and u 0 are respectively changed 10 -15 , then changed secret key to decrypt Lena cipher image, which test the secret key sensitivity. The corresponding results are shown in Fig.13. The results demonstrate that the algorithm is very sensitive to the secret key, it protects against malicious attacks on the secret key. To verify the encryption algorithm's ability to resist data loss, in this test, the Lena cipher image are lost data of different degrees, then by using decryption algorithm to decrypt the corresponding cipher images. Test results are shown in Fig. 14. The analysis results indicate that the designed encryption algorithm can prevent some degrees data loss attacks.  Fig. 15. The results illustrate that the proposed algorithm has ability to prevent some degrees noise attacks.

Conclusions
In this paper, a new memristor chaotic system is obtained, red and blue 3D glasses is used to obverse chaotic trajectory. The dynamic performance of the new memristor chaotic system is analyzed by Lyapunov exponent spectrum, SE complexity and C0 complexity. The results show that using red and blue 3D glasses not only sees immersive 3D chaotic attractors, but also has significant effects.
Dynamic analysis illustrates that the new memristor chaotic system has rich dynamic characteristic, and chaos state is distributed over a large parameter range, which indicates that it is more suitable for image encryption application. More significantly, the designed encryption algorithm based on new