Abstract

This study proposes a new image encryption scheme based on a generalized Arnold map and Rivest–Shamir–Adleman (RSA) algorithm. First, the parameters of the generalized Arnold map are generated by an asymmetric encryption-system RSA algorithm, and the keystream is produced iteratively. To change the distribution of pixel values, the image data are hidden by XOR diffusion. Second, both rows and columns of the image are cyclically confused to hide the image data again. Then, the additive mode diffusion operation is performed to realize third-layer hiding for image content. The overall diffusion and confusion operations are conducted twice to obtain the final cipher image. Test results prove that the encryption scheme proposed in this study is effective and has strong antiattack capabilities and key sensitivity. In addition, because the scheme security relies on the RSA algorithm, it has high security.

1. Introduction

With the rapid development and popularization of computer-network and multimedia technology, computer networks have become important media for timely release of information. To display information content more intuitively and realistically, digital images are the most direct means of expressing information. Because images can reveal sensitive business, military, medical, and political issues, methods to protect their transmission and storage on public networks in the fields of encryption and information security have attracted greater attention than ever before. Classic cryptography provides better encryption and decryption algorithms for one-dimensional data streams. Examples include the data encryption standard, advanced encryption standard, and other cryptosystems. However, the special properties of digital images, including large data volume, high redundancy, and strong correlation, between adjacent pixels make traditional block ciphers less efficient when processing image data [1].

Accordingly, image encryption algorithms based on Arnold transform [2], double random phase coding [3], chaotic systems [46], compressed sensing [710], and other technologies have been proposed. Chaotic systems are widely used in image encryption because of basic characteristics such as sensitivity to initial conditions, pseudorandomness, ergodicity, and nonperiodicity. The image information encryption scheme based on chaos uses the random noise characteristics of a chaotic time series to encrypt the image data. Its main operational steps include image pixel diffusion and pixel position confusion. An efficient pixel-level image encryption algorithm was presented by Ye et al. [11], which enhanced the connection between position shuffling of pixels and the changes to gray values as compared to the traditional permutation-diffusion architecture. Zhu et al. [12] proposed an image cryptosystem based on a confusion and diffusion structure that uses an Arnold cat map for bit-level arrangement and a logistic map for diffusion. Addressing the insensitivity of traditional permutation and diffusion operations to pure image changes, Zhang et al. [13] proposed a lightweight bit-level confusion and cascade cross circular diffusion, which diffuses a small change in the plane image to the whole image with fewer rounds to enhance the security of the cryptographic system and reduce computational redundancy in the traditional architecture. Liu et al. [14] designed a color image encryption algorithm by using Arnold and discrete cosine transforms. The color image RGB components are confused by the Arnold transform, and the confused RGB components are randomly exchanged and mixed under the control of the matrix defined by a random angle. Unlike many image cryptosystems that perform permutation at the pixel level, the study in [15] used three-dimensional puzzle and chaotic maps to further promote diffusion and confusion. The method performs permutation at both the bit and pixel levels to provide additional confusion.

However, most of the aforementioned methods are types of symmetric cryptosystems, where the encryption and decryption keys are the same. This may cause problems related to security [16] and key management [17]. To overcome the disadvantages of symmetric cryptography, many asymmetric encryption algorithms have been proposed [1821] that use public and private keys for encryption and decryption, respectively. The study in [22] proposed an asymmetric cryptosystem based on phase-truncated Fourier transform. Through phase truncation in the Fourier transform, two random phase keys are used as the public key to generate asymmetric ciphertext as real values and stationary white noise. Deng and Zhao [23] combined the color components multiplied by three random phase keys into a grayscale image through convolution. They then encoded it into a real-valued grayscale ciphertext using an asymmetric cryptosystem. The decryption key is generated during the encryption process and is different from the encryption key. Rakheja et al. [24] proposed an asymmetric hybrid cipher scheme for coherent superposition and random decomposition in a hybrid multiresolution wavelet domain using a four-dimensional hyperchaotic structure. The parameters and preliminary conditions of the four-dimensional hyperchaotic structure together with the fractional order expand the key space and consequently provide the system with additional strength. Chen et al. [25] proposed a color image enhancement asymmetric cryptosystem based on equal modulus decomposition (EMD) and created an effective one-way trapdoor function through EMD. In addition, to improve the security, the red-green-blue (RGB) components of color images were confused by using a Baker map. Wang et al. [26] proposed a double-image encryption technology based on an asymmetric algorithm. During the nonlinear encryption process, the image is encoded as amplitude ciphertext, and two phase-only masks generated based on phase truncation are retained as the decryption key.

The RSA algorithm is a type of public key cryptosystem. Its security is based on the difficulty of decomposing large integers into prime factors. Therefore, it is widely used in the field of image encryption [27, 28]. Liu et al. [29] proposed a digital image watermarking model based on the scrambling algorithm logistic and RSA asymmetric encryption algorithm, which ensure the security of hidden data based on a large embedding amount, strong robustness, and high computing efficiency. The logistic and RSA encryption algorithms are applied to the watermark image, and the image is decomposed by discrete wavelet transform and singular value decomposition, and then the watermark is embedded into the low-frequency subband of the host. To enhance the strength of the cryptosystem and provide higher security, the scheme in [30] uses the RSA algorithm and public key to encrypt the plain image to generate a cipher image. It then re-encrypts the cipher image to perform double encryption through chaotic synchronization.

Different from the commonly used method of image Arnold scrambling, this study uses the generalized form of the Arnold formula to generate the key flow. The image is first XOR diffused. The row and column directions are confused, and then the image information is hidden again by point diffusion.

The remainder of this paper is organized as follows. Section 2 introduces the RSA algorithm and generalized Arnold map, and Section 3 describes the proposed image encryption and decryption process. Section 4 presents the experimental results, and Section 5 analyzes and tests the effects of the algorithm. Section 6 gives a conclusion.

Chaotic sequence is a kind of pseudorandom sequence with good performance, which has abundant sources, simple generation method, and an almost undecipherable encryption sequence and can be determined by mapping function, generation rules, and initial conditions. Because of the good characteristics of chaotic system, it has been widely used in the field of image encryption.

Chen et al. [31] proposed a new simple pixel-dependent swap-aliasing method, which can achieve considerable diffusion in the process of permutation. The self-correlation non-linear pixel-exchange aliasing method is used to generate completely different aliasing images, which speeds up the propagation process of the cryptosystem and reduces the time-consuming work of the diffusion part. Zhang [32] proposed an image encryption algorithm related to plaintext, which combined two diffusion operations and a transform related to plaintext to encrypt the image and used a hyperchaotic system to generate the key stream. Hua et al. [33] proposed an image encryption algorithm based on two-dimensional (2D) logic-sinusoidal coupling mapping (LSCM) and classic obfuscation-diffusion structure. The algorithm has better ergodicity, more complex behavior, and larger chaotic range. Chai et al. [34] proposed a color image encryption algorithm based four-wing hyperchaotic system and DNA sequence operation. The work proposed by Hua et al. [35] used the generated cosine transform chaotic map to further propose an image encryption scheme. The generated chaotic map exhibits more complicated chaotic behavior than the existing chaotic map.

In order to improve the robustness to common attacks, Yu et al. [36] proposed an image encryption algorithm based on phase-truncated short time fractional Fourier transform (PTSTFrFT) and hyperchaotic system. The feedback system is used to design the diffusion operation, which improves the anti-interference ability of the system. Due to the hyperchaotic system, the proposed image encryption algorithm has a sufficiently large key space and high sensitivity to the key. Huang et al. [37] proposed a nonlinear optics image encryption algorithm based on Logistic map. The phase truncation and the bitwise XOR operation, as non-linear processes, improve the robustness of the presented multiimage encryption scheme against the chosen-plaintext attack.

More scholars now combine chaotic systems with current popular technologies, such as compressed sensing, neural networks, electronic communications, and DNA coding. Compressed sensing can compress the image data information while sampling the image and then use the reconstruction algorithm to complete the restoration of the image information. For example, in [38], Liu et al. proposed an encryption algorithm in which the compressed image obtained using measurement matrix is scrambled with the Arnold cat map. The scrambled image is encrypted with double random phase encoding (DRPE). A novel image compression and encryption scheme was put forward based on wavelet packet transform and chaotic system, where logistic map was employed to generate the initial values of Chen’s chaotic system to control the confusion and diffusion of the input image [39]. Zhou et al. [40] proposed an efficient image compression and encryption scheme based on hyperchaos system and two-dimensional compressed sensing. The proposed cryptosystem reduces the amount of data transmitted and simplifies the nonlinear distribution of keys.

The DNA computing process has lots of good characteristics [41] such as massive parallelism, huge storage, and ultra-low-power consumption. Many researchers have combined the properties of chaos and DNA encoding techniques to enhance the security of images in all aspects [42, 43]. Chai et al. [44] combined the memory hyperchaotic system, cellular automata, and DNA sequence operations to develop an encryption system for grayscale images. The calculation of this system is relatively complicated, but it can resist known plaintext and select plaintext attacks. Wu et al. [45] proposed an image encryption procedure based on CML (Coupled Map Lattice) and DNA encryption. The method has an extended hamming distance calculation to improve the ability to resist plaintext attacks. In [46], the encryption scheme combines chaotic image encryption technology and DNA sequence manipulation technology. A new Mandelbrot set based conditional shift algorithm is introduced to apply confusion effectively on R, G, and B channels.

It can be seen that chaotic systems have been widely used in image encryption. However, many image encryption algorithms have defects in the specific process, such as the difficulty to exchange secre keys. Therefore, this paper combines a chaotic system with an asymmetric encryption algorithm and uses the generated key stream to scramble and diffuse the image to solve the exchange key problem.

3. Background

3.1. RSA Algorithm

RSA public key cryptography was first proposed by Rivest, Shamir, and Adleman. It is based on the Euler theorem of number theory, and the security is based on the difficulty of factoring large integers. RSA can be used for both encryption and digital signatures and is secure, easy to understand, and easy to implement. The RSA algorithm encryption and decryption processes are given by Algorithm 1.

Input: choose different large primes ;
(1)
(2)
(3) Random selection , , and
(4) Calculating the private key , ,
(5) Encryption method: for each plaintext grouping , perform encryption operation, namely,
(6) Decryption method: the decryption operation of the ciphertext packet is:

The algorithm is asymmetric because different keys are used during encryption and decryption. The plaintext data are encrypted using the public key, and the receiver decrypts the ciphertext with its own private key to obtain the plaintext data. The private key is only known to the receiver, which reduces the transmission of the key in the channel.

3.2. Generalized Arnold Map

The Arnold map is a type of nonlinear map commonly known as a “cat map,” which is defined as follows:where is the position of the pixel before the exchange and is the position of the transformed pixel. The pixel scrambling algorithm based on Arnold mapping is shown in Algorithm 2.

Input: (plain image), , ;
Output: (confused image)
(1) Read the image and get its size ;
(2) Let and be a zero image with the same size of ;
(3) For each row and column , do:
(4) ;
(5) ;
(6) ;
(7) Return

After stretching, the Arnold map is referred to as a generalized Arnold map, which is defined as

The chaotic sequences and generated by (2) are nonperiodic, nonconvergent, and pseudorandom [47] and are given by parameters , , , and . The largest Lyapunov characteristic exponent of the map is . That is to say, the map is always in chaotic for parameters. For example, Figure 1 shows its chaotic behavior when , , , and .

In order to further test the properties of chaotic sequences, when parameter , , and , the system parameters are unchanged; change the initial value or by 0.000001 to obtain two chaotic sequences. In the experiment, the first 50 sequence values of chaotic sequences are selected for comparison, and the comparison results are shown in Figure 2. The solid line represents the chaotic sequence value when the initial value has not changed, and the dashed line represents the chaotic sequence value after the initial value has changed slightly by 0.000001. The experimental results show that the chaotic sequence generated by the chaotic system has very sensitive.

4. Proposed Image Encryption Scheme

4.1. Image Encryption Process

This study implements a new asymmetric image encryption scheme using the generalized Arnold map, RSA algorithm, and confusion and diffusion technology. Algorithm 3 is the pseudocode of our image encryption algorithm. The flow of image encryption is presented in Figure 3, where the specific encryption process is described as follows:Step 1: select prime numbers and , and calculate , Step 2: generate private key and public key using the RSA algorithmStep 3: four positive integers (, , , and ) are randomly selected as confidential information, and equation (3) is used to calculate Step 4: public ciphertext is calculated using public key , and then equation (4) is used to calculate the parameter pairs and of the Arnold map:Step 5: substitute parameters , , , and into the generalized Arnold map equation to generate chaotic sequences and , and convert the generated values into the range of 0 to 255:Step 6: record the plain image as and perform the following XOR diffusion operation with the generated key stream to obtain image :where , , and represent the elements of , , and .Step 7: transform into a matrix. Then, take the first row and first column of the image matrix and conduct cyclic scrambling of the row and column directions of image to obtain image Step 8: image and chaotic sequence are used to perform an additive mode diffusion operation to obtain image aswhere , , and represent the elements of , , and .Step 9: after two rounds of calculation, the final encrypted image is obtained.

Input: original image , secret keys
Read the image size
Calculate the for Arnold map by equations (3) and (4) together with RSA and
Generate the key streams and by equation (2)
Take a row and a column from and sort them, then get and
; //perform XOR diffusion operations
for
; //confusion on the row direction
end
for
; //confusion on the column direction
end
; //perform additive mode diffusion operations
Output: encryption image

As to the color image, it can be treated as three gray images by three channels R, G, and B. So, the encryption is the same for each channel.

4.2. Image Decryption Process

Image decryption is the reverse process of encryption, Algorithm 4 is the pseudocode of image decryption algorithm, and its steps involve the following.Step 1: public ciphertext information is decrypted with private key , that is, . Then, parameter pairs and of the Arnold map are generated according to (3) and (4).Step 2: when the two pairs of parameters are substituted into the generalized Arnold map equation, the chaotic sequences and are generated, and the generated values are transformed into the range from 0 to 255:Step 3: the cipher image and chaotic sequence are added to obtain the image using the operation of adding modulus inverse diffusion, described bywhere , , and represent the elements of , , and .Step 4: transform into a matrix. Then, take the first row and first column of the image matrix to perform the cyclic confusion of the rows and columns of image to obtain image .Step 5: perform the XOR diffusion operation with image and to obtain image , described bywhere , , and represent the elements of , , and .Step 6: plain image is obtained after two rounds of the decryption operation.

Input: encryption image , public information
Read the image size
Use private key to decrypt to get
Calculate the for Arnold map by equations (3) and (4)
Generate the key stream and by equation (2)
Take a row and a column from and sort them, then get and
; //the inverse operation of additive mode diffusion
for
; //confusion decryption on the row direction
end
for
; //confusion decryption on the column direction
end
; //perform XOR diffusion operations
Output: original image

5. Experimental Results

This paper selects some different images from the USC-SIPI and Kodak databases. The Windows 10 operating system was used with the MATLAB R2017b software. An AMD Ryzen 7 1700 eight-core processor was used, and 8 GB of RAM was required to simulate the work. For the experimental process, the private key consisted of large prime numbers , , and . Positive integers were separately selected as , , , and . The public key consisted of , , , , and . The obtained results were as follows: , , , and . The results for the test image encryption and decryption are shown in Figure 4 with two rounds. The encrypted image in Figures 4(i)4(p) reveals that no information could be retrieved from it. The decrypted image (Figures 4(q)4(x)) also shows that the plain image information could be correctly decrypted and restored. This proves that the proposed cryptosystem provides good encryption results and is effective for digital images. Table 1 shows the time cost used by different size image. It can be seen that the result is slightly big due to the RSA algorithm. However, it can also be accepted.

6. Analysis of Encryption Effects

6.1. Histogram Analysis

A histogram is used to display the distribution of pixel intensity in an image. An ideal encrypted image typically has a uniform frequency distribution and will provide no useful statistical information to the attacker. Figure 5 shows the histogram distribution of some test images before and after encryption, showing the uniformity of gray values in the results. Simultaneously, a chi-squared test can be used to evaluate the uniformity of the histogram, which is calculated aswhere is the intensity level and and are the observed and expected values for each pixel in the encrypted image, respectively. The uniformity of histogram is assessed with the help of the chi-squared test. Table 2 shows the histogram uniformity results of the test images based on the test, in which the color images take the average values of three channels. From Table 2, all test images have passed chi-squared detection, proving the uniformity of histogram. Hence, it is evident that the redundancy of plain images is concealed which confirmed the failure of statistical attack [48].

6.2. Correlation Coefficient

The correlation coefficient is a linear correlation between adjacent pixels in an image. When the two-dimensionality of the image is considered, the correlation is derived from the horizontal, vertical, and diagonal directions. Secure encryption schemes should reduce the correlation between adjacent encrypted image pixels to prevent statistical analysis attacks. To evaluate the correlation between two pixels, the adjacent pixel pairs in three directions are randomly selected from the normal and encrypted images for calculation. The calculation formula is defined aswhere is the correlation coefficient, and are the gray values of two adjacent pixels, and is the total logarithm of . The correlation coefficient value is between −1 and +1. For an effective encryption algorithm, the correlation coefficient value of the encrypted image should be close to 0 [49]. The correlation coefficient between the original image (Boat) and the corresponding encrypted image is shown in Figure 6. Table 3 calculates the correlation coefficients of some images in test images from horizontal, vertical, and diagonal directions. For color images, it is necessary to consider three different channels. Table 4 takes peppers image as an example to analyze the correlation coefficient between the original image and the encrypted image. Table 5 compares the correlation coefficient results of man images in different encryption algorithms. The test results show that the proposed scheme breaks the strong correlation in the original image and can effectively resist attacks.

6.3. Information Entropy

In information theory, entropy information can be defined as the uncertainty of the information content. This can then be used to measure the randomness of data sequences. It can be defined aswhere is the probability of and is the number of bits of . For digital images with 28 grayscale levels, the maximum information entropy is 8. The higher the entropy value of the encrypted image, the more uniform is the pixel value distribution. Among them, local Shannon entropy measures image randomness by calculating the sample mean of Shannon entropy on multiple non-overlapping and randomly selected image blocks, so it can overcome the shortcomings of global information entropy such as inaccuracy, inconsistency, and low efficiency [50]. Table 6 shows the information entropy of the test image and the local entropy of the encrypted image. The information entropy value of color image is calculated as the average information entropy value of three channels. The results reveal that the entropy values of test images were close to the ideal values.

6.4. Differential Attack Analysis

Difference analysis evaluates the degree of sensitivity to ordinary images, where the number of pixels change rate (NPCR) and the unified average changing intensity (UACI) are two common indicators of attack resistance [5153]. NPCR measures the rate of change of pixel values in a cipher image by changing one pixel value of the original image. The higher the value of UACI, the more sensitive is the cipher to changes in the plain image. Therefore, it has stronger resistance to a differential attack. It can be defined aswhere is the width of the image, is the height, and is the maximum allowable pixel value of the image. Here, is the encrypted image and is the encrypted image modified after one pixel value of the original image is changed. Table 7 shows the average NPCR and UACI values of the some test images. Table 8 lists the results of NPCR and UACI when the pixel values at different positions of the common image are changed. All values of NPCR and UACI of our method are close to ideal values 99.6094% and 33.4635%, respectively.

6.5. Key Sensitivity Analysis

To resist violent attacks, a password system should be highly sensitive. In this system, a slightly different key is used to encrypt the original image using the same encryption algorithm, with the remaining keys being unchanged. Key sensitivity tests were conducted as follows.

Suppose the initial set of keys used in the proposed cryptosystem is recorded as keys 1, denoted aswhere the values of represent the private key (i.e., the secret information) and represent the public key.

The initial key set keys 1 is used to encrypt the original image (boat) to obtain an encrypted image. Figure 7(a) shows the “boat” image, and Figure 7(b) shows an encrypted image. Suppose a value in keys 1 changes slightly, then keys 2 is expressed as

The original image is encrypted with keys 2 using the same encryption algorithm to obtain the other encrypted image shown in Figure 7(c). Figure 7(d) is a difference image of Figures 7(b) and 7(c). When the wrong decryption key keys 2 is used to decrypt the image in Figure 7(b), the decryption result is obtained as shown in Figure 7(e). Figure 7(f) shows the correct decrypted image. The calculated NPCR and UACI values between the two encrypted images shown in Figures 7(b) and 7(c) were 99.60289% and 33.43695%, respectively. This indicates that more than 99% of the pixels could be changed with just a single key change. It can be concluded that the proposed algorithm is highly sensitive to the key.

6.6. Security Analysis

Currently, two main methods are used to crack a password. One method involves an exhaustive search of the key. The cracking method attempts all possible key combinations. Because the RSA algorithm uses exponential calculations in both the encryption and decryption processes, its computational workload is huge, and deciphering using an exhaustive search is impossible. Therefore, cryptographic analysis is the only means of deciphering the encrypted information of the RSA algorithm. However, cracking RSA cryptography requires factorization of large integers. Although cracking low-order keys is possible, the factorization time increases exponentially with an increase in key length. As long as the length of meets certain requirements and appropriate parameters are selected, the algorithm based on RSA is safe.

6.7. Comparison

In this section, we make the comparison with color images by information entropy [5456]. Table 9 shows the results. Therefore, the proposed method has good performance.

7. Conclusions

This study combined the Arnold map with the RSA public key encryption algorithm and proposed a new asymmetric image encryption scheme that considers the difficulty of large integer factorization to ensure its security. The initial parameters of the generalized Arnold map were generated by the RSA algorithm. Our study described the process whereby after the encryption operation by diffusion-confusion-diffusion is completed, the cipher image is formed from the plain image to achieve three layers of information hiding. The key used in the image encryption scheme is produced by the RSA algorithm to enhance the security of image transmission. Fortunately, the implementation process of this algorithm is simple and efficient. In addition, experimental results and tests show that the proposed asymmetric image encryption scheme is secure and effective and has high key sensitivity and good antiattack capabilities.

Data Availability

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare no conflict of interest.

Acknowledgments

This work was supported in part by the National Natural Science Foundations of China (nos. 61702116 and 61972103), the Natural Science Foundation of Guangdong Province of China (no. 2019A1515011361), the Project of Enhancing School with Innovation of Guangdong Ocean University of China (no. Q18306), and the Postgraduate Education Innovation Project of Guangdong Ocean University of China (no. 202031).