# Efficient Encryption System for Numerical Image Safe Transmission

Authors: Mohamed Gafsi; Mohamed Ali Hajjaji; Jihene Malek; Abdellatif Mtibaa
Journal: Journal of Electrical and Computer Engineering
 (2020)

---

## Abstract

In this paper, we propose an efficient cryptosystem for digital image encryption and authentication. The cryptosystem is a hybrid scheme that uses symmetric and asymmetric approaches. The first one is used to encrypt the host image by utilizing a chaos-based key generator. The second one is used to encrypt the initial secret key and the owner’s signature that permit authentication. The algorithm is evaluated and validated by its application on several types of standard images and tools such as the statistical analysis, the key, and the performance analysis. The results indicate that the proposed cryptosystem provides high performance and enhanced security. The NIST 800-22 is used for testing the pseudorandom numbers generation (PRNG). The obtained simulation results are better than those cited in the recent works in terms of execution time and security level and low computational complexity.


---

## Body

## 1. Introduction

Our life today has voracious requirements for advanced technology that can easily store, find, transfer, process, serve, and communicate data and information around the world. The liberty of access to the public networks by anyone has increased the shrewdness of spying, hacking, falsification, illegal copy, and utilization of digital multimedia documents, intellectual property, personal identities, and sensitive information such as images. Secret image protection has lately become an important issue. A large manner of image protection is achieved using cryptography. Cryptography enables data confidentiality by encryption, which transforms it from the plain or ordinary form into an unintelligible form to others who have no right to read, take, modify, use, or copy it. Thereby, the data can be shared through an insecure network.Generally, there are two encryption schemes: symmetric and asymmetric encryption. The symmetric encryption is more popular because it is generally hundreds to thousands of execution times faster than asymmetric schemes. It uses closely related identical keys for encryption, and for decryption steps, unlike an asymmetric scheme, it utilizes a different key for encryption than for decryption. Thus, when knowing the encryption key of a key pair, we can encrypt data, but we cannot decrypt it; thus, the asymmetric encryption is more secure than the symmetric encryption. Accordingly, the symmetric encryption is intended for large volume data encryption, while the asymmetric encryption is frequently used for securely exchanging a secret key.In the literature, different image encryption schemes have been carried out using various methods. Many cryptographers have widely adopted the Advanced Encryption System (AES) for image encryption thanks to its high performance [1, 2].Toughi et al. [3] propose an encryption algorithm for color image protection. Their scheme is a combination of the elliptic curve and AES. About that, the elliptic curves are used for generating three random sequences. These sequences are used for generating three masks in the goal to encrypt the red, blue, and green components of the original image.Yong and Xueqian [4] proposed an image encryption system based on the combination of the AES-128 and the Cipher Block Chaining mode (CBC) standards. For this, the plain image is fragmented into sub-block sized 128 bit. After that, an initial vector, named IV, with a size equal to 128 bit is generated by the Tent chaotic map and XORed with the initial plain sub-block. Secondly, the AES-128 is applied to obtain the first ciphered sub-block. Finally, the rest of the different sub-blocks are scripted sequentially following the same steps applied on the first one block.According to the results presented in references 1 and 2, we notice that the encryption systems based on the AES algorithm cause a long execution time [5]. This disadvantage affects, directly, the global quality of the system in case of online encryption. In the other case, the use of the CBC mode has many disadvantages such as the sequential architecture and that it can cause the slowdown in encryption systems. Another disadvantage of the CBC standard is that the propagation of an error may occur easily and can affect all blocks.Many cryptographers turned to use the chaos theory for secure image encryption. This is due to many advantages of chaos such that deterministic pseudorandom numbers generation (PRNG), long periodicity, sensitive to the initial conditions, and large key space. Several chaotic systems have been investigated for pseudorandom number generation such as the Lorenz system, Rössler, Skew tent, and PWLCM map, etc [6].Sha-Sha et al. [7] have investigated the phase-truncated short-time fractional Fourier transform for image encryption. The key stream was generated by Chen’s hyper-chaotic system. For image encryption, the original image was firstly decomposed into four subimages of the same size. Then, the subimages were encoded using a combination between the PTSTFrFT and a wave-based permutation. Finally, the image was diffused with a key to produce the encrypted image.In [8], the authors put forward a multi-image compression-encryption algorithm. The key stream was obtained using the Logistic-Tent and Tent-Sine systems which were maintained in cascade. Firstly, a spectrum of multi-image was obtained using the Discrete Cosine Transform (DCT) and, then, compressed. Next, a Quaternion representation QR of the multi-image was obtained. After that, a Double Random Phase Encoding (DRPE) was operated on the Quaternion Discrete Fractional Hartley Transform (QDFrHT) in order to get a quaternion signal. Then, a matrix named E sized 4 times the size of the original image was generated by extracting the real and the three imaginary parts of the quaternion signal. Finally, a block-based confusion and pixel diffusion methods were applied to the matrix E in order to obtain an encrypted compressed image.Zhou [9] suggested an image cryptosystem based on a combination between the 3D orthogonal Latin squares (3D-OLSs) and a matching matrix. Firstly, the 3D sine map was used to generate three chaotic sequences. Next, a 3D orthogonal Latin square and a matching matrix were produced by using the chaotic sequences. Then, the 3D-OLSs and the matching matrix were jointly used to permute the original image. After that, all planes of the permuted matrix were divided into sixteen blocks of the same size. The chaotic sequence was sorted, and a position matrix was generated. According to the position matrix, the blocks of each plane were linked and shifted by using a cyclic shift operation, and then, a new matrix was generated. Finally, the encrypted image was generated by executing a diffusion operation for the new matrix.In [10], Hongjun suggested an image encryption scheme based on the DNA sequence and two chaotic maps. The scheme was symmetric, and they adopted confusion-diffusion as the encryption architecture. The MD5 was used to generate an initial secret key. The initial parameters of chaos maps were generated from the initial secret key. The image was confused using the PWLCM map and, then, confused using DNA and the Chebyshev map.Jawed [11] proposed simple image encryption based on the skew tent map. The SHA-3 was used for generating an initial secret key of the system. After that, the image was transformed, permuted, and confused. These operations were performed successively by using the Discrete Cosine Transform (DCT), the multiplication with orthogonal matrix, the application of the skew tent map, and the Xor operation.In [12], Liu propose an image encryption algorithm based on the combination between the Liu chaotic map and a hash function. The hash function was used to generate an initial secret key of the encryption system. The initial parameter of the Liu system was derived from the initial secret key. After that, three pseudorandom sequences were generated to scramble the image pixels.Xiuli [13] proposes an image encryption system using DNA, SHA-386, and a chaotic map. However, the SHA-386 was used to generate an initial secret key of the system. Then, different pseudorandom number sequences were generated by a four-wing chaotic map. Next, a DNA encoding/decoding and permutation methods were applied to the three components, red, blue, and green, in order to produce the encrypted image.Guesmi [14] proposed an encryption algorithm for image protection. The system was based on a hybrid model of Deoxyribonucleic Acid (DNA) masking, a Secure Hash Algorithm (SHA-2), and the Lorenz chaotic system. Firstly, the SHA-256 was applied to generate an initial secret key. The initial values of the Lorenz system were generated from the initial secret key. Secondly, the original image and sequence K were encoded into two DNA sequences using a chosen rule from the eight kinds of DNA map rules. Thirdly, the first DNA sequence was permuted using a Lorenz chaotic sequence. Finally, the DNA sequence was decoded utilizing a chosen rule from the eight kinds of DNA map rules.The challenge is that traditionally, key generation, encryption, authentication, and integrity have been complex and computationally costly to execute while keeping in mind the issue related to the security level. All mentioned image encryption schemes have many weaknesses, and it was symmetries, which require key securing and authentication. Many of them are sequential and too long in design and calculation, which greatly increase the execution time.In this work, we suggest an efficient encryption algorithm for digital image protection and authentication. We aim for a high-security level, low complexity, and high performance in terms of execution time. For a high-quality key generation, a highly sensitive PRNG-based chaotic system is designed. For image encryption, we adopt PRNG-CTR diffusion as architecture. For authentication and key securing, both the initial secret key and owner signature are concatenated and encrypted using the Rivest–Shamir–Adleman (RSA) system. This paper is planned in four parts as follows: In Section2, the proposed encryption algorithm is described. The simulation, analysis, evaluation, and validation of the proposed algorithm are given in Section 3. Section 4 concludes the work.


## 2. Proposed Cryptosystem Algorithm

This section is reserved for describing the proposed algorithm applied to digital image protection and authentication. As shown in Figure1, the cryptosystem algorithm is a hybrid scheme. However, it uses a symmetric and an asymmetric scheme.Figure 1
General view of the proposed encryption system.The RSA system is employed as the asymmetric scheme, which is used to encrypt the initial secret key and the sender’s signature. On the other hand, a diffusion-based PRNG-CTR symmetric encryption is adopted for encrypting the secret image.


### 2.1. Encryption Step

The encryption system includes three parts: key generation, image encryption, and secret key encryption. The first one is a PRNG used for a high-quality key generation. The second one is the encryption step of the whole image by using the generated key with the CTR mode of the encryption operation. The third one consists of encrypting the totality of the owner’s signature and the initial secret key by the RSA algorithm in goal to control authenticity and engage the safety asymmetric type of the algorithm.


#### 2.1.1. Pseudorandom Number Generator

The PRNG is useful to generate a key for encryption. It produces a sequence of numbers such that its properties are statistically independent, uniformly distributed, and unpredictable. To provide a high-quality key, we use a PRNG based on the Lorenz chaotic system and the SHA-256. The Lorenz system is a mathematical model composed of three differential equations described as follows [15]:(1)dxdt=ay−x,dydt=cx−y−xz,dzdt=xy−bz,where x, y, and z are the system variables and a, b, and c are the system parameters. The Lorenz system exhibits a chaotic behaviour for certain parameter values and initial conditions. When a = 10, b = 8/3, and c = 28, the system has a chaotic behaviour [14].The SHA-256 is used to generate a 256-bit initial secret keyKi fully related to the plain image [16]. Ki is divided into 8-bit blocks as follows:(2)Ki=k1k2k3⋯k32.The initial state which consists of (x0, y0, z0) of the Lorenz system is derived from Ki utilizing the following equations:(3)x0=k1⊕k2⊕⋯⊕k1128,(4)y0=k12⊕k13⊕⋯⊕k2228,(5)z0=k23⊕k24⊕⋯⊕k3228.By iterating the Lorenz system and modulating its values, equation (6), a long sequence of independent numbers PRNS is obtained, in the range [0, 255], which exhibits high random behaviour.(6)PRNS=ni×1012mod256.


#### 2.1.2. Image Encryption

To perform image encryption, we adopt Xor diffusion based on the 128-bit PRNG-CTR as the architecture. However, the algorithm processes a fixed block and a key sized 128 bit.(i)
Firstly, two streams of 128-bit numbers, NS1 and NS2, are generated using two counters with different initialization vectors IV1 and IV2. The initial vectors of the counters are derived from the initial keyKi as follows:(7)IV1=Ki1:128,(8)IV2=Ki129:256.(ii)
Secondly, the Xor operation between NS1 and NS2 is used in the goal to obtain another sequence of 128-bit numbers named NS3.(iii)
Thirdly, NS3 is XORed with the PRNS (generated by PRNG) in order to acquire a 128-bit key stream named KS.(iv)
Finally, we diffuse the image block with KS to produce the corresponding encrypted image with the same size. The image encryption instruction can be described by equation (9) and the system is depicted in Figure 2.(9)CBi=NS1⊕NS2⊕PRNS⊕PBi,where CB is a cipher block; i is the index from 0 to N (total number of blocks); NS1 is a stream of 128-bit number generated by counter1; NS2 is a stream of 128-bit number generated by counter2; PRNS is a stream of pseudorandom numbers generated by the PRNG; PBi is a plain block.Figure 2
Flowchart of the proposed encryption system.The proposed algorithm has significant advantages; it enables fast image encryption with low computational complexity, no propagation error may occur, has random access into any block, and the same image can be encrypted with a variety of key streams. Beyond, the architecture is flexible for key extension and easily parallelizable to speed up execution for meeting real-time requirements.


#### 2.1.3. Image Authentication and Key Encryption

For image authentication, a 256-bit signature is generated fully related to the owner logo using SHA-256. The signature is combined with the 256-bit initial key and encrypted together by the RSA encryption algorithm to engage the safety asymmetric type of the key [17], which enhance the security of the algorithm. However, the public key of the destination is used to encrypt the initial key utilizing equation (10). At the destination, the private key is only used for decrypting the initial key, using equation (11), to finally decrypt the received image and detect the owner’s logo.(10)Kf=Kiemodn,where Ki is the plain key, Kf is the correspondent encrypted key, and (n, e) is the public key of destination.(11)Ki=Kfdmodn,where Ki is the decrypted key, Kf is the encrypted key, and (n, d) is the private key of the destination.


### 2.2. Decryption Step

After the encryption step, the encrypted image can be sent to a well-defined destination using an insecure network (diffusion step). At the reception, the image must be manipulated by the extraction system, Figure3, to seek the plain image and detect the owner’s logo. Practically, it uses the reverse algorithm, according to the encryption algorithm. This phase will take place just when the encrypted image and the key are available.Figure 3
General architecture of the extraction system.The algorithm starts by decrypting the encrypted keyKf by the RSA system to obtain the plain key Kf. The first part, 256 bit, is the initial key Ki used for image decryption, and the remaining part, 256 bit, is the owner digital signature used for image authentication. However, using Ki, the received image is decrypted by the decryption system. This treatment enables finding the plain image. On the other hand, utilizing the digital signature with the help of a database, we detect the image owner’s logo.


## 2.1. Encryption Step

The encryption system includes three parts: key generation, image encryption, and secret key encryption. The first one is a PRNG used for a high-quality key generation. The second one is the encryption step of the whole image by using the generated key with the CTR mode of the encryption operation. The third one consists of encrypting the totality of the owner’s signature and the initial secret key by the RSA algorithm in goal to control authenticity and engage the safety asymmetric type of the algorithm.


### 2.1.1. Pseudorandom Number Generator

The PRNG is useful to generate a key for encryption. It produces a sequence of numbers such that its properties are statistically independent, uniformly distributed, and unpredictable. To provide a high-quality key, we use a PRNG based on the Lorenz chaotic system and the SHA-256. The Lorenz system is a mathematical model composed of three differential equations described as follows [15]:(1)dxdt=ay−x,dydt=cx−y−xz,dzdt=xy−bz,where x, y, and z are the system variables and a, b, and c are the system parameters. The Lorenz system exhibits a chaotic behaviour for certain parameter values and initial conditions. When a = 10, b = 8/3, and c = 28, the system has a chaotic behaviour [14].The SHA-256 is used to generate a 256-bit initial secret keyKi fully related to the plain image [16]. Ki is divided into 8-bit blocks as follows:(2)Ki=k1k2k3⋯k32.The initial state which consists of (x0, y0, z0) of the Lorenz system is derived from Ki utilizing the following equations:(3)x0=k1⊕k2⊕⋯⊕k1128,(4)y0=k12⊕k13⊕⋯⊕k2228,(5)z0=k23⊕k24⊕⋯⊕k3228.By iterating the Lorenz system and modulating its values, equation (6), a long sequence of independent numbers PRNS is obtained, in the range [0, 255], which exhibits high random behaviour.(6)PRNS=ni×1012mod256.


### 2.1.2. Image Encryption

To perform image encryption, we adopt Xor diffusion based on the 128-bit PRNG-CTR as the architecture. However, the algorithm processes a fixed block and a key sized 128 bit.(i)
Firstly, two streams of 128-bit numbers, NS1 and NS2, are generated using two counters with different initialization vectors IV1 and IV2. The initial vectors of the counters are derived from the initial keyKi as follows:(7)IV1=Ki1:128,(8)IV2=Ki129:256.(ii)
Secondly, the Xor operation between NS1 and NS2 is used in the goal to obtain another sequence of 128-bit numbers named NS3.(iii)
Thirdly, NS3 is XORed with the PRNS (generated by PRNG) in order to acquire a 128-bit key stream named KS.(iv)
Finally, we diffuse the image block with KS to produce the corresponding encrypted image with the same size. The image encryption instruction can be described by equation (9) and the system is depicted in Figure 2.(9)CBi=NS1⊕NS2⊕PRNS⊕PBi,where CB is a cipher block; i is the index from 0 to N (total number of blocks); NS1 is a stream of 128-bit number generated by counter1; NS2 is a stream of 128-bit number generated by counter2; PRNS is a stream of pseudorandom numbers generated by the PRNG; PBi is a plain block.Figure 2
Flowchart of the proposed encryption system.The proposed algorithm has significant advantages; it enables fast image encryption with low computational complexity, no propagation error may occur, has random access into any block, and the same image can be encrypted with a variety of key streams. Beyond, the architecture is flexible for key extension and easily parallelizable to speed up execution for meeting real-time requirements.


### 2.1.3. Image Authentication and Key Encryption

For image authentication, a 256-bit signature is generated fully related to the owner logo using SHA-256. The signature is combined with the 256-bit initial key and encrypted together by the RSA encryption algorithm to engage the safety asymmetric type of the key [17], which enhance the security of the algorithm. However, the public key of the destination is used to encrypt the initial key utilizing equation (10). At the destination, the private key is only used for decrypting the initial key, using equation (11), to finally decrypt the received image and detect the owner’s logo.(10)Kf=Kiemodn,where Ki is the plain key, Kf is the correspondent encrypted key, and (n, e) is the public key of destination.(11)Ki=Kfdmodn,where Ki is the decrypted key, Kf is the encrypted key, and (n, d) is the private key of the destination.


## 2.1.1. Pseudorandom Number Generator

The PRNG is useful to generate a key for encryption. It produces a sequence of numbers such that its properties are statistically independent, uniformly distributed, and unpredictable. To provide a high-quality key, we use a PRNG based on the Lorenz chaotic system and the SHA-256. The Lorenz system is a mathematical model composed of three differential equations described as follows [15]:(1)dxdt=ay−x,dydt=cx−y−xz,dzdt=xy−bz,where x, y, and z are the system variables and a, b, and c are the system parameters. The Lorenz system exhibits a chaotic behaviour for certain parameter values and initial conditions. When a = 10, b = 8/3, and c = 28, the system has a chaotic behaviour [14].The SHA-256 is used to generate a 256-bit initial secret keyKi fully related to the plain image [16]. Ki is divided into 8-bit blocks as follows:(2)Ki=k1k2k3⋯k32.The initial state which consists of (x0, y0, z0) of the Lorenz system is derived from Ki utilizing the following equations:(3)x0=k1⊕k2⊕⋯⊕k1128,(4)y0=k12⊕k13⊕⋯⊕k2228,(5)z0=k23⊕k24⊕⋯⊕k3228.By iterating the Lorenz system and modulating its values, equation (6), a long sequence of independent numbers PRNS is obtained, in the range [0, 255], which exhibits high random behaviour.(6)PRNS=ni×1012mod256.


## 2.1.2. Image Encryption

To perform image encryption, we adopt Xor diffusion based on the 128-bit PRNG-CTR as the architecture. However, the algorithm processes a fixed block and a key sized 128 bit.(i)
Firstly, two streams of 128-bit numbers, NS1 and NS2, are generated using two counters with different initialization vectors IV1 and IV2. The initial vectors of the counters are derived from the initial keyKi as follows:(7)IV1=Ki1:128,(8)IV2=Ki129:256.(ii)
Secondly, the Xor operation between NS1 and NS2 is used in the goal to obtain another sequence of 128-bit numbers named NS3.(iii)
Thirdly, NS3 is XORed with the PRNS (generated by PRNG) in order to acquire a 128-bit key stream named KS.(iv)
Finally, we diffuse the image block with KS to produce the corresponding encrypted image with the same size. The image encryption instruction can be described by equation (9) and the system is depicted in Figure 2.(9)CBi=NS1⊕NS2⊕PRNS⊕PBi,where CB is a cipher block; i is the index from 0 to N (total number of blocks); NS1 is a stream of 128-bit number generated by counter1; NS2 is a stream of 128-bit number generated by counter2; PRNS is a stream of pseudorandom numbers generated by the PRNG; PBi is a plain block.Figure 2
Flowchart of the proposed encryption system.The proposed algorithm has significant advantages; it enables fast image encryption with low computational complexity, no propagation error may occur, has random access into any block, and the same image can be encrypted with a variety of key streams. Beyond, the architecture is flexible for key extension and easily parallelizable to speed up execution for meeting real-time requirements.


## 2.1.3. Image Authentication and Key Encryption

For image authentication, a 256-bit signature is generated fully related to the owner logo using SHA-256. The signature is combined with the 256-bit initial key and encrypted together by the RSA encryption algorithm to engage the safety asymmetric type of the key [17], which enhance the security of the algorithm. However, the public key of the destination is used to encrypt the initial key utilizing equation (10). At the destination, the private key is only used for decrypting the initial key, using equation (11), to finally decrypt the received image and detect the owner’s logo.(10)Kf=Kiemodn,where Ki is the plain key, Kf is the correspondent encrypted key, and (n, e) is the public key of destination.(11)Ki=Kfdmodn,where Ki is the decrypted key, Kf is the encrypted key, and (n, d) is the private key of the destination.


## 2.2. Decryption Step

After the encryption step, the encrypted image can be sent to a well-defined destination using an insecure network (diffusion step). At the reception, the image must be manipulated by the extraction system, Figure3, to seek the plain image and detect the owner’s logo. Practically, it uses the reverse algorithm, according to the encryption algorithm. This phase will take place just when the encrypted image and the key are available.Figure 3
General architecture of the extraction system.The algorithm starts by decrypting the encrypted keyKf by the RSA system to obtain the plain key Kf. The first part, 256 bit, is the initial key Ki used for image decryption, and the remaining part, 256 bit, is the owner digital signature used for image authentication. However, using Ki, the received image is decrypted by the decryption system. This treatment enables finding the plain image. On the other hand, utilizing the digital signature with the help of a database, we detect the image owner’s logo.


## 3. Experimental Results and Interpretation

The proposed algorithm is implemented in Matlab 2017b and using a personal computer with an Intel (R), Core (TM) i7-5500 U, CPU at 3.4 GHz, and 8 Go running Windows 10.To evaluate the performance of the proposed approach, simulation results and performance analysis are given in this section. For this, we have considered several indicators discussed thereafter. This part includes statistical analysis, key analysis, and algorithm speed.


### 3.1. Statistical Analysis

Statistical analysis is the computation of the similarity factor between the original and its corresponding encrypted image in the goal to evaluate the ability of information in defending hackers. This is can be achieved using the image histogram, information Entropy (E), Normalized Correlation (NC), correlation coefficient (ρ), Peak Signal to Noise Ratio (PSNR), and Structural Similarity Index Measure (SSIM) tools [18–20].


#### 3.1.1. Histogram Analysis

The histogram of an image is the distribution of information related to the pixel values. An ideal image ciphering system should always generate an encrypted image with uniform and completely different histograms compared to those related to the plain images. We analyze the histograms of several encrypted images and their corresponding original images that have different contents. Six examples of ordinary images are shown in Figure4.Figure 4
Histogram of the original images and their corresponding encrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)As seen in Figures4(d), 4(h), 4(l), 4(p), 4(t), and 4(x), we note that the histogram of the resultant encrypted image is fairly uniformly distributed and so different compared to the histogram of the plain image, Figures 4(b), 4(f), 4(j), 4(n), 4(r), and 4(v), which contains large spikes. Therefore, it is difficult to understand the encrypted image appearance.


#### 3.1.2. PSNR, SSIM, and Entropy Analysis

In this section, we evaluate the proposed system on six selected ordinary images. After their ciphering, the PSNR, SSIM, NC, and entropy factors are computed. Table1 gives the simulation results.Table 1
PSNR, SSIM, NC, andE values of the encrypted image.
ImageEPSNRNCSSIMLena7.999354.495−0.00100.0101Peppers7.999324.721−0.00150.0094Baboon7.999324.4800.00110.0101Walkbridge7.999354.6670.000190.0085Cameraman7.999324.2910.00260.0092Jetplane7.999364.295−0.00300.0107For analysing the obtained results, we start by the entropy factor. Theoretically, a good encryption system gives random information equal to 8 [19]. As seen in Table 1, we observe that the entropy value of the encrypted image is close to the ideal value 8. As a consequence, we can conclude that the proposed system is safe against entropy attacks. After that, we pass to analyze the obtained PSNR results. These results indicate that the PSNR is lower than 5 dB (<5 db). Following reference [21], the proposed system gives a very bad quality between the encrypted and plain images. We conclude that it is very difficult to predict the plain image from the encrypted one. By analysing the SSIM factors between the plain and encrypted images. As shown in Table 1, we note that the SSIM values are close to 0. We conclude that we cannot distinguish the content of the clear image from the encrypted one.For evaluation of the proposed encrypted system, a comparative study of the Lena image with some recent work for entropy and PSNR evaluation tools is presented in Table2. We conclude that the proposed system gives the best results against many other ciphering systems.Table 2
Comparative study of the PSNR andE values for the Lena image.
CryptosystemPSNRE[13]—7.99920[22]—7.99122[23]10.04547.75970[24]—7.90303[25]9.30007.99910[26]—7.99730Proposed algorithm4.4957.99935


#### 3.1.3. Correlation Coefficient Analysis

In an ordinary image, the correlation of the adjacent pixels is close to one. Unlike in an encrypted image, the adjacent pixels are not correlated [27]. Let x and y be two gray scale values of two adjacent pixels in the image; the correlation of the adjacent pixels is computed using the following equations:(12)Ex=1N∑i=1Nxi(13)Dx=1N∑i=1Nxi−Exi2,(14)covx,y=1N∑i=1Nxi−Exyi−Ey,(15)rxy=covx,yDxDy.E (x) is the expectation of x, D (x) is the estimation of the variance in x, and cov (x, y) is the estimation of the covariance between x and y. Table 3 shows that the encrypted images correlation coefficients are close to zero. So, we cannot distinguish the content of the clear image from the encrypted one. Table 4 shows the distributions of 2000 pairs of randomly selected adjacent pixels of the original and encrypted Lena image, respectively.Table 3
ρ and NC values of the original image and its corresponding encrypted image.
ImageStatusNCHorizontalVerticalDiagonalLenaPlain−0.00100.804820.819420.82776Cipher0.00027−0.01339−0.07913PeppersPlain−0.00150.846790.973350.88347Cipher0.00638−0.06850−0.05433BaboonPlain0.00110.830450.876790.87929Cipher0.00742−0.00602−0.10326WalkbridgePlain0.000190.871080.879340.84997Cipher0.000930.00380−0.00776CameramanPlain0.00260.877900.890790.90087Cipher0.00226−0.00774−0.00580JetplanePlain−0.00300.808390.816430.82083Cipher−0.059280.00381−0.15028Table 4
Distribution of 2000 pairs of randomly selected adjacent pixels for the Lena image.
ImageHorizontalVerticalDiagonalOriginal LenaEncrypted LenaThe results clearly show that the correlation coefficient of the original images is close to 1, while that of the encrypted images is close to zeros. In addition, the distribution of adjacent pixels is inconsistent; i.e., there is no correlation between them. This indicates that the algorithm eliminates the correlation of adjacent pixels in the plain image, and it makes an encrypted image with no correlation. A comparative study of the Lena image with some recent works for the correlation coefficient evaluation tool is presented in Table5. We conclude that the proposed system gives the best results against other works.Table 5
Comparative study of the correlation coefficient for the Lena image.
WorkHorizontalVerticalDiagonal[3]−0.0004−0.00180.0001[13]0.02650.07920.0625[22]−0.00010.00890.0091[23]0.05910.05080.0480[24]−0.0294−0.0014−0.0180[25]−0.00470.00150.0030[26]−0.02260.00410.0368Proposed system0.0002−0.0133−0.0791


### 3.2. Key Analysis

Here, we describe the key space, key sensitivity, and randomness analysis test to evaluate the strength of the encryption scheme against hackers.


#### 3.2.1. Key Space

The key space of a safety encryption scheme should be very large to resist the brute-force attack. In the proposed algorithm, for an initial keyKi, there are 2256 dissimilar keys, which is very large. Certainly, the key brute-force attacks are computationally infeasible. Table 6 gives a comparative study of the key space with other recent encryption algorithms.Table 6
Comparative study of the key space.
WorkKey space[7]3.4 × 1038[22]10117[24]2208Proposed algorithm2256


#### 3.2.2. Key Sensitivity

For high safety encryption, the encryption algorithm must be sensitive to the entered image and the initial secret keyKi. A very small change (one bit) in Ki, or in the image, will cause a greatly significant change in the output generated keys for encryption and output image. Key sensitivity can be achieved by using the Number of Changing Pixel Rate (NPCR) and Unified Averaged Changed Intensity (UACI) randomness tests to evaluate the robustness of the image against differential hackers [28], which are described as follows:(16)NPCR=1S∑Di,j×100%,(17)UACI=1S∑dG×100%,where S is the size of the image and D (i, j) is a logical value affected by the following cases:(18)Di,j=0,I1i,j=I2i,j,1,I1i,j≠I2i,j,where d is the difference between two pixels on the image with the same coordinates.(19)d=p1i,j−p2i,j.However, a sensitivity test applied to the initial key is performed using two initial keys,Ki1 and Ki2, but Ki2 is different by one bit from Ki1 to encrypt the same image. After that, we try decrypting the obtained images by a wrong key. Here, the two keys, Ki1 and Ki2, are permuted in the decryption step, i.e., each image is decrypted by a wrong key which is different by one bit from the correct key. This test is carried out with many Ki keys which are randomly chosen to properly evaluate the algorithm. Simulation results for the Lena image are shown in Figure 5 and Table 7.Figure 5
Key sensitivity test applied on the initial key: (a) encrypted Lena by keyKi1, (b) encrypted Lena by key Ki2, (c) difference between (a) and (b), (d) decrypted (a) by key Ki2, (e) decrypted (b) by key Ki1, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 7
NC, NPCR, and UACI tests applied on the initial key.
ImageNPCR (%)UACI (%)NCLena99.6936933.191170.00170Peppers99.7531833.287260.00292Baboon99.6556033.95780−0.05231Walkbridge99.6637033.498200.00419Cameraman99.6955633.50594−0.00379Jetplane99.7547133.39463−0.01982It is remarkable that our algorithm is highly sensitive to the initial key for simultaneous encryption and decryption phases. The NC value between the two encrypted images is very weak, i.e., there is no similarity coefficient between them. Besides, the difference between them is another image. In addition, the NPCR and UACI percentages are important, which signifies that the encrypted images are greatly dissimilar. We conclude that the plain image cannot be recovered using a wrong key by one bit. The same sensitivity is obtained by all randomly chosen keys.Furthermore, we perform a key sensitivity test, applied on the original image, using two images, I1 and I2, but the second one is different by one bit from the first one. The change is selected randomly. The NPCR and UACI simulation for the Lena image are presented in Figure6, and the simulation results for all images are introduced in Table 8.Figure 6
Key sensitivity test applied on the plain image: (a) encrypted original Lena, (b) encrypted modified Lena, (c) difference between (a) and (b), (d) decrypted (a) by keyKi1, (e) decrypted (b) by key Ki2, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 8
NC, NPCR, and UACI tests applied on the image.
ImageNPCR (%)UACI (%)NCLena99.6595033.711200.00157Peppers99.6055633.643220.00109Baboon99.7066433.809290.00370Walkbridge99.7566033.275210.00102Cameraman99.6044133.42789−0.00259Jetplane99.6065633.36627−0.15490As shown in the aforementioned simulations results, it is clear that our encryption design is very sensitive to a tiny change in the entered image. This demonstrates the effectiveness of the SHA-256 function, which puts an image’s initial key specific for encryption. Table9 gives a comparative study of the NPCR and UACI evaluation tests with some recent work.Table 9
Comparative study of NPCR and UACI tests for the Lena image.
ImageNPCR (%)UACI (%)[7]99.6100033.4800[8]99.6250033.451000[9]99.6078033.45100[12]99.6416333.39537[23]99.6323033.12500[24]99.6100033.53000[29]100.000033.43150[26]99.5894833.46458[30]99.6253033.48070Proposed algorithm99.6595033.83002


#### 3.2.3. Randomness Analysis

Random analysis can be achieved using the NIST 800-22. The test is useful to test random and pseudorandom number generators [31] to determine whether or not a PRNG is appropriate for data encryption. The analysis contains 15 tests that assess key streams to meet important necessities. It focuses on different nonrandom aspects that can be found in a key sequence. The test results of 262144 sequences of 128 bit generated by the proposed PRNG are shown in Table 10. The sequences pass all tests successfully. This demonstrates that the generated pseudorandom numbers have good statistical properties such as being highly unpredictable, random, independent, and uniformly distributed.Table 10
Test results of the NIST 800-22 for the proposed PRNG.
StatisticalP valueStatusStatus frequency0.8755390PassBlock frequency (m = 128)0.3924558PassForward cusum0.6371194PassReverse cusum0. 6371194PassRuns0. 6371194PassLong runs of ones0. 6371194PassBinary matrix rank0.4372742PassSpectral DFT0. 8755390PassNonoverlapping template (m = 9)0. 1463590PassOverlapping template (m = 9)0.5449921PassUniversal0.0713232PassApproximate entropy (m = 10)0.0125474PassRandom excursions (x = +1)0.9030558PassRandom excursions variant (x = -1)0.3974291PassLinear complexity (M = 500)0.1922722Pass


### 3.3. Encryption Algorithm Speed

In real-time image processing, the execution time is a major constraint. In a software implementation, the speed of execution mainly depends on the CPU performance. The proposed algorithm is implemented using Matlab R2017a software running on a personal computer with CPU Intel Core-i7-3770 3.4 GHz frequency. We can use approximate equations (20) and (21) to compute the speed (S) and the number of cycles per byte (CpB) taken by an encryption algorithm running on a specific processor [18].(20)S=DSTMBs,(21)CpB=CpSS.DS is the data size,T is the time taken to execute the algorithm on a CPU, and CpS is the CPU frequency. We compare the proposed algorithm with recent works presented in Table 11.Table 11
Comparative study of encryption algorithm speed.
WorkUsed toolsArchitectureS (MB/S)CpB[4]AES-128 CBCXor diffusion0.0021400000[8]Logistic-Tent and Tent-SineConfusion/diffusion0.19010520[9]3D sine chaotic mapConfusion/diffusion0.9703298[12]SHA-256/Liu systemXor diffusion1.5001600[10]MD5/PWLCM/DNAConfusion/diffusion7.540398[11]SHA-3/Tent map/DCTTransformation/permutation/diffusion0.10020000[25]Tent mapXor diffusion0.14016142[26]Chebyshev map/A. Tent map/LWT/LFTPermutation/substitution/diffusion0.019147368Proposed algorithmSHA-256/CTR/PRNGXor diffusion9.567355It is clear that the proposed scheme has the best result in terms of speed and architecture complexity. We note that the permutation and substitution operations depend on more time than diffusion operation. Although, the proposed cryptosystem uses only diffusion operation with low computational complexity, and it gives the best performance.


## 3.1. Statistical Analysis

Statistical analysis is the computation of the similarity factor between the original and its corresponding encrypted image in the goal to evaluate the ability of information in defending hackers. This is can be achieved using the image histogram, information Entropy (E), Normalized Correlation (NC), correlation coefficient (ρ), Peak Signal to Noise Ratio (PSNR), and Structural Similarity Index Measure (SSIM) tools [18–20].


### 3.1.1. Histogram Analysis

The histogram of an image is the distribution of information related to the pixel values. An ideal image ciphering system should always generate an encrypted image with uniform and completely different histograms compared to those related to the plain images. We analyze the histograms of several encrypted images and their corresponding original images that have different contents. Six examples of ordinary images are shown in Figure4.Figure 4
Histogram of the original images and their corresponding encrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)As seen in Figures4(d), 4(h), 4(l), 4(p), 4(t), and 4(x), we note that the histogram of the resultant encrypted image is fairly uniformly distributed and so different compared to the histogram of the plain image, Figures 4(b), 4(f), 4(j), 4(n), 4(r), and 4(v), which contains large spikes. Therefore, it is difficult to understand the encrypted image appearance.


### 3.1.2. PSNR, SSIM, and Entropy Analysis

In this section, we evaluate the proposed system on six selected ordinary images. After their ciphering, the PSNR, SSIM, NC, and entropy factors are computed. Table1 gives the simulation results.Table 1
PSNR, SSIM, NC, andE values of the encrypted image.
ImageEPSNRNCSSIMLena7.999354.495−0.00100.0101Peppers7.999324.721−0.00150.0094Baboon7.999324.4800.00110.0101Walkbridge7.999354.6670.000190.0085Cameraman7.999324.2910.00260.0092Jetplane7.999364.295−0.00300.0107For analysing the obtained results, we start by the entropy factor. Theoretically, a good encryption system gives random information equal to 8 [19]. As seen in Table 1, we observe that the entropy value of the encrypted image is close to the ideal value 8. As a consequence, we can conclude that the proposed system is safe against entropy attacks. After that, we pass to analyze the obtained PSNR results. These results indicate that the PSNR is lower than 5 dB (<5 db). Following reference [21], the proposed system gives a very bad quality between the encrypted and plain images. We conclude that it is very difficult to predict the plain image from the encrypted one. By analysing the SSIM factors between the plain and encrypted images. As shown in Table 1, we note that the SSIM values are close to 0. We conclude that we cannot distinguish the content of the clear image from the encrypted one.For evaluation of the proposed encrypted system, a comparative study of the Lena image with some recent work for entropy and PSNR evaluation tools is presented in Table2. We conclude that the proposed system gives the best results against many other ciphering systems.Table 2
Comparative study of the PSNR andE values for the Lena image.
CryptosystemPSNRE[13]—7.99920[22]—7.99122[23]10.04547.75970[24]—7.90303[25]9.30007.99910[26]—7.99730Proposed algorithm4.4957.99935


### 3.1.3. Correlation Coefficient Analysis

In an ordinary image, the correlation of the adjacent pixels is close to one. Unlike in an encrypted image, the adjacent pixels are not correlated [27]. Let x and y be two gray scale values of two adjacent pixels in the image; the correlation of the adjacent pixels is computed using the following equations:(12)Ex=1N∑i=1Nxi(13)Dx=1N∑i=1Nxi−Exi2,(14)covx,y=1N∑i=1Nxi−Exyi−Ey,(15)rxy=covx,yDxDy.E (x) is the expectation of x, D (x) is the estimation of the variance in x, and cov (x, y) is the estimation of the covariance between x and y. Table 3 shows that the encrypted images correlation coefficients are close to zero. So, we cannot distinguish the content of the clear image from the encrypted one. Table 4 shows the distributions of 2000 pairs of randomly selected adjacent pixels of the original and encrypted Lena image, respectively.Table 3
ρ and NC values of the original image and its corresponding encrypted image.
ImageStatusNCHorizontalVerticalDiagonalLenaPlain−0.00100.804820.819420.82776Cipher0.00027−0.01339−0.07913PeppersPlain−0.00150.846790.973350.88347Cipher0.00638−0.06850−0.05433BaboonPlain0.00110.830450.876790.87929Cipher0.00742−0.00602−0.10326WalkbridgePlain0.000190.871080.879340.84997Cipher0.000930.00380−0.00776CameramanPlain0.00260.877900.890790.90087Cipher0.00226−0.00774−0.00580JetplanePlain−0.00300.808390.816430.82083Cipher−0.059280.00381−0.15028Table 4
Distribution of 2000 pairs of randomly selected adjacent pixels for the Lena image.
ImageHorizontalVerticalDiagonalOriginal LenaEncrypted LenaThe results clearly show that the correlation coefficient of the original images is close to 1, while that of the encrypted images is close to zeros. In addition, the distribution of adjacent pixels is inconsistent; i.e., there is no correlation between them. This indicates that the algorithm eliminates the correlation of adjacent pixels in the plain image, and it makes an encrypted image with no correlation. A comparative study of the Lena image with some recent works for the correlation coefficient evaluation tool is presented in Table5. We conclude that the proposed system gives the best results against other works.Table 5
Comparative study of the correlation coefficient for the Lena image.
WorkHorizontalVerticalDiagonal[3]−0.0004−0.00180.0001[13]0.02650.07920.0625[22]−0.00010.00890.0091[23]0.05910.05080.0480[24]−0.0294−0.0014−0.0180[25]−0.00470.00150.0030[26]−0.02260.00410.0368Proposed system0.0002−0.0133−0.0791


## 3.1.1. Histogram Analysis

The histogram of an image is the distribution of information related to the pixel values. An ideal image ciphering system should always generate an encrypted image with uniform and completely different histograms compared to those related to the plain images. We analyze the histograms of several encrypted images and their corresponding original images that have different contents. Six examples of ordinary images are shown in Figure4.Figure 4
Histogram of the original images and their corresponding encrypted images.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)As seen in Figures4(d), 4(h), 4(l), 4(p), 4(t), and 4(x), we note that the histogram of the resultant encrypted image is fairly uniformly distributed and so different compared to the histogram of the plain image, Figures 4(b), 4(f), 4(j), 4(n), 4(r), and 4(v), which contains large spikes. Therefore, it is difficult to understand the encrypted image appearance.


## 3.1.2. PSNR, SSIM, and Entropy Analysis

In this section, we evaluate the proposed system on six selected ordinary images. After their ciphering, the PSNR, SSIM, NC, and entropy factors are computed. Table1 gives the simulation results.Table 1
PSNR, SSIM, NC, andE values of the encrypted image.
ImageEPSNRNCSSIMLena7.999354.495−0.00100.0101Peppers7.999324.721−0.00150.0094Baboon7.999324.4800.00110.0101Walkbridge7.999354.6670.000190.0085Cameraman7.999324.2910.00260.0092Jetplane7.999364.295−0.00300.0107For analysing the obtained results, we start by the entropy factor. Theoretically, a good encryption system gives random information equal to 8 [19]. As seen in Table 1, we observe that the entropy value of the encrypted image is close to the ideal value 8. As a consequence, we can conclude that the proposed system is safe against entropy attacks. After that, we pass to analyze the obtained PSNR results. These results indicate that the PSNR is lower than 5 dB (<5 db). Following reference [21], the proposed system gives a very bad quality between the encrypted and plain images. We conclude that it is very difficult to predict the plain image from the encrypted one. By analysing the SSIM factors between the plain and encrypted images. As shown in Table 1, we note that the SSIM values are close to 0. We conclude that we cannot distinguish the content of the clear image from the encrypted one.For evaluation of the proposed encrypted system, a comparative study of the Lena image with some recent work for entropy and PSNR evaluation tools is presented in Table2. We conclude that the proposed system gives the best results against many other ciphering systems.Table 2
Comparative study of the PSNR andE values for the Lena image.
CryptosystemPSNRE[13]—7.99920[22]—7.99122[23]10.04547.75970[24]—7.90303[25]9.30007.99910[26]—7.99730Proposed algorithm4.4957.99935


## 3.1.3. Correlation Coefficient Analysis

In an ordinary image, the correlation of the adjacent pixels is close to one. Unlike in an encrypted image, the adjacent pixels are not correlated [27]. Let x and y be two gray scale values of two adjacent pixels in the image; the correlation of the adjacent pixels is computed using the following equations:(12)Ex=1N∑i=1Nxi(13)Dx=1N∑i=1Nxi−Exi2,(14)covx,y=1N∑i=1Nxi−Exyi−Ey,(15)rxy=covx,yDxDy.E (x) is the expectation of x, D (x) is the estimation of the variance in x, and cov (x, y) is the estimation of the covariance between x and y. Table 3 shows that the encrypted images correlation coefficients are close to zero. So, we cannot distinguish the content of the clear image from the encrypted one. Table 4 shows the distributions of 2000 pairs of randomly selected adjacent pixels of the original and encrypted Lena image, respectively.Table 3
ρ and NC values of the original image and its corresponding encrypted image.
ImageStatusNCHorizontalVerticalDiagonalLenaPlain−0.00100.804820.819420.82776Cipher0.00027−0.01339−0.07913PeppersPlain−0.00150.846790.973350.88347Cipher0.00638−0.06850−0.05433BaboonPlain0.00110.830450.876790.87929Cipher0.00742−0.00602−0.10326WalkbridgePlain0.000190.871080.879340.84997Cipher0.000930.00380−0.00776CameramanPlain0.00260.877900.890790.90087Cipher0.00226−0.00774−0.00580JetplanePlain−0.00300.808390.816430.82083Cipher−0.059280.00381−0.15028Table 4
Distribution of 2000 pairs of randomly selected adjacent pixels for the Lena image.
ImageHorizontalVerticalDiagonalOriginal LenaEncrypted LenaThe results clearly show that the correlation coefficient of the original images is close to 1, while that of the encrypted images is close to zeros. In addition, the distribution of adjacent pixels is inconsistent; i.e., there is no correlation between them. This indicates that the algorithm eliminates the correlation of adjacent pixels in the plain image, and it makes an encrypted image with no correlation. A comparative study of the Lena image with some recent works for the correlation coefficient evaluation tool is presented in Table5. We conclude that the proposed system gives the best results against other works.Table 5
Comparative study of the correlation coefficient for the Lena image.
WorkHorizontalVerticalDiagonal[3]−0.0004−0.00180.0001[13]0.02650.07920.0625[22]−0.00010.00890.0091[23]0.05910.05080.0480[24]−0.0294−0.0014−0.0180[25]−0.00470.00150.0030[26]−0.02260.00410.0368Proposed system0.0002−0.0133−0.0791


## 3.2. Key Analysis

Here, we describe the key space, key sensitivity, and randomness analysis test to evaluate the strength of the encryption scheme against hackers.


### 3.2.1. Key Space

The key space of a safety encryption scheme should be very large to resist the brute-force attack. In the proposed algorithm, for an initial keyKi, there are 2256 dissimilar keys, which is very large. Certainly, the key brute-force attacks are computationally infeasible. Table 6 gives a comparative study of the key space with other recent encryption algorithms.Table 6
Comparative study of the key space.
WorkKey space[7]3.4 × 1038[22]10117[24]2208Proposed algorithm2256


### 3.2.2. Key Sensitivity

For high safety encryption, the encryption algorithm must be sensitive to the entered image and the initial secret keyKi. A very small change (one bit) in Ki, or in the image, will cause a greatly significant change in the output generated keys for encryption and output image. Key sensitivity can be achieved by using the Number of Changing Pixel Rate (NPCR) and Unified Averaged Changed Intensity (UACI) randomness tests to evaluate the robustness of the image against differential hackers [28], which are described as follows:(16)NPCR=1S∑Di,j×100%,(17)UACI=1S∑dG×100%,where S is the size of the image and D (i, j) is a logical value affected by the following cases:(18)Di,j=0,I1i,j=I2i,j,1,I1i,j≠I2i,j,where d is the difference between two pixels on the image with the same coordinates.(19)d=p1i,j−p2i,j.However, a sensitivity test applied to the initial key is performed using two initial keys,Ki1 and Ki2, but Ki2 is different by one bit from Ki1 to encrypt the same image. After that, we try decrypting the obtained images by a wrong key. Here, the two keys, Ki1 and Ki2, are permuted in the decryption step, i.e., each image is decrypted by a wrong key which is different by one bit from the correct key. This test is carried out with many Ki keys which are randomly chosen to properly evaluate the algorithm. Simulation results for the Lena image are shown in Figure 5 and Table 7.Figure 5
Key sensitivity test applied on the initial key: (a) encrypted Lena by keyKi1, (b) encrypted Lena by key Ki2, (c) difference between (a) and (b), (d) decrypted (a) by key Ki2, (e) decrypted (b) by key Ki1, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 7
NC, NPCR, and UACI tests applied on the initial key.
ImageNPCR (%)UACI (%)NCLena99.6936933.191170.00170Peppers99.7531833.287260.00292Baboon99.6556033.95780−0.05231Walkbridge99.6637033.498200.00419Cameraman99.6955633.50594−0.00379Jetplane99.7547133.39463−0.01982It is remarkable that our algorithm is highly sensitive to the initial key for simultaneous encryption and decryption phases. The NC value between the two encrypted images is very weak, i.e., there is no similarity coefficient between them. Besides, the difference between them is another image. In addition, the NPCR and UACI percentages are important, which signifies that the encrypted images are greatly dissimilar. We conclude that the plain image cannot be recovered using a wrong key by one bit. The same sensitivity is obtained by all randomly chosen keys.Furthermore, we perform a key sensitivity test, applied on the original image, using two images, I1 and I2, but the second one is different by one bit from the first one. The change is selected randomly. The NPCR and UACI simulation for the Lena image are presented in Figure6, and the simulation results for all images are introduced in Table 8.Figure 6
Key sensitivity test applied on the plain image: (a) encrypted original Lena, (b) encrypted modified Lena, (c) difference between (a) and (b), (d) decrypted (a) by keyKi1, (e) decrypted (b) by key Ki2, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 8
NC, NPCR, and UACI tests applied on the image.
ImageNPCR (%)UACI (%)NCLena99.6595033.711200.00157Peppers99.6055633.643220.00109Baboon99.7066433.809290.00370Walkbridge99.7566033.275210.00102Cameraman99.6044133.42789−0.00259Jetplane99.6065633.36627−0.15490As shown in the aforementioned simulations results, it is clear that our encryption design is very sensitive to a tiny change in the entered image. This demonstrates the effectiveness of the SHA-256 function, which puts an image’s initial key specific for encryption. Table9 gives a comparative study of the NPCR and UACI evaluation tests with some recent work.Table 9
Comparative study of NPCR and UACI tests for the Lena image.
ImageNPCR (%)UACI (%)[7]99.6100033.4800[8]99.6250033.451000[9]99.6078033.45100[12]99.6416333.39537[23]99.6323033.12500[24]99.6100033.53000[29]100.000033.43150[26]99.5894833.46458[30]99.6253033.48070Proposed algorithm99.6595033.83002


### 3.2.3. Randomness Analysis

Random analysis can be achieved using the NIST 800-22. The test is useful to test random and pseudorandom number generators [31] to determine whether or not a PRNG is appropriate for data encryption. The analysis contains 15 tests that assess key streams to meet important necessities. It focuses on different nonrandom aspects that can be found in a key sequence. The test results of 262144 sequences of 128 bit generated by the proposed PRNG are shown in Table 10. The sequences pass all tests successfully. This demonstrates that the generated pseudorandom numbers have good statistical properties such as being highly unpredictable, random, independent, and uniformly distributed.Table 10
Test results of the NIST 800-22 for the proposed PRNG.
StatisticalP valueStatusStatus frequency0.8755390PassBlock frequency (m = 128)0.3924558PassForward cusum0.6371194PassReverse cusum0. 6371194PassRuns0. 6371194PassLong runs of ones0. 6371194PassBinary matrix rank0.4372742PassSpectral DFT0. 8755390PassNonoverlapping template (m = 9)0. 1463590PassOverlapping template (m = 9)0.5449921PassUniversal0.0713232PassApproximate entropy (m = 10)0.0125474PassRandom excursions (x = +1)0.9030558PassRandom excursions variant (x = -1)0.3974291PassLinear complexity (M = 500)0.1922722Pass


## 3.2.1. Key Space

The key space of a safety encryption scheme should be very large to resist the brute-force attack. In the proposed algorithm, for an initial keyKi, there are 2256 dissimilar keys, which is very large. Certainly, the key brute-force attacks are computationally infeasible. Table 6 gives a comparative study of the key space with other recent encryption algorithms.Table 6
Comparative study of the key space.
WorkKey space[7]3.4 × 1038[22]10117[24]2208Proposed algorithm2256


## 3.2.2. Key Sensitivity

For high safety encryption, the encryption algorithm must be sensitive to the entered image and the initial secret keyKi. A very small change (one bit) in Ki, or in the image, will cause a greatly significant change in the output generated keys for encryption and output image. Key sensitivity can be achieved by using the Number of Changing Pixel Rate (NPCR) and Unified Averaged Changed Intensity (UACI) randomness tests to evaluate the robustness of the image against differential hackers [28], which are described as follows:(16)NPCR=1S∑Di,j×100%,(17)UACI=1S∑dG×100%,where S is the size of the image and D (i, j) is a logical value affected by the following cases:(18)Di,j=0,I1i,j=I2i,j,1,I1i,j≠I2i,j,where d is the difference between two pixels on the image with the same coordinates.(19)d=p1i,j−p2i,j.However, a sensitivity test applied to the initial key is performed using two initial keys,Ki1 and Ki2, but Ki2 is different by one bit from Ki1 to encrypt the same image. After that, we try decrypting the obtained images by a wrong key. Here, the two keys, Ki1 and Ki2, are permuted in the decryption step, i.e., each image is decrypted by a wrong key which is different by one bit from the correct key. This test is carried out with many Ki keys which are randomly chosen to properly evaluate the algorithm. Simulation results for the Lena image are shown in Figure 5 and Table 7.Figure 5
Key sensitivity test applied on the initial key: (a) encrypted Lena by keyKi1, (b) encrypted Lena by key Ki2, (c) difference between (a) and (b), (d) decrypted (a) by key Ki2, (e) decrypted (b) by key Ki1, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 7
NC, NPCR, and UACI tests applied on the initial key.
ImageNPCR (%)UACI (%)NCLena99.6936933.191170.00170Peppers99.7531833.287260.00292Baboon99.6556033.95780−0.05231Walkbridge99.6637033.498200.00419Cameraman99.6955633.50594−0.00379Jetplane99.7547133.39463−0.01982It is remarkable that our algorithm is highly sensitive to the initial key for simultaneous encryption and decryption phases. The NC value between the two encrypted images is very weak, i.e., there is no similarity coefficient between them. Besides, the difference between them is another image. In addition, the NPCR and UACI percentages are important, which signifies that the encrypted images are greatly dissimilar. We conclude that the plain image cannot be recovered using a wrong key by one bit. The same sensitivity is obtained by all randomly chosen keys.Furthermore, we perform a key sensitivity test, applied on the original image, using two images, I1 and I2, but the second one is different by one bit from the first one. The change is selected randomly. The NPCR and UACI simulation for the Lena image are presented in Figure6, and the simulation results for all images are introduced in Table 8.Figure 6
Key sensitivity test applied on the plain image: (a) encrypted original Lena, (b) encrypted modified Lena, (c) difference between (a) and (b), (d) decrypted (a) by keyKi1, (e) decrypted (b) by key Ki2, and (f) difference between (d) and (e).
(a)(b)(c)(d)(e)(f)Table 8
NC, NPCR, and UACI tests applied on the image.
ImageNPCR (%)UACI (%)NCLena99.6595033.711200.00157Peppers99.6055633.643220.00109Baboon99.7066433.809290.00370Walkbridge99.7566033.275210.00102Cameraman99.6044133.42789−0.00259Jetplane99.6065633.36627−0.15490As shown in the aforementioned simulations results, it is clear that our encryption design is very sensitive to a tiny change in the entered image. This demonstrates the effectiveness of the SHA-256 function, which puts an image’s initial key specific for encryption. Table9 gives a comparative study of the NPCR and UACI evaluation tests with some recent work.Table 9
Comparative study of NPCR and UACI tests for the Lena image.
ImageNPCR (%)UACI (%)[7]99.6100033.4800[8]99.6250033.451000[9]99.6078033.45100[12]99.6416333.39537[23]99.6323033.12500[24]99.6100033.53000[29]100.000033.43150[26]99.5894833.46458[30]99.6253033.48070Proposed algorithm99.6595033.83002


## 3.2.3. Randomness Analysis

Random analysis can be achieved using the NIST 800-22. The test is useful to test random and pseudorandom number generators [31] to determine whether or not a PRNG is appropriate for data encryption. The analysis contains 15 tests that assess key streams to meet important necessities. It focuses on different nonrandom aspects that can be found in a key sequence. The test results of 262144 sequences of 128 bit generated by the proposed PRNG are shown in Table 10. The sequences pass all tests successfully. This demonstrates that the generated pseudorandom numbers have good statistical properties such as being highly unpredictable, random, independent, and uniformly distributed.Table 10
Test results of the NIST 800-22 for the proposed PRNG.
StatisticalP valueStatusStatus frequency0.8755390PassBlock frequency (m = 128)0.3924558PassForward cusum0.6371194PassReverse cusum0. 6371194PassRuns0. 6371194PassLong runs of ones0. 6371194PassBinary matrix rank0.4372742PassSpectral DFT0. 8755390PassNonoverlapping template (m = 9)0. 1463590PassOverlapping template (m = 9)0.5449921PassUniversal0.0713232PassApproximate entropy (m = 10)0.0125474PassRandom excursions (x = +1)0.9030558PassRandom excursions variant (x = -1)0.3974291PassLinear complexity (M = 500)0.1922722Pass


## 3.3. Encryption Algorithm Speed

In real-time image processing, the execution time is a major constraint. In a software implementation, the speed of execution mainly depends on the CPU performance. The proposed algorithm is implemented using Matlab R2017a software running on a personal computer with CPU Intel Core-i7-3770 3.4 GHz frequency. We can use approximate equations (20) and (21) to compute the speed (S) and the number of cycles per byte (CpB) taken by an encryption algorithm running on a specific processor [18].(20)S=DSTMBs,(21)CpB=CpSS.DS is the data size,T is the time taken to execute the algorithm on a CPU, and CpS is the CPU frequency. We compare the proposed algorithm with recent works presented in Table 11.Table 11
Comparative study of encryption algorithm speed.
WorkUsed toolsArchitectureS (MB/S)CpB[4]AES-128 CBCXor diffusion0.0021400000[8]Logistic-Tent and Tent-SineConfusion/diffusion0.19010520[9]3D sine chaotic mapConfusion/diffusion0.9703298[12]SHA-256/Liu systemXor diffusion1.5001600[10]MD5/PWLCM/DNAConfusion/diffusion7.540398[11]SHA-3/Tent map/DCTTransformation/permutation/diffusion0.10020000[25]Tent mapXor diffusion0.14016142[26]Chebyshev map/A. Tent map/LWT/LFTPermutation/substitution/diffusion0.019147368Proposed algorithmSHA-256/CTR/PRNGXor diffusion9.567355It is clear that the proposed scheme has the best result in terms of speed and architecture complexity. We note that the permutation and substitution operations depend on more time than diffusion operation. Although, the proposed cryptosystem uses only diffusion operation with low computational complexity, and it gives the best performance.


## 4. Conclusions

In this work, we have suggested an efficient cryptosystem for numerical image protection and authentication. The proposed algorithm is a hybrid scheme, which combines a symmetric and an asymmetric scheme. The SHA-256 is utilized for initial secret key generation related to the original image and the owner’s signature. The RSA asymmetric encryption system is used for encrypting the initial and owner’s signature that permit secret key exchanging and authentication. A PRNG-CTR-based Xor confusion is adopted as the symmetric scheme for entire image encryption. The PRNG-CTR is based on the Lorenz chaotic system which is designed to generate a high-quality key. The evaluation and analysis results demonstrate that the algorithm offers high performance and enhanced security with low computational complexity. The PRNG-CTR is tested by the NIST, and the result indicates that it is suitable for image encryption.We noted that the proposed architecture has a many advantages such as flexibility for key extension which leads to increase the key space. In addition, this architecture is easily parallelizable to speed up execution for meeting real-time application requirements.The comparative study with recent work indicates that the proposed algorithm provides the best performance. However, it is extremely adapted for image encryption and authentication, which can be used in several domains.



---

*Source: 8937676-2020-11-02.xml*