Efficient Encryption System for Numerical Image Safe Transmission

In this paper, we propose an efficient cryptosystem for digital image encryption and authentication. *e cryptosystem is a hybrid scheme that uses symmetric and asymmetric approaches.*e first one is used to encrypt the host image by utilizing a chaos-based key generator. *e second one is used to encrypt the initial secret key and the owner’s signature that permit authentication. *e 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. *e results indicate that the proposed cryptosystem provides high performance and enhanced security. *e NIST 800-22 is used for testing the pseudorandom numbers generation (PRNG).*e obtained simulation results are better than those cited in the recent works in terms of execution time and security level and low computational complexity.


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. e 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. ereby, the data can be shared through an insecure network.
Generally, there are two encryption schemes: symmetric and asymmetric encryption. e 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. us, 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. eir scheme is a combination of the elliptic curve and AES. About that, the elliptic curves are used for generating three random sequences. ese 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]. is 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. is 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. e 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. en, the subimages were encoded using a combination between the PTSTFrFTand 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.
e key stream was obtained using the Logistic-Tent and Tent-Sine systems which were maintained in cascade. Firstly, a spectrum of multiimage 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. en, 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. en, 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. e 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. e scheme was symmetric, and they adopted confusiondiffusion as the encryption architecture. e MD5 was used to generate an initial secret key. e initial parameters of chaos maps were generated from the initial secret key. e 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. e SHA-3 was used for generating an initial secret key of the system. After that, the image was transformed, permuted, and confused. ese 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. e hash function was used to generate an initial secret key of the encryption system. e 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. en, 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. e 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.
e 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. irdly, 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. e 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.
is paper is planned in four parts as follows: In Section 2, the proposed encryption algorithm is described.
e simulation, analysis, evaluation, and validation of the proposed algorithm are given in Section 3. Section 4 concludes the work.

Proposed Cryptosystem Algorithm
is section is reserved for describing the proposed algorithm applied to digital image protection and authentication. As shown in Figure 1, the cryptosystem algorithm is a hybrid scheme. However, it uses a symmetric and an asymmetric scheme.
e 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.

Encryption
Step.
e encryption system includes three parts: key generation, image encryption, and secret key encryption. e first one is a PRNG used for a high-quality key generation. e second one is the encryption step of the whole image by using the generated key with the CTR mode of the encryption operation. e 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.

Pseudorandom Number Generator.
e 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. e Lorenz system is a mathematical model composed of three differential equations described as follows [15]: where x, y, and z are the system variables and a, b, and c are the system parameters. e 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]. e SHA-256 is used to generate a 256-bit initial secret key K i fully related to the plain image [16]. K i is divided into 8-bit blocks as follows: e initial state which consists of (x 0 , y 0 , z 0 ) of the Lorenz system is derived from K i utilizing the following equations: 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.

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. e initial vectors of the counters are derived from the initial key K i as follows: IV2 � K i (129 : 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) irdly, 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. e image encryption instruction can be described by equation (9) and the system is depicted in Figure 2.
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 Journal of Electrical and Computer Engineering 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. e 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.

Image Authentication and Key Encryption.
For image authentication, a 256-bit signature is generated fully related to the owner logo using SHA-256. e 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.
where K i is the plain key, K f is the correspondent encrypted key, and (n, e) is the public key of destination.
where K i is the decrypted key, K f is the encrypted key, and (n, d) is the private key of the destination.

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, Figure 3, to seek the plain image and detect the owner's logo. Practically, it uses the reverse algorithm, according to the encryption algorithm. is phase will take place just when the encrypted image and the key are available. e algorithm starts by decrypting the encrypted key K f by the RSA system to obtain the plain key K f . e first part, 256 bit, is the initial key K i used for image decryption, and the remaining part, 256 bit, is the owner digital signature used for image authentication. However, using K i , the received image is decrypted by the decryption system. is 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.

Experimental Results and Interpretation
e 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. is part includes statistical analysis, key analysis, and algorithm speed.

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. is 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][19][20].

Histogram Analysis.
e 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 Figure 4.
erefore, it is difficult to understand the encrypted image appearance.

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. Table 1 gives the simulation results.
For analysing the obtained results, we start by the entropy factor. eoretically, 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. ese 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 Table 2. We conclude that the proposed system gives the best results against many other ciphering systems.   Journal of Electrical and Computer Engineering

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: 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. e 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. is 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    Journal of Electrical and Computer Engineering 7 the correlation coefficient evaluation tool is presented in Table 5. We conclude that the proposed system gives the best results against other works.

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

Key Space.
e key space of a safety encryption scheme should be very large to resist the brute-force attack. In the proposed algorithm, for an initial key K i , there are 2 256 dissimilar keys, which is very large. Certainly, the key bruteforce attacks are computationally infeasible. Table 6 gives a comparative study of the key space with other recent encryption algorithms.

Key Sensitivity.
For high safety encryption, the encryption algorithm must be sensitive to the entered image and the initial secret key K i . A very small change (one bit) in K i , 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: where S is the size of the image and D (i, j) is a logical value affected by the following cases: where d is the difference between two pixels on the image with the same coordinates.
However, a sensitivity test applied to the initial key is performed using two initial keys, K i1 and K i2 , but K i2 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, K i1 and K i2 , 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. is test is carried out with many K i keys which are randomly chosen to properly evaluate the algorithm. Simulation results for the Lena image are shown in Figure 5 and Table 7.
It is remarkable that our algorithm is highly sensitive to the initial key for simultaneous encryption and decryption phases. e 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   We conclude that the plain image cannot be recovered using a wrong key by one bit. e 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. e change is selected randomly. e NPCR and UACI simulation for the Lena image are presented in Figure 6, and the simulation results for all images are introduced in Table 8.
As shown in the aforementioned simulations results, it is clear that our encryption design is very sensitive to a tiny change in the entered image. is demonstrates the effectiveness of the SHA-256 function, which puts an image's initial key specific for encryption. Table 9 gives a comparative study of the NPCR and UACI evaluation tests with some recent work.

Randomness Analysis.
Random analysis can be achieved using the NIST 800-22. e test is useful to test random and pseudorandom number generators [31] to determine whether or not a PRNG is appropriate for data encryption. e 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. e test results of 262144 sequences of 128 bit generated by the proposed PRNG are shown in Table 10. e sequences pass all tests successfully. is demonstrates that the generated  Work Key space [7] 3.4 × 10 38 [22] 10 117 [24] 2 208 Proposed algorithm 2 256 pseudorandom numbers have good statistical properties such as being highly unpredictable, random, independent, and uniformly distributed.

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. e 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].
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.

Conclusions
In this work, we have suggested an efficient cryptosystem for numerical image protection and authentication. e proposed algorithm is a hybrid scheme, which combines a symmetric and an asymmetric scheme. e SHA-256 is utilized for initial secret key generation related to the original image and the owner's signature. e 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. e PRNG-CTR is based on the Lorenz chaotic system which is designed to generate a high-quality key. e evaluation and analysis results demonstrate that the algorithm offers high performance and enhanced security with low computational complexity. e 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 realtime application requirements. e 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.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare no conflicts of interest.

Authors' Contributions
All the authors helped to conceive these simulation experiments. Mohamed Gafsi designed and performed such experiments. Indeed, both Mohamed Gafsi and Mohamed Ali Hajjaji have written the main part of the manuscript. Mohamed Gafsi, Jihene Malek, and Abdellatif Mtibaa contributed to the interpretation of the results, as well as the revision and writing of the paper.