# Image Encryption Scheme Based on a Generalized Arnold Map and RSA Algorithm

Authors: Kaixin Jiao; Guodong Ye; Youxia Dong; Xiaoling Huang; Jianqing He
Journal: Security and Communication Networks
 (2020)

---

## 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.


---

## Body

## 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 [4–6], compressed sensing [7–10], 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 [18–21] 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. Section2 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.


## 2. Related Works

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 Algorithm1.Algorithm 1: RSA encryption and decryption algorithm.
Input: choose different large primesp; q(1)φn=p−1q−1(2)n=p×q(3) Random selectione, 1<e<φn, and gcdφn,e=1(4) Calculating the private keyd, d⋅e=1modφn, d=e−1modφn(5) Encryption method: for each plaintext groupingm, perform encryption operation, namely, c=memodn(6) Decryption method: the decryption operation of the ciphertext packet is:m=cdmodnThe 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:(1)xi+1yi+1=1baab+1xiyimodN,where xi,yi is the position of the pixel before the exchange and xi+1,yi+1 is the position of the transformed pixel. The pixel scrambling algorithm based on Arnold mapping is shown in Algorithm 2.Algorithm 2: Arnold confusion algorithm.
Input:P (plain image), a, b;Output:C (confused image)(1) Read the imageP and get its size N×N;(2) Letimg=P and C be a zero image with the same size of P;(3) For each rowx and column y, do:(4)X=x+bymodN+1;(5)Y=ax+ab+1ymodN+1;(6)CX,Y=imgx,y;(7) ReturnAfter stretching, the Arnold map is referred to as a generalized Arnold map, which is defined as(2)xi+1=xi+byimod1,yi+1=axi+ab+1yimod1.The chaotic sequencesxkk=0∞ and ykk=0∞ generated by (2) are nonperiodic, nonconvergent, and pseudorandom [47] and are given by parameters a, b, x0, and y0. The largest Lyapunov characteristic exponent of the map is λ=1+ab+a2b2+4ab/2>1. That is to say, the map is always in chaotic for parameters. For example, Figure 1 shows its chaotic behavior when a=1, b=1, x0=0.3044, and y0=0.2691.Figure 1
Chaotic sequence: (a)x value; (b) y value.
(a)(b)In order to further test the properties of chaotic sequences, when parametera=4b=8, x0=0.5, and y0=0.9, the system parameters are unchanged; change the initial value x0 or y0 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.Figure 2
Difference diagram of chaotic sequence. (a) The solid line:x0=0.5; the dashed line: x0=0.500001. (b) The solid line: y0=0.9; the dashed line: x0=0.900001.
(a)(b)


## 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 Algorithm1.Algorithm 1: RSA encryption and decryption algorithm.
Input: choose different large primesp; q(1)φn=p−1q−1(2)n=p×q(3) Random selectione, 1<e<φn, and gcdφn,e=1(4) Calculating the private keyd, d⋅e=1modφn, d=e−1modφn(5) Encryption method: for each plaintext groupingm, perform encryption operation, namely, c=memodn(6) Decryption method: the decryption operation of the ciphertext packet is:m=cdmodnThe 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:(1)xi+1yi+1=1baab+1xiyimodN,where xi,yi is the position of the pixel before the exchange and xi+1,yi+1 is the position of the transformed pixel. The pixel scrambling algorithm based on Arnold mapping is shown in Algorithm 2.Algorithm 2: Arnold confusion algorithm.
Input:P (plain image), a, b;Output:C (confused image)(1) Read the imageP and get its size N×N;(2) Letimg=P and C be a zero image with the same size of P;(3) For each rowx and column y, do:(4)X=x+bymodN+1;(5)Y=ax+ab+1ymodN+1;(6)CX,Y=imgx,y;(7) ReturnAfter stretching, the Arnold map is referred to as a generalized Arnold map, which is defined as(2)xi+1=xi+byimod1,yi+1=axi+ab+1yimod1.The chaotic sequencesxkk=0∞ and ykk=0∞ generated by (2) are nonperiodic, nonconvergent, and pseudorandom [47] and are given by parameters a, b, x0, and y0. The largest Lyapunov characteristic exponent of the map is λ=1+ab+a2b2+4ab/2>1. That is to say, the map is always in chaotic for parameters. For example, Figure 1 shows its chaotic behavior when a=1, b=1, x0=0.3044, and y0=0.2691.Figure 1
Chaotic sequence: (a)x value; (b) y value.
(a)(b)In order to further test the properties of chaotic sequences, when parametera=4b=8, x0=0.5, and y0=0.9, the system parameters are unchanged; change the initial value x0 or y0 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.Figure 2
Difference diagram of chaotic sequence. (a) The solid line:x0=0.5; the dashed line: x0=0.500001. (b) The solid line: y0=0.9; the dashed line: x0=0.900001.
(a)(b)


## 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. Algorithm3 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 numbersp and q, and calculate n=p×q, φn=p−1q−1Step 2: generate private keyd and public key e using the RSA algorithmStep 3: four positive integers (x01, x02, x03, and x04) are randomly selected as confidential information, and equation (3) is used to calculate y0i,i=1,2,3,4Step 4: public ciphertextci=y0iemodn,i=1,2,3,4 is calculated using public key e, and then equation (4) is used to calculate the parameter pairs a and b of the Arnold map:(3)y01=x01+x02,y02=x02+x03,y03=x03+x04,y04=x01+x04,(4)a1=fixx01+sqrtlogc1+y01,b1=fixx+02sqrtlogc2+y02,a2=fixx03+sqrtlogc3+y03,b2=fixx04+sqrtlogc4+y04.Step 5: substitute parametersa1, b1, a2, and b2 into the generalized Arnold map equation to generate chaotic sequences s and r, and convert the generated values into the range of 0 to 255:(5)S=modfloors+100×1014,256,R=modfloorr+100×1014,256.Step 6: record the plain image asP and perform the following XOR diffusion operation with the generated key stream S to obtain image A:(6)Ai=Ai−1⊕Pi⊕Si,whereAi, Pi, and Si represent the elements of A, P, and S.Step 7: transformS into a matrix. Then, take the first row and first column of the image matrix S and conduct cyclic scrambling of the row and column directions of image A to obtain image BStep 8: imageB and chaotic sequence R are used to perform an additive mode diffusion operation to obtain image C as(7)Ci=Ci−1+Bi+Rimod256,whereCi, Bi, and Ri represent the elements of C, B, and R.Step 9: after two rounds of calculation, the final encrypted imageE is obtained.Algorithm 3: Pseudocode of image encryption.
Input: original image P, secret keys x01,x02,x03,x04Read the image sizeM×NCalculate thea,b for Arnold map by equations (3) and (4) together with RSA and x01,x02,x03,x04Generate the key streamsS and R by equation (2)Take a row and a column fromS and sort them, then get X and YB=P⊕S; //perform XOR diffusion operationsfori=1:MDXi,:=Bi,:; //confusion on the row directionendfori=1:NE:,Yi=D:,i; //confusion on the column directionendC=modE+R,256; //perform additive mode diffusion operationsOutput: encryption image CFigure 3
Flow of the proposed image encryption algorithm.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, Algorithm4 is the pseudocode of image decryption algorithm, and its steps involve the following.Step 1: public ciphertext informationci,i=1,2,3,4 is decrypted with private key d, that is, y0i=cidmodn,i=1,2,3,4. Then, parameter pairs a and b 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 sequencess′ and r′ are generated, and the generated values are transformed into the range from 0 to 255:(8)S′=modfloors′+100×1014,256,R′=modfloorr′+100×1014,256.Step 3: the cipher imageE and chaotic sequence R′ are added to obtain the image C′ using the operation of adding modulus inverse diffusion, described by(9)Ci′=2×256+Ei−Ei−1−Ri′mod256,whereCi′, Ei′, and Ri′ represent the elements of C′, E′, and R′.Step 4: transformS′ 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 C′ to obtain image B′.Step 5: perform the XOR diffusion operation with imageB′ and S′ to obtain image A′, described by(10)Ai′=Bi−1′⊕Bi′⊕Si′,whereAi′, Bi′, and Si′ represent the elements of A′, B′, and S′.Step 6: plain imageP′ is obtained after two rounds of the decryption operation.Algorithm 4: Pseudocode of image decryption.
Input: encryption image C, public information ci,i=1,2,3,4Read the image sizeM×NUse private keyd to decrypt to get y0i,i=1,2,3,4Calculate thea,b for Arnold map by equations (3) and (4)Generate the key streamS′ and R′ by equation (2)Take a row and a column fromS′ and sort them, then get X′ and Y′C′=mod2×256+E−R′; //the inverse operation of additive mode diffusionfori=1:ME′i,:=C′X′i:; //confusion decryption on the row directionendfori=1:NB′:,i=E:,Y′i; //confusion decryption on the column directionendA′=B′⊕S′; //perform XOR diffusion operationsOutput: original image A′


## 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. Algorithm3 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 numbersp and q, and calculate n=p×q, φn=p−1q−1Step 2: generate private keyd and public key e using the RSA algorithmStep 3: four positive integers (x01, x02, x03, and x04) are randomly selected as confidential information, and equation (3) is used to calculate y0i,i=1,2,3,4Step 4: public ciphertextci=y0iemodn,i=1,2,3,4 is calculated using public key e, and then equation (4) is used to calculate the parameter pairs a and b of the Arnold map:(3)y01=x01+x02,y02=x02+x03,y03=x03+x04,y04=x01+x04,(4)a1=fixx01+sqrtlogc1+y01,b1=fixx+02sqrtlogc2+y02,a2=fixx03+sqrtlogc3+y03,b2=fixx04+sqrtlogc4+y04.Step 5: substitute parametersa1, b1, a2, and b2 into the generalized Arnold map equation to generate chaotic sequences s and r, and convert the generated values into the range of 0 to 255:(5)S=modfloors+100×1014,256,R=modfloorr+100×1014,256.Step 6: record the plain image asP and perform the following XOR diffusion operation with the generated key stream S to obtain image A:(6)Ai=Ai−1⊕Pi⊕Si,whereAi, Pi, and Si represent the elements of A, P, and S.Step 7: transformS into a matrix. Then, take the first row and first column of the image matrix S and conduct cyclic scrambling of the row and column directions of image A to obtain image BStep 8: imageB and chaotic sequence R are used to perform an additive mode diffusion operation to obtain image C as(7)Ci=Ci−1+Bi+Rimod256,whereCi, Bi, and Ri represent the elements of C, B, and R.Step 9: after two rounds of calculation, the final encrypted imageE is obtained.Algorithm 3: Pseudocode of image encryption.
Input: original image P, secret keys x01,x02,x03,x04Read the image sizeM×NCalculate thea,b for Arnold map by equations (3) and (4) together with RSA and x01,x02,x03,x04Generate the key streamsS and R by equation (2)Take a row and a column fromS and sort them, then get X and YB=P⊕S; //perform XOR diffusion operationsfori=1:MDXi,:=Bi,:; //confusion on the row directionendfori=1:NE:,Yi=D:,i; //confusion on the column directionendC=modE+R,256; //perform additive mode diffusion operationsOutput: encryption image CFigure 3
Flow of the proposed image encryption algorithm.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, Algorithm4 is the pseudocode of image decryption algorithm, and its steps involve the following.Step 1: public ciphertext informationci,i=1,2,3,4 is decrypted with private key d, that is, y0i=cidmodn,i=1,2,3,4. Then, parameter pairs a and b 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 sequencess′ and r′ are generated, and the generated values are transformed into the range from 0 to 255:(8)S′=modfloors′+100×1014,256,R′=modfloorr′+100×1014,256.Step 3: the cipher imageE and chaotic sequence R′ are added to obtain the image C′ using the operation of adding modulus inverse diffusion, described by(9)Ci′=2×256+Ei−Ei−1−Ri′mod256,whereCi′, Ei′, and Ri′ represent the elements of C′, E′, and R′.Step 4: transformS′ 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 C′ to obtain image B′.Step 5: perform the XOR diffusion operation with imageB′ and S′ to obtain image A′, described by(10)Ai′=Bi−1′⊕Bi′⊕Si′,whereAi′, Bi′, and Si′ represent the elements of A′, B′, and S′.Step 6: plain imageP′ is obtained after two rounds of the decryption operation.Algorithm 4: Pseudocode of image decryption.
Input: encryption image C, public information ci,i=1,2,3,4Read the image sizeM×NUse private keyd to decrypt to get y0i,i=1,2,3,4Calculate thea,b for Arnold map by equations (3) and (4)Generate the key streamS′ and R′ by equation (2)Take a row and a column fromS′ and sort them, then get X′ and Y′C′=mod2×256+E−R′; //the inverse operation of additive mode diffusionfori=1:ME′i,:=C′X′i:; //confusion decryption on the row directionendfori=1:NB′:,i=E:,Y′i; //confusion decryption on the column directionendA′=B′⊕S′; //perform XOR diffusion operationsOutput: original image A′


## 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 numbersp=911, q=997, and d=147547. Positive integers were separately selected as x01=3, x02=5, x03=7, and x04=11. The public key consisted of e=43, c1=525020, c2=518815, c3=745188, and c4=658943. The obtained results were as follows: a1=6, b1=8, a2=10, and b2=18. 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.Figure 4
Results of the test images. Plain images of (a) boat; (b) man; (c) male; (d) peppers; (e) sailboat; (f) bird; (g) woman; (h) landscape. Encrypted images of (i) boat; (j) man; (k) male; (l) peppers; (m) sailboat; (n) bird; (o) woman; (p) landscape. Decrypted images of (q) boat; (r) man; (s) male; (t) peppers; (u) sailboat; (v) bird; (w) woman; (x) landscape.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)Table 1
Time cost analysis.
ImageKey stream generationConfusion-diffusionOne roundTime (s)Time (s)Time (s)Boat (512∗512)0.2562260.2415990.241728Male (1024∗1024)0.5508682.2272012.227410


## 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. Figure5 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 as(11)χ2=∑L=0255O−E2E,where L is the intensity level and O and E 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 χ2 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].Figure 5
Histogram test: (a) plain image of boat; (b) histogram of the plain image boat; (c) cipher image of boat; (d) histogram of the cipher image boat; (e) plain image of male; (f) histogram of the plain image male; (g) cipher image of male; (h) histogram of the cipher image male; (i) plain image of landscape; (j) histogram of the plain image landscape; (k) cipher image of landscape; (l) histogram of the cipher image landscape.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)Table 2
Histogram uniformity evaluation based on theχ2 test.
ImagePlain-imageCipher-imageResultBoat383969.6875239.3281PassMan392972.1914241.9551PassMale709340.6801257.8115PassPeppers340999.4414267.2064PassSailboat223807.8535256.8639PassBird871600.3639251.2643PassWoman263568.7500259.0684PassLandscape710898.8340239.4194Pass


### 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 as(12)rxy=covx,yDxDy,(13)covx,y=1N∑i=1Nxi−Exyi−Ey,(14)Ex=1N∑i=1Nxi,(15)Dx=1N∑i=1Nxi−Ex2,where rxy is the correlation coefficient, x and y are the gray values of two adjacent pixels, and N is the total logarithm of xi,yi. 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.Figure 6
Correlation of two adjacent pixels in a plain image of512×512 Boat in (a) horizontal; (b) vertical; and (c) diagonal directions. Correlation of two adjacent pixels in the cipher image: (d) horizontal; (e) vertical; and (f) diagonal directions.
(a)(b)(c)(d)(e)(f)Table 3
Correlation coefficients of different test images.
ImagePlain-imageCipher-imageHorizontalVerticalDiagonalHorizontalVerticalDiagonalBoat0.93790.93830.87900.01460.00260.0013Man0.99110.98500.93620.0065−0.0046−0.0017Male0.91820.93040.8746−0.00680.0163−0.0017Landscape0.57780.63790.5558−0.00350.0013−0.0053Table 4
Coefficient correlation between the color peppers.
Plain-imageCipher-imageRGBRGBHorizontal0.96560.98030.9686−0.0143−0.00610.0052Vertical0.96490.97990.96830.00170.0063−0.0027Diagonal0.95820.96800.94780.0134−0.00850.0070Table 5
Comparison of correlation coefficients of man image.
AlgorithmImageCipher-imageHorizontalVerticalDiagonalMan0.99110.98500.9362ProposedEncrypted man0.0065−0.0046−0.0017Ref. [5]Encrypted man0.01980.01320.0032Ref. [10]Encrypted man0.06850.08210.0821


### 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 as(16)Hm=∑i=02n−1pmilog21pmi,where pmi is the probability of mi and n is the number of bits of mi. 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.Table 6
The information entropy and local entropy of test images.
ImagePlain-imageCipher-imageLocal shannonBoat7.191377.999347.95559Man7.109047.999337.95658Male7.523747.999827.95709Peppers7.297807.999277.95268Sailboat7.389637.999297.95583Bird6.737467.999317.95701Woman7.241857.999297.95257Landscape7.453197.999847.95436


### 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 [51–53]. 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 as(17)NPCRC1,C2=∑i=1M∑j=1NDi,jM×N×100%,(18)Di,j=0,ifC1i,j=C2i,j,1,ifC1i,j≠C2i,j,(19)UACIC1,C2=∑i=1M∑j=1NC1i,j−C2i,jM×N×T×100%,where M is the width of the image, N is the height, and T is the maximum allowable pixel value of the image. Here, C1 is the encrypted image and C2 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.Table 7
Average NPCR and UACI of test images.
ImageNPCR (%)UACI (%)Boat99.609433.4910Man99.632333.3144Male99.653833.4650Landscape99.662833.3265Table 8
Boat image sensitivity test in different position pixels.
Pixels(1, 1)(27, 103)(144, 178)(201, 224)(217, 105)(255, 255)NPCR (%)99.612099.517899.634999.618999.573599.4587UACI (%)33.434533.438333.491033.435133.407933.4939


### 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 as(20)keys1=p,q,e,d,x01,x02,x03,x04,x′,y′,x1′,y1′,where the values of p,q,d,x01,x02,x03,x04 represent the private key (i.e., the secret information) and e,x′,y′,x1′,y1′ represent the public key.The initial key set keys 1 is used to encrypt the original image (boat) to obtain an encrypted image. Figure7(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(21)keys2=p,q,e,d,x01−1,x02,x03,x04,x′,y′,x1′,y1′.Figure 7
Key sensitivity analysis: (a) original image; (b) encrypted image using keys 1; (c) encrypted image using keys 2; (d) difference image of (b) and (c); (e) decrypted image using wrong keys 2; (f) decrypted image using correct key.
(a)(b)(c)(d)(e)(f)The original image is encrypted with keys 2 using the same encryption algorithm to obtain the other encrypted image shown in Figure7(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 ofn 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 [54–56]. Table 9 shows the results. Therefore, the proposed method has good performance.Table 9
Information entropy comparison with color Peppers images.
MethodsRGBProposed method7.99937.99927.9993Ref. [54]7.99897.99917.9989Ref. [55]7.99717.99757.9974


## 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. Figure5 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 as(11)χ2=∑L=0255O−E2E,where L is the intensity level and O and E 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 χ2 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].Figure 5
Histogram test: (a) plain image of boat; (b) histogram of the plain image boat; (c) cipher image of boat; (d) histogram of the cipher image boat; (e) plain image of male; (f) histogram of the plain image male; (g) cipher image of male; (h) histogram of the cipher image male; (i) plain image of landscape; (j) histogram of the plain image landscape; (k) cipher image of landscape; (l) histogram of the cipher image landscape.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)Table 2
Histogram uniformity evaluation based on theχ2 test.
ImagePlain-imageCipher-imageResultBoat383969.6875239.3281PassMan392972.1914241.9551PassMale709340.6801257.8115PassPeppers340999.4414267.2064PassSailboat223807.8535256.8639PassBird871600.3639251.2643PassWoman263568.7500259.0684PassLandscape710898.8340239.4194Pass


## 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 as(12)rxy=covx,yDxDy,(13)covx,y=1N∑i=1Nxi−Exyi−Ey,(14)Ex=1N∑i=1Nxi,(15)Dx=1N∑i=1Nxi−Ex2,where rxy is the correlation coefficient, x and y are the gray values of two adjacent pixels, and N is the total logarithm of xi,yi. 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.Figure 6
Correlation of two adjacent pixels in a plain image of512×512 Boat in (a) horizontal; (b) vertical; and (c) diagonal directions. Correlation of two adjacent pixels in the cipher image: (d) horizontal; (e) vertical; and (f) diagonal directions.
(a)(b)(c)(d)(e)(f)Table 3
Correlation coefficients of different test images.
ImagePlain-imageCipher-imageHorizontalVerticalDiagonalHorizontalVerticalDiagonalBoat0.93790.93830.87900.01460.00260.0013Man0.99110.98500.93620.0065−0.0046−0.0017Male0.91820.93040.8746−0.00680.0163−0.0017Landscape0.57780.63790.5558−0.00350.0013−0.0053Table 4
Coefficient correlation between the color peppers.
Plain-imageCipher-imageRGBRGBHorizontal0.96560.98030.9686−0.0143−0.00610.0052Vertical0.96490.97990.96830.00170.0063−0.0027Diagonal0.95820.96800.94780.0134−0.00850.0070Table 5
Comparison of correlation coefficients of man image.
AlgorithmImageCipher-imageHorizontalVerticalDiagonalMan0.99110.98500.9362ProposedEncrypted man0.0065−0.0046−0.0017Ref. [5]Encrypted man0.01980.01320.0032Ref. [10]Encrypted man0.06850.08210.0821


## 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 as(16)Hm=∑i=02n−1pmilog21pmi,where pmi is the probability of mi and n is the number of bits of mi. 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.Table 6
The information entropy and local entropy of test images.
ImagePlain-imageCipher-imageLocal shannonBoat7.191377.999347.95559Man7.109047.999337.95658Male7.523747.999827.95709Peppers7.297807.999277.95268Sailboat7.389637.999297.95583Bird6.737467.999317.95701Woman7.241857.999297.95257Landscape7.453197.999847.95436


## 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 [51–53]. 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 as(17)NPCRC1,C2=∑i=1M∑j=1NDi,jM×N×100%,(18)Di,j=0,ifC1i,j=C2i,j,1,ifC1i,j≠C2i,j,(19)UACIC1,C2=∑i=1M∑j=1NC1i,j−C2i,jM×N×T×100%,where M is the width of the image, N is the height, and T is the maximum allowable pixel value of the image. Here, C1 is the encrypted image and C2 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.Table 7
Average NPCR and UACI of test images.
ImageNPCR (%)UACI (%)Boat99.609433.4910Man99.632333.3144Male99.653833.4650Landscape99.662833.3265Table 8
Boat image sensitivity test in different position pixels.
Pixels(1, 1)(27, 103)(144, 178)(201, 224)(217, 105)(255, 255)NPCR (%)99.612099.517899.634999.618999.573599.4587UACI (%)33.434533.438333.491033.435133.407933.4939


## 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 as(20)keys1=p,q,e,d,x01,x02,x03,x04,x′,y′,x1′,y1′,where the values of p,q,d,x01,x02,x03,x04 represent the private key (i.e., the secret information) and e,x′,y′,x1′,y1′ represent the public key.The initial key set keys 1 is used to encrypt the original image (boat) to obtain an encrypted image. Figure7(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(21)keys2=p,q,e,d,x01−1,x02,x03,x04,x′,y′,x1′,y1′.Figure 7
Key sensitivity analysis: (a) original image; (b) encrypted image using keys 1; (c) encrypted image using keys 2; (d) difference image of (b) and (c); (e) decrypted image using wrong keys 2; (f) decrypted image using correct key.
(a)(b)(c)(d)(e)(f)The original image is encrypted with keys 2 using the same encryption algorithm to obtain the other encrypted image shown in Figure7(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 ofn 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 [54–56]. Table 9 shows the results. Therefore, the proposed method has good performance.Table 9
Information entropy comparison with color Peppers images.
MethodsRGBProposed method7.99937.99927.9993Ref. [54]7.99897.99917.9989Ref. [55]7.99717.99757.9974


## 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.



---

*Source: 9721675-2020-06-04.xml*