Abstract

This paper proposes a hyperchaos-based image encryption algorithm, which consists of two scrambling-diffusion operations and one scrambling operation. In the proposed algorithm, the initial conditions of a hyperchaotic Chen system are first generated using the Message Digest 5 (MD5) value of digital images and given initial values, and then the images will be encrypted using the keystream created by the system. Since the initial values of hyperchaotic Chen systems are related to plaintext and the encryption process is related to the images, this algorithm is able to effectively protect images against selective plaintext attacks. Simulation results demonstrate that the present algorithm offers enhanced encryption performance, high security, and strong resistance to known attacks. Therefore, it may find wide application in image encryption transmission. Compared to other image encryption algorithms, the proposed algorithm uses different keystreams when encrypting different images and is capable of effectively resisting various plain image and differential attacks faster.

1. Introduction

Digital images have been widely used as a major carrier of network information. The past decade has seen the rapid development of cloud computing, big data, and communication technology. However, the security of image transmission has raised noticeable awareness and has become a high-priority topic in the field of information security. Neighboring pixels in an image exhibit a high level of correlation, and the image itself contains a large amount of pictorial data. Because of that, conventional text-based encryption schemes like the data encryption standard (DES) or advanced encryption standard (AES) are not applicable to image encryption. It is therefore a critical task to design new algorithms that can be used for image encryption.

Chaotic systems are nonlinear and have inherent characteristics like high sensitivity to control parameters’ initial conditions, internal randomness, unpredictability, and ergodicity. Therefore, pseudo-random sequences generated from chaotic systems are random, are computationally unpredictable, have a weak correlation, and possess a large parameter space. This property makes chaotic systems particularly competent for image encryption. Since Fridrich put forward a symmetric block encryption algorithm on the basis of invertible 2D chaotic maps in 1989 [1], many chaotic-based image encryption algorithms have been developed.

For instance, [2] proposed a real-time secure symmetric encryption algorithm that used a 3D cat map to rearrange all the pixels of the original images and another chaotic map to mystify the relationship between the plain image and the cipher image, thereby increasing the immunity against statistical and differential attacks. The authors of [3] developed an image encryption approach based on chaotic logistic maps, which employed an 80-bit external secret key and two chaotic logistic maps. The authors of [4] designed a modified image encryption using coupled map lattices and substitution box transformation. In that approach, the positions of image pixels were mixed up by using a chaotic tent map; coupled map lattices and the S-box transformation were also employed to confuse the correlation between the original and the encrypted images. The authors of [5] put forward an image encryption scheme based on a quantum chaotic map and diffusion-permutation architecture. In their approach, the quantum chaotic map and the 2D logistic map were separately coupled with nearest-neighboring coupled-map lattices to achieve high complexity and randomness in the generated keystreams. The authors of [6] developed a lossless encryption method for color images by means of a 6D hyperchaotic system and the 2D discrete wavelet transform (DWT). Their scheme was established based on the 2D DWT and 6D hyperchaotic systems in both the spatial and frequency domains, where the key streams hinge on both the hyperchaotic system and the plain image.

The authors of [7] presented an encryption scheme of linear-nonlinear-linear structure that employed total shuffling. Their system was able to generate a 1D chaotic system with enhanced chaotic performances and broader chaotic ranges by comparison with previous chaotic maps. The authors of [8] presented an image encryption method that enhanced the link between value changing for grayness and position shuffling for pixels. The authors of [9] developed a new image encryption algorithm, SPRING, applying lightweight chaotic maps and simple arithmetic and logical operations. The authors of [10] put forward a digital image encryption scheme via dynamic deoxyribonucleic acid coding and chaotic operations, making use of hyper-digital chaos in the frequency domain. In that algorithm, both the phase and amplitude components in the frequency domain were scrambled and diffused. The authors of [11] presented a 2D logistic-modulated-sine-coupling-logistic chaotic map (LSMCL) and used that map to design an image encryption scheme consisting of two rounds of permutation and diffusion operation. The authors of [12] put forward a composite chaotic map and a way of utilizing optimization approach to enhance the performance of encryption schemes. The authors of [13] applied three chaotic sequences to acquire a high level of encryption in their scheme to conduct both permutation and substitution processes of image encryption. The authors of [14] first obtained a memristive neuron model by coupling a memristor into an advanced neuron model with key chaotic characteristics. After that, they proposed a new encryption algorithm to apply the memristive neuron for image encryption. Lai, Zhang, and other coworkers [15] also designed a novel Hopfield neural network (HNN) that can yield multiscroll attractors by using a new memristor as a synapse in the HNN. They finally developed a 3D image encryption scheme based on the proposed memristive and confirmed its outstanding encryption performance.

However, lots of chaos-based image encryption schemes are in fact not as secure as their developers claimed and cannot resist selective and known plaintext attacks. For example, the images encrypted using the schemes developed by [16, 17], and [18] were decoded by [19, 20], and [21] through plaintext attacks, respectively. Those encrypted images were deciphered because the secret keys were not related to the original plain images and the generated chaotic sequences to encrypt image data were constant. Those security defects made the aforementioned algorithms [16, 17]; and [18] as well as other encryption algorithms designed in similar manners [22, 23] vulnerable to plaintext attacks.

To overcome the abovementioned shortcomings, this paper presents a hyperchaos-based image encryption scheme that has a scrambling-diffusion structure. In the present algorithm, the generated secret key is related to the original plain image and the encryption process is related to the image. Simulation results have verified that the presented scheme possesses a high degree of resistance against various plaintext attacks. The remainder of this paper is structured as follows. Section 2 reviews the hyperchaotic Chen system adopted in this study. Section 3 illustrates the proposed algorithm, its structure, and presents the simulation results to verify its encryption performance. Section 4 discusses the characteristics of the algorithm by means of key space, key sensitivity, histograms, correlation coefficient, information entropy, and resistance to differential attacks. Section 5 concludes the paper.

2. Hyperchaotic Chen System

The hyperchaotic Chen system was presented by [24] from the Chen system via a dynamical controller. This system was chosen for designing the image encryption algorithm because it has notable dynamical properties and can generate pseudo-random sequences with excellent statistical properties. The equations describing the dynamics of the hyperchaotic Chen system can be written as follows [25]:

When the control parameters a = 36, b = 3, c = 28, d = 16, and −0.7 ≤ k ≤ 0.7, the system is in hyperchaotic status. In this study, k is set as 0.2. Figure 1 shows the attractor of this hyperchaotic system.

3. Image Encryption Algorithm

The image encryption process is illustrated in Figure 2. At first, the Message Digest 5 (MD5) hash value of the plain image is acquired, based on which the initial conditions of the hyperchaotic Chen system are determined. Next, the system generates chaotic sequences in an image encryption process. The generated sequences are then used for scrambling and diffusing the pixels or bits of the original image, and the entire encryption process is completed after two rounds of high-speed scrambling and pixel adaptive diffusion and a bit-plane scrambling step.

3.1. Generation and Testing of Key Stream

We assume that the size of a plain image P is M × N, the steps to generate a key stream are as follows:Step 1: Generate a 128 bit secret key I from the plain image P using the MD5 algorithm.Step 2: Divide I into 32 4-bit-long groups, which is I = i1, i2, i3, …, i32.Step 3: Determine the initial conditions of the hyperchaotic Chen system based on given initial values using equation (2). This set of initial conditions will be used for scrambling and diffusion operation I.Step 3: Substitute into the hyperchaotic Chen system (equation (1)), iterate 500 times, and then continue to iterate other M × N times to obtain a sequence x1(i), y1(i), z1(i), and , where i = 1, 2, 3, …, M × N.Step 4: Processe the generated sequence using equation (3) to obtain M × N matrices X1, Y1, Z1, W1, R1, and S1.In equation (3), floor(x) returns the largest integer that is smaller than or equal to x, while mod(x, y) returns the remainder of x divided by y.Step 5: Determine another set of initial conditions for the Chen system based on using equation (4). This set of initial conditions will be used for scrambling and diffusion operation II.Step 6: Repeat step 3 to generate another sequence obtain a sequence x2(i), y2(i), z2(i), and , where i = 1, 2, 3, …, M×N.Step 7: Repeat step 4 to obtain another set of M × N matrices X2, Y2, Z2, W2, R2, and S2 using equation (5).

Next, a statistical test suite put forward by [26] was applied to test a key stream generated by the hyperchaotic Chen system following the above steps to determine its randomness. The plain image chosen for this experiment is “Lena”, whose size is 512 × 512. The initial values of this hyperchaotic Chen system are: x0 = 0.3838, y0 = 0.9876, z0 = 32.1234, and . Test results are displayed in Table 1, from which it can be determined that the key stream generated by this system possesses excellent randomness.

3.2. Scrambling Operation I

The scrambling operation I is pixel-related, which scrambles the pixels in the original image through two scrambling processes. M + N pixels are selected from the image and the remaining pixels are scrambled in the first process, while the M + N selected pixels will be scrambled in the second process.

The steps of the first scrambling process are:Step 1: We randomly select M + N pixels from the image P, which will not be scrambled in this process; then use matrices X1 and Y1 to determine the locations of the selected pixels P(b(i), c(i)), i = 1, 2, 3, …, M + N. The values of b and c are calculated using equations (6) and (7), respectively.Step 2: Solve the information entropy (H1) of the remaining pixels of the image (excluding the selected M + N pixels P(b(i), c(i)) using equation (8); then find h1 from H1 based on equation (9).In (8), mi represents the grayscale value of each pixel of the image; p(mi) represents the probability of the occurrence of the value mi in the image; and N denotes the value’s number of bits.Step 3: Shift the location of pixels P(i, j) and , determine the location and using equations (10) and (11).If is solved as 0 based on (10), then we set ; likewise, if is solved as 0 from (11), it will be set as .Step 4: Complete the location change if both P(i, j) and do not belong to the randomly selected M + N pixels P(b, c). In another word, if i = b(k), j = c(k) or , k = 1, 2, 3, …, M + N, then the positions of P(i, j) and will not be changed.

The image obtained after the first scrambling process is denoted as E.

The second scrambling process is to change the locations of the M + N pixels E(b(i), c(i)) that have not been scrambled in the first process, which includes the following steps:Step 1: Form a vector F with the M + N pixels F(i) = {E(b(i), c(i))}, i = 1, 2, 3, …, M + N.Step 2: Find the information entropy of {F}, H2, using equation (8), and obtain h2 from H2 following the same approach described in equation (9): .Step 3: Chang the location of F(i) to F(t) by means of matrix S1 (established in equation (3)). t can be determined using equation (12)If t is found to be 0 from (12), then let t = S1(i).Step 4: Plac the scrambled F(i) back into the image E and update the M + N pixels in E as E(b(i), c(i)) = F(i), i = 1, 2, 3, …, M + N.

3.3. Diffusion Operation I

The diffusion operation I mixes modulo addition and bitwise exclusive or (XOR) operations as suggested by [2]. Its main steps are:Step 1: Obtain an image matrix G by conducting an XOR diffusion operation with the help of matrix Z1 (equation (3))Step 2: Represent G as a row vector GV, and matrix R1 (established in equation (3)) as another row vector RV, then conduct a modulo operation to obtain J (equation (14)).Step 3: Represent matrix W1 (equation (3) as a row vector WV and use it for another modulo operation to obtain diffused image data K, as illustrated in equation (15):

3.4. Bit-Plane Scrambling Operation

The image’s pixel values are represented in an 8 bit binary format. We first obtain the 8 bit binary value of each pixel in K and rearrange those binary values to obtain the position-scrambled image data (Figure 3).

The method of acquiring the 8-bit binary value of the ith pixel involves the following steps: , i = 1, 2, 3, …, MN. Next, a new set of image data L1(i) can be obtained by scrambling K(i) via the process illustrated in Figure 2 as , i = 1, 2, 3, …, MN. Decimal values of L1(i) can then be easily obtained as

The L(i) is a M × N matrix and the image K is converted to image A after this operation.

3.5. Scrambling Operation II

The scrambling operation II is related to the plaintext. All the pixels in the image A will be scrambled in this operation through two processes. Similar to the scrambling operation I, in the first scrambling process, M + N pixels are selected from A and the remaining pixels will be scrambled. In the second process, the M + N selected pixels will be scrambled.

The first scrambling process consists of following steps:Step 1: Randomly select M + N pixels from A and the selected pixels will not be scrambled in this process. The locations of those pixels (d(i), f(i)) are determined by means of matrices X2 and Y2 (equation (5)) using the following equations:The selected pixels A(d(i), f(i)), i = 1, 2, 3, …, M + N will not be scrambled in the first scrambling process.Step 2: Find the mean value and mix for image A and obtain mixA using equation (19).Step 3: Shift the locations of the pixel A(i, j) and , where and h are determined by the following equations:If is found to be zero, then let ; likewise, if h is found to be zero then h = Y2(i, j).Step 4: Complete the location change if both A(i, j) and do not belong to the randomly selected M + N pixels A(d, f). In another word, if i = d(k), j = f(k) or , k = 1, 2, 3, …, M + N, then the positions of A(i, j) and will not be shifted.

The image obtained after the first scrambling process is denoted as B.

The second scrambling process is to scramble the M + N pixels B(d(i), f(i)) that have not been scrambled in the first process. The steps of this process are listed below:Step 1: Form a vector C with the M + N pixels C(i) = {B(d(i), f(i))}, i = 1, 2, 3, …, M + N.Step 2: Find the mean value and mix of C, and obtain mixC following the same approach depicted in Step 3: Shift the locations of C(i) and C(q) by means of matrix S2 (established in equation (5)). q can be determined based onIf q is found to be 0 from (21), then let q = S2(i).Step 4: Place the scrambled C(i) back into the image and update the M + N pixels in B as B(d(i), f(i)) = C(i), i = 1, 2, 3, …, M + N.

3.6. Diffusion Operation II

The diffusion operation II is similar to operation I (Section 3.3) and consists of the following steps:Step 1: Obtain an image matrix D through a modulo operation using matrix Z2 (equation (5)):Step 2: Represent D as a row vector DK, matrix R2 (established in equation (5)) as another row vector RK and perform an XOR diffusion operation to obtain Q.Step 3: Represent matrix W2 (equation (5) as a row vector WK and use it for another XOR operation to obtain T:

The result T is then converted to a M × N matrix TL.

3.7. Simulation Results

The proposed image encryption algorithm was then applied to encrypt and decrypt four grayscale images (baboon, Lena, airplane, and pepper) to assess its encryption performance. The size of the selected images is 512 × 512. The secret key of each image consists of initial values , as well as the 128 bit MD5 hash value of the image. The encryption and decryption processes were simulated on professional graphic workstations (graphics card: NVDIA Tesla K80, processor: Intel Core i7-6700K, and the maximum RAM capacity was 8 GB) using Matlab. Matlab is a powerful software package which has been widely used for solving engineering problems and developing graphical illustrations [27, 28]. Simulation results and the original plain images are displayed in Figure 4. From that figure, we can find that the encrypted images are noise-like images, which are completely different from the original images. However, the decrypted images are identical to the original images.

4. Performance Analysis

A good encryption algorithm should guarantee security and exhibit an excellent encryption performance. An assessment of the developed image encryption algorithm is presented in this section. As mentioned in 3.7, Matlab was used for this computational analysis. The running platform was an Intel Core i7-6700K processor (8M Cache, 4 GHz) with a maximum RAM capacity of 8 GB and the operating system was Windows 7.

4.1. Key Space

An encryption system needs to have a large key space to resist exhaustive attacks. The key space size has to be larger than 2128 to effectively protect the images from exhaustive attacks. The secret key generated from the proposed encryption algorithm includes four initial values , and a 128 bit MD5 value. The initial values are double precision values. The space of the key consists of those first four values is about 2192, which is far greater than 2128. Therefore, the present encryption algorithm can effectively resist the exhaustive attacks.

4.2. Histograms

The histogram of an image reflects the image’s statistical properties. Figure 4 displays histograms of the original plain images and the encrypted images. A secure encryption system can make an encrypted image with a uniform histogram to resist any statistical attacks [29]. As shown in Figure 5, the histograms of the encrypted images are evidently different from those of the plain images, which reveals that the pixel values of the encrypted images are evenly distributed. Therefore, the displayed histograms proved that the present scheme is well able to withstand the statistical attacks.

4.3. Correlation Coefficient Analysis

Neighboring pixels of plain images have strong correlations. An effective image encryption scheme should be able to reduce these correlations to almost zero. The correlation coefficient ( and are two adjacent pixels) is calculated aswhere

In this study, we selected 5,000 pairs of adjacent pixels from both the plain and encrypted images and calculated the correlation coefficients along vertical, horizontal, and diagonal directions. Calculation results are listed in Table 2 and Figure 6 compares the correlation coefficients calculated from the original and encrypted image of pepper. It can be seen from Table 2 that the horizontal, vertical, and diagonal correlation coefficients of the original plain images are close to 1 and the corresponding correlation coefficients of the encrypted images are nearly zero. This means that the present algorithm can significantly reduce the correlation coefficients and show desirable encryption performance.

4.4. Key Sensitivity Analysis

Next, we use two similar key codes (with slight differences) to encrypt the same image to obtain two encrypted images. If these two images differ markedly from each other, then it means the present algorithm is very sensitive to small changes in key because such small changes would produce great differences between cipher images. Otherwise, the key sensitivity of the algorithm is low. The initial values of the first key code are x0 = 0.4, y0 = 0.9, z0 = 30, and ω0 = 0.6; and those of the second key code are set to be x0 = 0.4 + 10−15, y0 = 0.9, z0 = 30, and ω0 = 0.6. These two keys were used to encrypt the image for the airplane, and the two cipher images are displayed in Figure 7. From that figure, it can be found that the two encrypted images show obvious differences. The key sensitivity of the proposed encryption algorithm is therefore confirmed.

4.5. Information Entropy

Information entropy is a measure of the randomness or uncertainty of image information. Under ideal conditions, the information entropy of a grayscale image should be 8 if the image consists of randomly distributed pixels. Therefore, the information entropy of a cipher image should be close to eight if the cipher image is encrypted using an effective image encryption algorithm. The information entropies of the four plain images and the corresponding encrypted images were calculated, and Table 3 lists the calculation results.

From Table 3 it can be found that the information entropies of the encrypted images are close to the optimal value 8, which verifies that the presented scheme is secure enough to be used for image transmission. Furthermore, the information entropy of the image of Lena processed using other encryption schemes was calculated as 7.9972 [33], 7.9992 [34], 7.9993 [31], and 7.9991 [35]. Compared to those values, the information entropy of the cipher image encrypted utilizing the present algorithm is closer to 8.

4.6. Resistance to Differential Attacks

An effective image encryption scheme should have excellent plain-image sensitivity and be capable of defending against differential attacks. It signifies that any slight change in the original plain image will cause its cipher image to change significantly. The plain image sensitivity of the present image encryption algorithm is determined through the following steps: Assuming a plain image P1, we first change the value of a randomly selected pixel of that image to obtain another plain image P2. Next, both P1 and P2 are encrypted, applying the present encryption algorithm to acquire two cipher images, C1 and C2. Finally, the plain-image sensitivity of the proposed algorithm is determined by comparing C1 with C2. The difference between C1 and C2 is indicated using net pixel change rate (NPCR) (27) and unified average changing intensity (UACI) (28) [36].where

In equation (29), (C1) (i, j) and C2(i, j) denote pixel values of C1 and C2. The NPCR and UACI of the encrypted images of baboon, Lena, airplane, and pepper are displayed in Table 4. For comparison, that table also contains the NPCR and UACI of the cipher images of Lena encrypted using existing image encryption algorithms.

From Table 4, it is found that compared with other schemes, the UACI and NPCR values yielded from the proposed algorithm are closer to their theoretical values of 99.61% and 33.46%, respectively. In other words, if we use the same key code generated from our algorithm to encrypt two very similar plain images, the obtained cipher images will differ markedly. Hence, it is verified that the developed algorithm is very sensitive to plain images and possesses a strong capacity to resist the differential attacks.

4.7. Resistance to Chosen Plain Image Attacks

Our algorithm can effectively defend against chosen plain image attacks. This is because the generated key code is related to the plain image, so different key codes will be acquired for different images. With a chosen plain image attack, the attacker can encrypt a plain image of his or her choice and has access to the resulting cipher image. This information is used to derive the encryption key and break the encryption algorithm. To assess the resistance of the designed algorithm to the chosen plain image attacks, the algorithm was applied to encrypt a 512 × 512 black image and a white image of the same size. The obtained cipher images were analyzed, and the results are displayed in Figure 8 and Table 5.

As shown in Table 5, the information entropies of the cipher images are very close to 8 and the correlation coefficients are close to 0. Therefore, almost no useful information can be extracted from the cipher images encrypted using the developed algorithm.

4.8. Speed Analysis

A good image encryption scheme should possess not only high security but also fast encryption speed. Using the image of Lena as an example, the speed analysis data (Table 6) show that compared with other image encryption algorithms, our algorithm is faster in encrypting images.

4.9. Discussion

The proposed image encryption algorithm consists of two scrambling-diffusion operations. To verify the superiority of two scrambling-diffusion operations over one scrambling-diffusion operation in image encryption, we encrypted the image “Baboon” using the proposed algorithm and an existing image encryption algorithm that only includes one scrambling-diffusion operation separately, and compared the encryption times and information entropies of these two encryptions (Table 7). As displayed in Table 7, the times needed for two scrambling-diffusion operations are quite close to those needed for one operation. However, the information entropy of the image encrypted after two scrambling-diffusion operations is better than the information entropy of the image encrypted with one operation. The comparison shows that the proposed encryption algorithm has high efficiency and exhibits greater performance than the algorithm with only one scrambling-diffusion operation.

5. Conclusion

This paper presents an image encryption algorithm based on the hyperchaotic Chen system. In this algorithm, the key code and the diffusion process are directly related to plain images. The present algorithm was employed to encrypt several plain images. Important parameters such as the key space, histograms, correlation coefficients, key and plain-image sensitivity, and information entropy of the cipher images were calculated to validate the encryption performance of the designed algorithm. Simulation results indicate that the proposed algorithm has high security and can effectively defend against the chosen plain image attacks and differential attacks. Therefore, the algorithm possesses high potential for practical applications. The present encryption algorithm will be further improved to enhance its security and encryption speed through the introduction of an image compression algorithm and machine learning techniques. [41, 42].

Data Availability

The data that support the findings of this study are available upon request.

Conflicts of Interest

All authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported by the High-Level Talent Research Start-Up Fund of Yulin Normal University under grant no. G2019ZK24. An earlier version of this paper has been presented as a preprint available at SSRN [42].