Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Hyperchaotic color image encryption using eight-base DNA complementary rules and extended Zigzag transform

Abstract

As an efficient technique to protect image content from unauthorized access, image encryption has been a hot spot in recent studies. Among various schemes of image encryption, those that utilize hyperchaotic systems and deoxyribonucleicacid (DNA) computing are promising. In this paper, complementary rules of eight-base DNA computing are proposed, whose number is 5040, whereas the number of complementary rules of traditional four-base DNA is only 6. Hence, complementary rules of eight-base DNA can introduce larger flexibility and complexity into image encryption. In addition, a new extended Zigzag transform is proposed, which can generate a large number of Zigzag-like paths. By combining a four-dimensional (4D) hyperchaotic system, complementary rules of eight-base DNA and the new extended Zigzag transform, a new hyperchaotic encryption scheme for color images called EDCREZT is proposed. During the encryption procedure of EDCREZT, a plaintext color image will pass through five steps: pixel-level permutation, dynamic DNA encoding, DNA-level permutation by the new extended Zigzag transform, two-round DNA-level diffusion by the proposed complementary rules, and dynamic DNA decoding, then the cipher image is obtained. Extensive experiments have been conducted, and the results show EDCREZT possesses satisfying capability against typical attacks.

1 Introduction

At the present time, a massive amount of data are being produced, transmitted, and stored everyday. Especially, with the widespread use of smart phones and social networks, an enormous number of personal images are sent and received through internet at all times. In other fields such as healthcare and military, there is also a need to protect a large number of images from unauthorized access. In recent years, motivated by the demand of content protection of images, image encryption has been a research hot spot. Due to the intrinsic characteristics of images including high redundancy, bulky data, and strong correlation between adjacent pixels, classic encryption methods such as Data Encryption Standard(DES) and Advanced Encryption Standard(AES) are not so suitable for images. In [1], Fridrich proposed a framework of chaotic image encryption, in which the chaotic system, permutation and diffusion are responsible for generating pseudorandom sequences, scrambling the content of images, ensuring that tiny changes in the plaintext image could spread throughout the cipher image, respectively.

Due to the features such as high sensitivity to initial values, pseudorandomness and ergodicity, chaotic systems are suitable for generating pseudorandom numbers in image encryption. Following the pathbreaking work by Fridrich, researchers have proposed many chaos-based image encryption algorithms, in which various techniques are employed, such as S-box [26], Latin square [79], quantum computing [1012], deoxyribonucleic acid(DNA) computing [1315], neural networks [1620], and different chaotic systems [2125], etc. As for chaotic systems, there are various types of chaotic systems, such as continuous systems and discrete systems, with different features and performance. In general, image encryption methods employing hyperchaotic systems could achieve higher security than those employing other chaotic systems. However, though high-dimensional chaotic systems have more complexity, they have higher time cost too, so there must be a trade-off when selecting chaotic systems for image encryption. In this paper, a four-dimensional(4D) hyperchaotic system is adopted to generate pseudorandom sequences.

As a traditional method to scan all pixels of an image in a zigzag pattern, Zigzag transform can be applied in permutation and diffusion phases of image encryption. Due to its simplicity and effectivity, Zigzag transform has been used in image encryption by many researchers, resulting in a lot of improvements of Zigzag transform. In [26], an improved Zigzag transform is proposed by Wang et al., which is characterized by block partitioning and zigzag scanning from any corner in a block. By combining two chaotic systems, ribonucleic acid(RNA) operations and an extended zigzag transform, another image encryption method is proposed by Wang et al. [27], in which the extended zigzag transform could apply to images with unequal height and width. In [28], a new bidirectional Zigzag transform is presented by Gao et al., which starts from a randomly selected pixel. In [29], a 6D hyperchaotic image encryption scheme, which utilizes a 3D transformed Zigzag diffusion and a substitution strategy based on RNA condons, is proposed by Zhang et al. However, the zigzag paths that many of above zigzag transforms can generate are relatively not abundant.

In recent years, due to the advantages including high parallelism, large storage capacity and ultra-low power consumption, the technique of DNA computing has drawn more and more attention of scholars. Since DNA-level is lower than pixel-level, operations performed at DNA-level could introduce more flexibility and complexity than those performed at pixel-level. Therefore, it is likely for image encryption with DNA computing to achieve higher security. In an image encryption algorithm presented by Wu et al. [30], three kinds of latin square primitives, including whiting, S-box and P-box, are utilized to accomplish 2D substitution and permutation. Based on Sine map and iterative chaotic map with infinite collapse, a color image encryption is proposed by Liu et al. [31], which utilizes horizontal and vertical circular shifts for permutation as well as DNA operations for diffusion. In [32], Fan et al. introduced the biological eight-base DNA concept into image encryption, and proposed an encryption strategy characterized by permutation and diffusion performed on both a one-dimentional DNA sequence and three-dimensional DNA cubes. In [33], Liu et al. presented an image encryption method, in which piecewise linear chaotic map and DNA complementary rules are used to conduct permutation and diffusion. Complementary rules of DNA coding can be used to transform any DNA base to its base pair, which have been employed by several researchers in image encryption [3336]. However, for traditional four-base DNA, the number of complementary rules is only 6.

Inspired by above studies, complementary rules of eight-base DNA, a new extended Zigzag transform and a novel hyperchaotic color image encryption scheme called EDCREZT are presented in this paper. The encryption procedure of EDCREZT is composed by several steps. Firstly, a 4D hyperchaotic system is responsible for generating chaotic sequences, which will be transformed into several random vectors. Secondly, pixel-level permutation of the plaintext image is carried out in the way of circular shift horizontally and vertically. Thirdly, according to dynamic encoding rules, eight-base DNA encoding is performed on the scrambled image, leading to an eight-base DNA sequence. Fourthly, DNA-level permuation with the new extended Zigzag transform is conducted, followed by diffusion based on the proposed complementary rules of eight-base DNA. Finally, by decoding the resulting eight-base DNA sequenece according to dynamic decoding rules, the final cipher image is obtained.

The main contributions of this paper are as follows:

  • A 4D hyperchaotic system is employed to generate chaotic sequences.
  • A new extended Zigzag transform is presented, which is capable of generating a large number of zigzag-like paths. It will be used in image permutation.
  • Complementary rules of eight-base DNA computing are proposed, which will be used in DNA-level diffusion. Notably, the number of complementary rules of eight-base DNA is 5040, which is 840 times of the number of complementary rules of traditional four-base DNA. With no doubt, the proposed complementary rules of eight-base DNA can introduce far larger flexibility and complexity into image encryption.
  • A new image encryption scheme is presented, which utilizes the new extended Zigzag transform, the proposed complementary rules of eight-base DNA, and a 4D hyperchaotic system.
  • Extensive experiments are conducted, including test of sensitivity of keys, histogram tests, global and local Shannon entropy tests, encryption quality test, correlation test, differential attack test, and robustness test. The results demonstrate EDCREZT scheme possesses satisfactory capability to resist multiple attacks.

The rest of this paper is organized as follows. In Section 2, a four-dimensional hyperchaotic system, a new extended Zigzag transform, the four-base DNA computing, and the eight-base DNA computing including the proposed complementary rules, are introduced. In Section 3, details of the new image encryption method are elaborated. In Sect 4, experiments and their results are reported and analyzed. Finally, Section 5 concludes this paper.

2 Preliminaries

2.1 The 4D hyperchaotic system

Various kinds of chaotic systems can be employed in image encryption, such as continuous systems, discrete systems, fractional-order systems, and complex systems. In recent studies, high-dimensional hyperchaotic systems characterized by no less than two positive Lyapunov exponents, are shown to be advantageous. Compared with other chaotic systems, parameters of hyperchaotic systems are more flexible, and the dynamic behavior is more complex. Due to these advantages, in this paper a 4D hyperchaotic system [37] is utilized to generate chaotic sequences for image encryption, which is described as:

(1)

where x,y,z,w and a,b,c,d are state variables and parameters respectively. When parameters are set as , this system has two positive Lyapunov exponents, which ensures that the system is hyperchaotic. For example, when d = 10, the Lyapunov exponents are (0.2027,0.1091,0,–26.2692). More details of this hyperchaotic system can be found in [37]. With the step size of h = 0.001, this hyperchaotic system can be solved with fourth-order Runge–Kutta method, and the attractors are shown in Fig 1, where parameters (a,b,c,d) and initial values are (35,3,12,10) and (0.5,0.6,0.7,0.8) respectively.

thumbnail
Fig 1. Attractors of the four-dimensional(4D) hyperchaotic system.

https://doi.org/10.1371/journal.pone.0325197.g001

2.2 A new extended Zigzag transform

Zigzag is a classic method to scan all pixels of an image along a zigzag path. In other words, the Zigzag transform can generate a new order for all pixels in an image, so it is widely used in image scrambling. Taking an example with a image, the standard Zigzag transform and an improved Zigzag transform consisting of three paths are given in Fig 2. In each subfigure of Fig 2, the numbers indicate the original order of pixels, and the path begins from the pixel marked with a circle. It can be seen that in each subfigure of Fig 2 there is a path which begins from one corner pixel and traverse all pixels. Besides the standard Zigzag transform, there have been many Zigzag-like transform methods [2628, 3843].

thumbnail
Fig 2. Standard Zigzag transform and an improved Zigzag transform with 3 modes.

https://doi.org/10.1371/journal.pone.0325197.g002

In this paper, an extended Zigzag transform with parameters is presented. By choosing different parameters, this new extended Zigzag transform can generate a large number of Zigzag-like paths to traverse all image pixels. Simply speaking, for an image, a path generated by this method contains two levels of orders, the first is the order of diagonals, and others are the orders of pixels inside each diagonal. To facilitate the elaboration of the new extended Zigzag transform, main diagonals and anti-diagonals of an image will be defined as follows, where ai,j denotes the pixel which is located at ith row and jth column. As an example, eight main diagonals and eight anti-diagonals of a image are marked in Fig 3.

  1. The kth main diagonal is composed by all pixels in MDk where
  2. The kth anti-diagonal is composed by all pixels in ADk where

Firstly, the order of diagonals determined by parameter ‘zigzag mode’ is given in Table 1, and an example of image is given in Fig 4.

Secondly, with the order of diagonals already determined by ‘zigzag mode’, the order of pixels inside kth diagonal should be determined by kth ‘diagonal mode’ parameter, where . Whichever zigzag mode is selected, there is only one pixel in either the first or the last diagonal, so both the first and the last diagonal need no parameter. Considering the kth diagonal consisting of n pixels, whether it is a main diagonal or an anti-diagonal, the column indices of these pixels must be n consecutive numbers. With column indices being in an ascending order, these n pixels of kth diagonal can be arranged as , where are the n consecutive column indices, and are corresponding row indices. Taking this sequence of pixels as the inital one, the sequence of pixels inside kth diagonal will be rearranged by a parameter of 3 binary bits as follows:

  1. Step 1: Denote by m, and then split the initial sequence of pixels into P1 and P2 where
    It can be seen that P1 represents the first half pixels of the diagonal, and P2 represents the second half pixels, both in an ascending order of column indices.
  2. Step 2: If yk is 0, go to next step directly. If yk is 1, reverse the pixels of P1, then it turns to be:
  3. Step 3: If zk is 0, go to next step directly. If zk is 1, reverse the pixels of P2, then it turns to be:
  4. Step 4: If xk is 0, the result is the concatenation of P1 and P2. If xk is 1, concatenating P2 and P1 gives the result instead.

For an image consisting of n = M + N−1 diagonals, the amount of parameters in bits required by the extended Zigzag transform is listed in Table 2, and the total amount of parameters in bits is .

thumbnail
Table 2. Amount of parameters in bits required by the extended Zigzag transform.

https://doi.org/10.1371/journal.pone.0325197.t002

Consequently, the two levels of orders lead to an order of all pixels of an image. In Fig 5, four examples of the final order of pixels for a image is given, where the numbers indicate the new order of pixels, and corresponding parameters are in Table 3.

Obviously, by employing different parameters, the extended Zigzag transform method can generate a large number of Zigzag-like paths to scan pixels. In this paper, this extended Zigzag transform will be used in DNA-level permutation.

2.3 Traditional four-base DNA computing

DNA encoding.

In traditional DNA molecules, there are four nucleic acid bases including adenine, thymine, cytosine and guanine, which are usually abbreviated as A, T, C and G respectively. Among these four bases, A and T compose a complementary pair, so do C and G. This concept can be introduced into image encryption. It is well known that byte is the basic unit in an image, which corresponds to a pixel for gray scale images, or a color component of a pixel for color images. If each byte is encoded into DNA bases, then image encryption can be done at DNA-level. Because there are four distinct DNA bases, exactly two binary bits are sufficient to represent any one base, and one byte can be encoded into four DNA bases. Due to the fact that A and T, C and G are two complementary pairs, an DNA encoding rule should ensure the binary forms of the two pairs of bases are still complementary. For example, with A, T, C, G representing 01, 10, 11, 00 respectively, the complementary principle is fulfilled. It is easily known that the number of all encoding rules is , and these encoding rules are listed in Table 4. For example, if decimal value 39 of one byte size needs to be encoded according to rule 1, the value 39 should be transformed into its binary form 00100111 first, then 00, 10, 01, 11 are converted to A, G, C, T respectively, and the DNA sequence AGCT is obtained. In this way, images can be easily converted from pixel sequences into DNA sequences. Similarly, given a DNA sequence encoded from an image, it can also be decoded into an image inversely.

DNA algebraic operations.

With each DNA base being 2 binary bits essentially, DNA-level algebraic operations can be similarly defined. Typical DNA algebraic operations include addition, subtraction, etc. In Table 5, the DNA-level addition for encoding rule 4 is given as an example.

Since these algebraic operations of DNA are similar to those of normal binary numbers, they are useful in image encryption, especially in the phase of diffusion. Due to the variety of encoding rules, the algebraic operations of DNA are more flexible than those of normal binary numbers, which benefits the security of image encryption.

DNA complementary rules.

In a DNA sequence, for each base , the complementary rule is given in (2)

(2)

where L(xi) is the base pair of xi. All six complementary rules are given as follows:

For example, in the complementary rule (AG)(GT)(TC)(CA), the base pairs of A, G, T, C are G, T, C, A respectively. The complementary rules can also be employed in diffusion.

2.4 New Eight-base DNA computing

Eight-base DNA encoding.

In 2019, Hoshika et al. expanded the DNA alphabet with four additional new bases in the field of synthetic biology. Inspired by this new study, the eight-base DNA computing has been introduced in image encryption [32]. In addition to A, T, C and G, four new bases S, B, P and Z are added, then there are totally four complementary base pairs: A and T, C and G, S and B, P and Z. Similarly, each one of the eight bases corresponds to three binary bits, and the number of encoding rules is , which is much larger than that of the traditional four-base DNA. As an illustration, ten encoding rules arbitrarily selected from all 384 encoding rules are listed in Table 6.

Eight-base DNA algebraic operations.

Similarly to traditional four-base DNA, algebraic operations for eight-base DNA can be defined. For example, addition for encoding rule 3 in Table 6 is given in Table 7.

Eight-base DNA complementary rules.

Inspired by the complementary rules of traditional four-base DNA, the complementary rules of eight-base DNA are proposed in this paper. Similarly, for any , L(xi) is the base pair of xi for a given complementary rule. Moreover, with the following denotations

(3)

where , an eight-base DNA complementary rule requires that

(4)

It can be figured out that the number of eight-base DNA complementary rules is . As as example, 12 out of 5040 complementary rules are given as follows:

It can be seen the number of eight-base DNA complementary rules is far larger than that of traditional four-base DNA complementary rules, so the eight-base DNA complementary rules are capable of providing more flexibility and complexity in image encryption, and enhance the security ultimately.

3 The new color image encryption

There are several steps in the new color image encryption method. Firstly, chaotic sequences are generated with the 4D hyperchaotic system, then they are transformed into several random vectors for following encryption phases. Secondly, the original image is scrambled at pixel-level according to one random vector. Thirdly, the scrambled image is converted to an eight-base DNA sequence according to dynamic encoding rules. Fourthly, DNA-level permutation is performed with the new extended Zigzag transform. Fifthly, diffusion is carried out at DNA-level with the proposed eight-base complementary rules. Finally, by decoding the diffused DNA sequence according to dynamic decoding rules, the final cipher image is obtained. Framework of this new algorithm is given in Fig 6.

3.1 Generation of initial values for hyperchaotic system

Cryptanalysis research could provide useful guidance for the design of image encryption. For a chaotic image encryption scheme, if the chaotic sequences are independent of the plaintext image, then the encryption is vulnerable to attacks due to the existence of an equivalent key [4447]. Thus, a solution to generate initial values for the hyperchaotic system is designed in this section, which ensures that the chaotic sequences are dependent of the plaintext image.

With the plaintext image and several user-defined values, the initial values of the 4D hyperchaotic system, , are generated as follows:

  1. Step 1: SHA-256 hash value is calculated with the plaintext image, then that hash value is split sequentially into 32 parts of the same length, resulting in a byte sequence .
  2. Step 2: Four temporary values are calculated as follows:(5)where are user-defined real numbers, and represents bitwise XOR operation.
  3. Step 3: With , the expected initial values are calculated as follows:(6)where mod represents modulo operation. It could be noted that all of the initial values are between 0 and 1, i.e., .

3.2 Vectors generated by hyperchaotic system

With the initial values calculated above, chaotic sequences can be generated by the hyperchaotic system, which will serve as random data in image encryption as well as decryption. There are five parts of random data in need in the encryption phase, which are depicted as follows:

  1. M + N real numbers for pixel-level permutation.
  2. real numbers for dynamic DNA encoding.
  3. real numbers for the extended Zigzag transform in DNA-level permutation.
  4. real numbers for dynamic complementary rules in diffusion.
  5. real numbers for dynamic DNA decoding.

To meet above needs, the hyperchaotic system should iterate times, resulting in a matrix S of double-precision real numbers, with state values of the ith iteration being the ith column. Denoting the state values of the ith iteration by , matrix S can be described as follows:

(7)

For further use in the process of image encryption, matrix S can be simply transformed into following vectors:

  1. Vector S1 for pixel-level permutation is generated with the submatrix composed by columns 1 to of S as follows:(8)
  2. Vector S2 for dynamic DNA encoding is generated with the submatrix composed by columns n1 + 1 to of S according to (9), where .(9)
  3. Vector S3 for dynamic DNA decoding is generated with the submatrix composed by columns to of S according to (10), where .(10)
  4. Vector S4 for dynamic complementary rules is generated with the submatrix composed by columns to of S according to (11), where .(11)
  5. Vectors for the extended Zigzag transform are similarly generated with several columns of S according to (12), where and .(12)

3.3 Permutation at pixel-level

In the phase of pixel-level permutation, the plaintext image will be scrambled with the bidirectional circular shift method in [48]. Prior to permutation, and should be obtained by and respectively, where vector S1 of length is defined in (8). Then the pixel-level permutation is implemented in the following steps:

  1. Get vector Sh for horizontal shift and vector for vertical shift by (13).(13)
  2. Apply circular shift operation to each row of the plaintext, where Sh(i) is the number of circular shift steps to the left for ith row, an integer in [0,N–1].
  3. Apply circular shift operation to each column next, where is the number of circular shift steps to the top for ith column, an integer in [0,M–1].

Thus, the plaintext image has been scrambled with the horizontal and vertical circular shift operations, and the resulting initial cipher image C1 will be further processed.

3.4 Encoding inital cipher image into DNA sequence

By converting each entry of S2 in (9) to an integer in [1,384] according to (14), vector is obtained. The entries of will serve as dynamic encoding rules.

(14)

With operation applied to the initial cipher image C1, a byte sequence of length is obtained, which is also a bit sequence of length . By converting every three bits into a DNA base according to dynamic encoding rule sequcence , the DNA sequence D1 of length is obtained from this bit sequence.

3.5 Permutation at DNA-level

Permutation at DNA-level is implemented based on the extended Zigzag transform, as described below.

  1. Step 1: By applying an operation reshape(D1,8,M,N) to DNA sequence D1, eight matrices could be obtained sequentially.
  2. Step 2: Convert each entry of S6 in (12) to an integer in [0,3] according to (15), then vector is obtained, whose ith entry will be used as zigzag mode ZMi in the extended Zigzag transform for .(15)
  3. Step 3: Convert each entry of S7 in (12) to an integer in [0,7] according to (16), where , then vector is obtained. can be further split into eight sequences sequentially, where DMj is composed by entries with indices to of , .(16)
  4. Step 4: Sort the numbers of vector S5 in (12) in ascending order, and denote the obtained vector by . Subsequently, convert each entry in to its index in S5, and the result is obviously a permutation of .
  5. Step 5: According to the proposed extended Zigzag transform, generate an order of all DNA bases in D1,i with zigzag mode ZMi and diagonal modes DMi, where . Denote the DNA bases of D1,i in the extended zigzag order by , then all DNA bases in in respective extended zigzag orders can be described in (17)(17)where ith row are DNA bases of D1,i in its extended zigzag order. Furthermore, by using BlockIndices obtained in Step 4 to rearrange the rows of D2, a new DNA matrix D3 in (18) is obtained.(18)D3 can be transformed into a one-dimensional base sequence D4 in (19)(19)where is the index of kth DNA base of D4 in DNA sequence D1. It can be easily seen that is a permutation of , and D4 is the final result of DNA-level permutation.

3.6 Diffusion at DNA-level

With the eight-base complementary rules defined in (3) and (4), DNA-level diffusion will be performed on the permutated DNA sequence D4. Prior to the diffusion process, the indices of complementary rules applied to DNA sequence D4 should be generated according to (20). By converting each entry of S4 to an integer in [1,5040], vector is obtained, whose entries serve as indices of complementary rules. For convenience, indices of complementary rules are called dynamic complementary rules.

(20)

The diffusion involves two rounds, which can be depicted in (21)

(21)

where bi is the ith DNA base of D4, is the binary value of DNA base x according to encoding rule , , is the operation performed on DNA base x defined in (3) and (4) according to complementary rule , . Obviously, D5 is the result of the first round, and the result of the second round is D6, which is also the final diffused DNA sequence. The DNA-level diffusion is depicted in Algorithm 1.

Algorithm 1. The algorithm of diffusion at DNA-level.

3.7 Decoding diffused DNA sequence into final cipher image

Similarly to DNA encoding, vector S3 should be transformed to with each entry converted to an integer in [1,384] according to (22). The entries of will serve as dynamic decoding rules.

(22)

Then, by converting each DNA base to three bits according to the dynamic decoding rule sequence , the diffused DNA sequence D6 is converted to a bit sequence of length . Since this bit sequence actually corresponds to a byte sequence of length , it can be easily transformed into an image C2 of size , which is the final cipher image.

3.8 Decryption

Since the process of decryption is almost the reverse of encryption, a brief description of decryption is given as follows:

  1. Step 1: Taking keys as initial values, matrices S in (7) are reconstructed by the hyperchaotic system, followed by random vectors .
  2. Step 2: The dynamic decoding rules can be calculated with S3, then the diffused DNA sequence D6 can be recovered from the final cipher image C2.
  3. Step 3: According to DNA complementary rules (3) and (4), operations in the two-round diffusion (21) are reversible, and the diffused DNA sequence D6 can be easily converted back to the DNA-level permutated sequence D4.
  4. Step 4: With the order based on the extended Zigzag transform in DNA-level permuation reconstructed with and S7, the orginal DNA sequence D1 can be obtained from the scrambled DNA sequence D4.
  5. Step 5: With dynamic encoding rules recovered from S2, the initial cipher image C1 can be reconstructed with DNA sequence D4.
  6. Step 6: The horizontal shift vector Sh and the vertical shift vector can be reconstructed with S1, then by applying shift operations inversely to the initial cipher image C1, the plaintext image can be recovered.

4 Experiments

To evaluate the security and performance of EDCREZT, a range of tests have been carried out, with several popular color images in the well-known standard test database USC-SIPI, as listed in Table 8. Experiments are conducted with Matlab R2023a on Windows 10 64-bit system. The hardware configuration includes Intel(R) Core(TM) i3-8100 CPU @ 3.60 GHz and 16 GB RAM.

Parameters of the 4D hyperchaotic system in (1) are , and the user-defined constant values in (5) are .

4.1 Key space

A key space large enough is crucial for an encryption system to resist brute-force attacks. Theoretically, in order to resist brute-force attacks, the key space should be no less than 2100 [49]. Since the 4D hyperchaotic system in (1) is hyperchaotic when parameters are , the initial values and the pending parameter d are deemed as the keys. Since and are double-precision floating number with the precision of 10−15, it can be obtained that the key space is no less than , which is far larger than 2100. For comparison, key spaces of several references employing DNA or RNA are given in Table 9. It can be seen EDCREZT has a competitive key space.

4.2 Sensitivity of keys

For a promising image encryption method and its decryption method, it is essential that they should be highly sensitive to keys. In detail, when a cipher image is decrypted with the original key g and another slightly changed key respectively, there should be significant difference between the two resulting images. During this test, each test image is encrypted first, then the the cipher image is decrypted with five slightly modified keys in (23) respectively, where is the orginal key. The results are in Fig 7, where the test image and resulting images decrypted with are listed in each row from left to right, and fives rows from top to bottom correspond to five test images 4.2.01, 4.2.03, 4.2.05, 4.2.06 and 4.2.07 respectively. Obviously, the EDCREZT scheme is highly sensitive to keys.

thumbnail
Fig 7. Results of test of sensitivity of keys.

In each row, the first image is the test image, and others from left to right are results of decrypting cipher images with slightly changed keys in (23) respectively.

https://doi.org/10.1371/journal.pone.0325197.g007

(23)

4.3 Histogram

As is well known, the information of number of pixels corresponding to each grayscale level is contained in histogram of an image. To put it in another way, frequency distribution of pixels of the whole gray scale, is indicated by the histogram. For a natural image, the histogram is usually undulant. However, for a cipher image, its histogram should be as flat as possible in order to resist histogram attacks. In each row of Fig 8, the test image and its histograms of three channels are on the left, followed by its cipher image and corresponding histograms of three channels.

thumbnail
Fig 8. Histograms of plaintext images and cipher images.

In each row, the first four images are the test image and its histograms of Red, Green, Blue channels, and the last four images are the cipher image and corresponding histograms of Red, Green, Blue channels.

https://doi.org/10.1371/journal.pone.0325197.g008

Histograms of different plaintext images in Fig 8 are clearly different for any channel, resulting from the difference of image content. Furthermore, all histograms of plaintext images have irregular and fluctuant shape. On the contrary, no matter which channel and which plaintext image is concerned, the histogram of its cipher image always appears flat, which means the number of pixels is approximately equal for any gray level.

Moreover, another histogram statistical test chi-square is employed to measure the randomness and uniformity of cipher images. The chi-square can be calculated by (24), where fi is the number of pixels with gray level i, and M,N are respectively the height and width of the image. The results of chi-square test are given in Table 10, and it can be seen that all results are below the threshold value 293.2478.

thumbnail
Table 10. Chi-square test results of cipher images with EDCREZT.

https://doi.org/10.1371/journal.pone.0325197.t010

(24)

Due to the fact that cipher images have satisfyingly uniform and flat gray level frequency distribution, EDCREZT is shown to be reliable to resist histogram attacks.

4.4 Information entropy

Information entropy is a metric to measure the uncertainty and randomness of images. Information entropy of a color image with regard to channel C, can be calculated as (25), where the probability of gray level i is denoted by p(i).

(25)

In general, larger information entropy is accompanied by larger uncertainty. If the probability of pixel gray levels of an image follows uniform distribution, the information entropy achieves the maximum value of 8. Therefore, in order to resist statistical attacks, an encryption method is expected to generate cipher images with information entropies as large as possible. In Table 11, information entropies of three and five test images are listed. It can be seen there is a considerable gap between the information entropy of any plaintext image and the theoretical upper bound. In comparison, information entropies of multiple cipher images encrypted with EDCREZT and several methods in references are also given in Table 11. It can be seen the average information entropies are about 7.9972 and 7.9993 for and cipher images respectively, which are very close to the theoretical upper bound, considerably larger than those of plaintext images.

thumbnail
Table 11. Shannon entropies of test images and their cipher images.

https://doi.org/10.1371/journal.pone.0325197.t011

However, the information entropy, also called global Shannon entropy, has shortcomings including inaccuracy, inconsistency and low efficiency. In [50], Wu et al. proposed the local Shannon entropy, which fixed the deficiency of global Shannon entropy. With randomly selected K non-overlapping blocks from image S, each block consisting of TB pixels, the local Shannon entropy can be calculated in (26), where H(Si) is the global Shannon entropy of block Si. With respect to -level confidence 0.05, the range of local Shannon entropy for (K = 30,TB = 1936) is between 7.901901305 and 7.903037329. The local Shannon entropies of test images and their cipher images are given in Table 12, in which the average local Shannon entropy of all channels of each cipher image meets the requirement.

thumbnail
Table 12. Local Shannon entropies of test images and their cipher images.

https://doi.org/10.1371/journal.pone.0325197.t012

(26)

4.5 Encryption quality

In order to evaluate the encryption quality of cipher images, various metrics can be employed, such as Mean Square Error(MSE) and Peak Signal-to-Noise Ratio(PSNR). Whichever metric is selected, the key is to compare the pixel values of the plaintext image and its cipher image.

Mean square error.

MSE can be utilized to evaluate the average square difference between pixel values of a plaintext image and its cipher image. Given a plaintext image and its cipher image, if their MSE is high, then it means the similarity between them is low, which indicates a relatively satisfying encryption quality. MSE can be calculated in (27), where M,N are the height and width of the image, and P(i,j),C(i,j) are pixel gray levels at ith row and jth column of the plain text image and the cipher image respectively.

(27)

Peak signal-to-noise ratio.

PSNR is another metric to evaluate the encryption quality of a cipher image. If the PSNR is very low, then it means the cipher image is close to a random noise image, which indicates a good encryption quality. PSNR can be calculated by (28).

(28)

Results of MSE and PSNR tests are given in Table 13.

4.6 Correlation

This test is intended to examine correlation of gray levels between adjacent pixels, where adjacent pixels include adjacent pixels in the same row, the same column and the same diagonal. In a natural image, there is a high probability that gray levels of adjacent pixels are very close. However, in a cipher image, if high correlation is found between adjacent pixels, the encryption method may be vulnerable to attacks. Given gray levels of n pixels and those of their adjacent pixels respectively, correlation coefficient of X and Y denoted by is calculated by (29), which indicates correlation between two pixel sequences with regard to gray level. Obviously, E(X), D(X) and cov(X,Y) are expectation of X, variance of X and covariance of X and Y respectively.

(29)

If these two groups of pixels have close gray levels, i.e, high correlation exists between adjacent pixels, will be close to 1. On the contrary, If there is few correlation between adjacent pixels, approximates to 0. In Tables 14 and 15, test results of correlation coefficients are given, where the minimum correlation value of each row is printed in bold font. It is shown clearly that correlation coefficients of plaintext images are much higher than those of cipher images. The number of times to achieve the minimum correlation coefficient in all test items, is often adopted as a metric to evaluate an image encryption method. For three test images, it is clearly seen that EDCREZT got 22 minimum correlation coefficients out of 27, which is much better than 5 out of 27 by the other scheme in [13]. Among all test items for five test images, EDCREZT got 11 minimum correlation coefficients out of 45, while Ref. [32], Ref. [9], Ref. [13], Ref. [51] got 15, 8, 2 and 11 respectively. Additionally, the average correlation coefficient of all 27 testing items of EDCREZT is 0.0013, while Ref. [32], Ref. [9], Ref. [13], Ref. [51] got 0.0012, 0.0018, 0.0099 and 0.0017 respectively. Clearly, EDCREZT is shown to be competitive in the correlation test.

thumbnail
Table 14. Correlation coefficients of test images and cipher images.

https://doi.org/10.1371/journal.pone.0325197.t014

thumbnail
Table 15. Correlation coefficients of test images and cipher images.

https://doi.org/10.1371/journal.pone.0325197.t015

Moreover, in order to show the test results visually, for both test images and their cipher images with EDCREZT, 2000 pairs of adjacent pixels are selected randomly, and their gray levels are used to plot the correlation figure. The 2000 pairs of adjacent pixels include all three types of adjacent pairs, i.e., adjacent pairs in horizontal, vertical and diagonal directions. In an intuitive way, the results are in Fig 9, in which a dot corresponds to a pair of adjacent pixels, and its coordinates and color indicate their gray levels and channel respectively. Obviously, compared with cipher images, correlation of plaintext images is shown to be far larger.

thumbnail
Fig 9. Correlations of 2000 random pairs of adjacent pixels.

https://doi.org/10.1371/journal.pone.0325197.g009

4.7 Differential attack

By comparing the chosen plaintext and its ciphertext, attackers try to recover private keys in the model of differential attacks. When a tiny modification is made to the plaintext image, if it is possible that only an insignificant change of the cipher image is caused, then the encryption method is vulnerable to differential attacks. On the contrary, when a tiny modification is made to the plaintext image, if it is inevitable that significant change of the entire cipher image will be caused, then the encryption method is capable of resisting differential attacks.

For image encryption methods, there are two important metrics to measure their capability against differential attacks. The first metric is NPCR, which indicates the pixel change rate. The second metric is termed as UACI, which indicates the unified average changing intensity. Given plaintext images P1 and P2, their cipher images are denoted by , respectively, then Di,j is given in (30), which indicates whether the color values of two pixels at ith row and jth column of , are equal.

(30)

Then, NPCR and UACI are given in (31) and (32) respectively:

(31)(32)

With any given plaintext image P1, the differential attack test is carried out in the following steps:

  1. Encrypt plaintext image P1 into cipher image .
  2. Randomly select a pixel from P1, then make a one-bit modification to the selected byte of an arbitrary channel, and denote the modified image by P2. Of course, it is also randomly decided that which bit is to be modified.
  3. Encrypt plaintext image P2 into cipher image .
  4. Calculate NPCR and UACI with and .

Since P2 is generated according to random choices, tests are repeated 20 times for any plaintext image. In Tables 16 and 17, the average test results are listed. For and gray scale images, with significance level of 0.05, the criterion to pass NPCR test is that NPCR score should be no less than 99.5693% and 99.5893% respectively, and the criterion to pass UACI test is that UACI score is in range [33.2824%, 33.6447%] and [33.3730%, 33.5541%] respectively [52]. For each test image, all NPCR and UACI scores of EDCREZT pass this test, according to Tables 16 and 17. Results confirm the fact that EDCREZT possesses the capability of resisting differential attacks.

4.8 Robustness

When images are stored or transmitted, they may suffer from interference of noises or even data loss sometimes. Since cipher images may also encounter these issues, it is a question of concern that whether the content of the plaintext image can be recognized from the resulting image by decrypting a contaminated cipher image. The answer can be obtained by applying the robustness test to EDCREZT as well as corresponding decryption method.

The first robustness test is salt and pepper noise test. At the beginning of this test, salt and pepper noises of and are added to the cipher image of test image 4.2.07 repectively, then these five contaminated cipher images are decrypted, and five resulting images are given in Fig 10. Obviously, five images recovered from these contaminated cipher images can be recognized easily, which demonstrates the excellent performance of EDCREZT in salt and pepper noise test.

thumbnail
Fig 10. Salt and Pepper noise test with five different percents.

In each subfigure, the top half is the cipher image, and the bottom half is the decrypted result.

https://doi.org/10.1371/journal.pone.0325197.g010

The second robustness test is cropping test. In this test, and pixels are cropped from the cipher image of 4.2.07 respectively. Then five recovered images could be obtained by decrypting theses cropped images, which are given in Fig 11. Even in the case of cropping, the recovered image can be recognized well, which proves the satisfying robustness of EDCREZT against cropping.

thumbnail
Fig 11. Cropping test with five different percents.

In each subfigure, the top half is the cipher image, and the bottom half is the decrypted result.

https://doi.org/10.1371/journal.pone.0325197.g011

4.9 Runtime

Time complexity of EDCREZT during the process of encrypting an color image, is analyzed as follows:

  1. Generation of initial values for four-dimensional hyperchaotic system.
    It costs O(1) time to calculate four initial values in Sect 3.1.
  2. Generation of chaotic sequences.
    The total number of iterations is , which takes time.
  3. Permutation at pixel-level.
    The horizontal shift and the vertical shift need M + N circular shift operations, leading to an time complexity.
  4. Encoding image into DNA sequence.
    The time complexity to generate a DNA sequence of length is .
  5. Permutation at DNA-level.
    All DNA bases will be processed with the extended Zigzag transform for DNA-level permutation, which takes time.
  6. Diffusion at DNA-level.
    There are two rounds of diffusion operations according to eight-base DNA complementary rules, which needs operations altogether. So it costs time in this step.
  7. Decoding DNA sequence into cipher image.
    Similarly to the process of encoding an image into a DNA sequence, it takes time to decode the DNA sequence into the final cipher image.

Consequently, it takes time for EDCREZT to encrypt an image. In practice, the average time to encrypt a test image and a test image are approximately 2.8 seconds and 10.8 seconds respectively. For comparison, the runtime and time complexity of several references employing DNA or RNA are given in Table 18.

5 Conclusions

As an efficient technique to protect image content from unauthorized access, image encryption is widely applied in a number of fields including healthcare, military and social networks. In image encryption, permutation and diffusion are conducted at pixel-level traditionally. With DNA computing introduced into image encryption, permutation and diffusion at DNA-level have been increasingly adopted. In this paper, complementary rules of eight-base DNA are proposed, which can bring far more flexibility and complexity into image encryption than those of four-base DNA. In addition, a new extended Zigzag transform is also proposed, which can generate a large number of Zigzag-like paths for image scrambling.

By combining a 4D hyperchaotic system, complementary rules of eight-base DNA and the extended Zigzag transform, a novel image encryption scheme EDCREZT is presented. The encryption process of EDCREZT consists of several parts: pixel-level permutation, dynamic DNA encoding, DNA-level permutation by the extended Zigzag transform, DNA-level diffusion by the proposed complementary rules, and dynamic DNA decoding. Results of extensive experiments confirm the satisfying capability of EDCREZT to resist typical attacks.

However, the encryption speed of EDCREZT is an obvious shortcoming. The main reason lies in the fact that there are a large number of bit operations and a large demand of random numbers in the encryption procedure. Simply speaking, though EDCREZT improves security with DNA computing, the efficiency is decreased at the same time. In future work, improvement could be achieved by simplifying the diffusion process, in order that the need of random numbers and the number of bit operations can be reduced.

References

  1. 1. Fridrich J. Symmetric ciphers based on two-dimensional chaotic maps. Int J Bifurc Chaos. 998;8(06):1259–84.
  2. 2. Belazi A, Khan M, El-Latif AAA, Belghith S. Efficient cryptosystem approaches: S-boxes and permutation–substitution-based encryption. Nonlinear Dyn. 2017;87:337–61.
  3. 3. Cassal-Quiroga BB, Campos-Cantón E. Generation of dynamical S-Boxes for block ciphers via extended logistic map. Math Probl Eng. 2020;2020(1):2702653.
  4. 4. Alabaichi A. True color image encryption based on DNA sequence, 3D chaotic map, and key-dependent DNA S-box of AES. J Theor Appl Inf Technol. 2018;96(2).
  5. 5. Youssef M, Gabr M, Alexan W, Mansour MBM, Kamal K, Hosny H. Enhancing satellite image security through multiple image encryption via hyperchaos, SVD, RC5, and dynamic S-Box generation. IEEE Access. 2024.
  6. 6. Alexan W, Korayem Y, Gabr M, El-Aasser M, Maher EA, El-Damak D. Anteater: When Arnold’s cat meets Langton’s ant to encrypt images. IEEE Access. 2023;11:106249–76.
  7. 7. Zhang X, Wu T, Wang Y, Jiang L, Niu Y. A novel chaotic image encryption algorithm based on Latin square and random shift. Comput Intell Neurosci. 2021;2021:2091053. pmid:34531907
  8. 8. Shen H, Shan X, Xu M, Tian Z. A new chaotic image encryption algorithm based on transversals in a Latin square. Entropy (Basel). 2022;24(11):1574. pmid:36359662
  9. 9. Hua Z, Zhu Z, Chen Y, Li Y. Color image encryption using orthogonal Latin squares and a new 2D chaotic system. Nonlinear Dyn. 2021;104(4):4505–22.
  10. 10. Hao W, Zhang T, Chen X, Zhou X. A hybrid NEQR image encryption cryptosystem using two-dimensional quantum walks and quantum coding. Signal Process. 2023;205:108890.
  11. 11. Naes MNA, El-Sayed H, Youssif A. Mixed multi-chaos quantum image encryption scheme based on quantum cellular automata (qca). Fractal Fract. 2023;7(10):734.
  12. 12. Rehman MU. Quantum-enhanced chaotic image encryption: Strengthening digital data security with 1-D sine-based chaotic maps and quantum coding. J King Saud Univ Comput Inf Sci. 2024;36(3):101980.
  13. 13. Meng F, Gu Z. A color image-encryption algorithm using extended DNA coding and zig-zag transform based on a fractional-order laser system. Fractal Fract. 2023;7(11):795.
  14. 14. Zhu S, Deng X, Zhang W, Zhu C. Image encryption scheme based on newly designed chaotic map and parallel DNA coding. Mathematics. 2023;11(1):231.
  15. 15. Alawida M, Teh JS, Alshoura W. A new image encryption algorithm based on DNA state machine for UAV data encryption. Drones. 2023;7(1):38.
  16. 16. Li J, Wang C, Deng Q. Symmetric multi-double-scroll attractors in Hopfield neural network under pulse controlled memristor. Nonlinear Dyn. 2024;112(16):14463–77.
  17. 17. Ren L, Mou J, Banerjee S, Zhang Y. A hyperchaotic map with a new discrete memristor model: Design, dynamical analysis, implementation and application. Chaos Soliton Fract. 2023;167:113024.
  18. 18. Deng Q, Wang C, Sun Y, Deng Z, Yang G. Memristive tabu learning neuron generated multi-wing attractor with FPGA implementation and application in encryption. IEEE Trans Circuits Syst I Regul Pap. 2024.
  19. 19. Kong X, Yu F, Yao W, Cai S, Zhang J, Lin H. Memristor-induced hyperchaos, multiscroll and extreme multistability in fractional-order HNN: Image encryption and FPGA implementation. Neural Netw. 2024;171:85–103. pmid:38091767
  20. 20. Yu F, Lin Y, Yao W, Cai S, Lin H, Li Y. Multiscroll hopfield neural network with extreme multistability and its application in video encryption for IIoT. Neural Netw. 2025;182:106904. pmid:39571387
  21. 21. Garcı́a-Martı́nez M, Ontañón-Garcı́a L, Campos-Cantón E, Čelikovsky S. Hyperchaotic encryption based on multi-scroll piecewise linear systems. Appl Math Comput. 2015;270:413–24.
  22. 22. Sun C, Wang E, Zhao B. Image encryption scheme with compressed sensing based on a new six-dimensional non-degenerate discrete hyperchaotic system and plaintext-related scrambling. Entropy (Basel). 2021;23(3):291. pmid:33673406
  23. 23. Gabr M, Korayem Y, Chen YL, Yee L, Ku CS, Alexan WR. R 3-rescale, rotate, and randomize: a novel image cryptosystem utilizing chaotic and hyper-chaotic systems. IEEE Access. 2023;11:119284–312.
  24. 24. Feng W, Yang J, Zhao X, Qin Z, Zhang J, Zhu Z. A novel multi-channel image encryption algorithm leveraging pixel reorganization and hyperchaotic maps. Mathematics. 2024;12(24):3917.
  25. 25. Feng W, Zhang J, Chen Y, Qin Z, Zhang Y, Ahmad M. Exploiting robust quadratic polynomial hyperchaotic map and pixel fusion strategy for efficient image encryption. Expert Syst Appl. 2024;246:123190.
  26. 26. Xingyuan W, Junjian Z, Guanghui C. An image encryption algorithm based on ZigZag transform and LL compound chaotic system. Opt Laser Technol. 2019;119:105581.
  27. 27. Wang X, Guan N. A novel chaotic image encryption algorithm based on extended Zigzag confusion and RNA operation. Opt Laser Technol. 2020;131:106366.
  28. 28. Gao H, Wang X. Chaotic image encryption algorithm based on zigzag transform with bidirectional crossover from random position. IEEE Access. 2021;9:105627–40.
  29. 29. Zhang D, Chen L, Li T. Hyper-chaotic color image encryption based on transformed zigzag diffusion and RNA operation. Entropy (Basel). 2021;23(3):361. pmid:33802901
  30. 30. Wu Y, Zhou Y, Noonan JP, Agaian S. Design of image cipher using Latin squares. Inf Sci. 2014;264:317–39.
  31. 31. Liu W, Sun K, He Y, Yu M. Color image encryption using three-dimensional sine ICMIC modulation map and DNA sequence operations. Int J Bifurc Chaos. 2017;27(11):1750171.
  32. 32. Fan W, Li T, Wu J, Wu J. Chaotic color image encryption based on eight-base DNA-level permutation and diffusion. Entropy (Basel). 2023;25(9):1268. pmid:37761567
  33. 33. Liu H, Wang X. Image encryption using DNA complementary rule and chaotic maps. Appl Soft Comput. 2012;12(5):1457–66.
  34. 34. Ur Rehman A, Liao X, Kulsoom A, Abbas SA. Selective encryption for gray images based on chaos and DNA complementary rules. Multimed Tools Appl. 2015;74:4655–77.
  35. 35. Kulsoom A, Xiao D, Abbas SA. An efficient and noise resistive selective image encryption scheme for gray images based on chaotic maps and DNA complementary rules. Multimed Tools Appl. 2016;75:1–23.
  36. 36. Ur Rehman A, Liao X, Ashraf R, Ullah S, Wang H. A color image encryption technique using exclusive-OR with DNA complementary rules based on chaos theory and SHA-2. Optik. 2018;159:348–67.
  37. 37. Fu S, Cheng X, Liu J. Dynamics, circuit design, feedback control of a new hyperchaotic system and its application in audio encryption. Sci Rep. 2023;13(1):19385. pmid:37938603
  38. 38. Wang X, Chen X. An image encryption algorithm based on dynamic row scrambling and Zigzag transformation. Chaos Soliton Fract. 2021;147:110962.
  39. 39. Hua Z, Li J, Li Y, Chen Y. Image encryption using value-differencing transformation and modified zigzag transformation. Nonlinear Dyn. 2021;106(4):3583–99.
  40. 40. Wang X, Sun H. A chaotic image encryption algorithm based on zigzag-like transform and DNA-like coding. Multimed Tools Appl. 2019;78(24):34981–97.
  41. 41. Xu C, Zhang Y. A modified zigzag transform method and its application in image encryption. Int J Netw Secur. 2022;24(6):1008–14.
  42. 42. Li H, Hu Y, Shi Z, Wang B, Zheng P. An image encryption algorithm based on improved lifting-like structure and cross-plane zigzag transform. IEEE Access. 2022;10:82305–18.
  43. 43. Wang X, Du X. Chaotic image encryption method based on improved zigzag permutation and DNA rules. Multimed Tools Appl. 2022;81(30):43777–803.
  44. 44. Feng W, He Y, Li H, Li C. Cryptanalysis and improvement of the image encryption scheme based on 2D logistic-adjusted-sine map. IEEE Access. 2019;7:12584–97.
  45. 45. Feng W, Qin Z, Zhang J, Ahmad M. Cryptanalysis and improvement of the image encryption scheme based on Feistel network and dynamic DNA encoding. IEEE Access. 2021;9:145459–70.
  46. 46. Wen H, Lin Y. Cryptanalyzing an image cipher using multiple chaos and DNA operations. J King Saud Univ Comput Inf Sci. 2023;35(7):101612.
  47. 47. Wen H, Lin Y. Cryptanalysis of an image encryption algorithm using quantum chaotic map and DNA coding. Expert Syst Appl. 2024;237:121514.
  48. 48. Liu W, Sun K, Zhu C. A fast image encryption algorithm based on chaotic map. Opt Lasers Eng. 2016;84:26–36.
  49. 49. Alvarez G, Li S. Some basic cryptographic requirements for chaos-based cryptosystems. Int J Bifurc Chaos. 2006;16(08):2129–51.
  50. 50. Wu Y, Zhou Y, Saveriades G, Agaian S, Noonan JP, Natarajan P. Local Shannon entropy measure with statistical tests for image randomness. Inf Sci. 2013;222:323–42.
  51. 51. Hua Z, Zhu Z, Yi S, Zhang Z, Huang H. Cross-plane colour image encryption using a two-dimensional logistic tent modular map. Inf Sci. 2021;546:1063–83.
  52. 52. Wu Y, Noonan JP, Agaian S. NPCR and UACI randomness tests for image encryption. J Sel Areas Telecommun. 2011;1(2):31–8.