Extensive Analysis on Images Encryption using Hybrid Elliptic Curve Cryptosystem and Hill Cipher

Corresponding Author: Zurina Mohd Hanapi Department of Communication Technology and Network, Faculty of Computer Science and Information Technology, Universiti of Putra Malaysia, Serdang, Selangor, Malaysia Email: zurinamh@upm.edu.my Abstract: The advancement of communication technology helps individual to share images through an Internet. However, the sharing through insecure channels may expose the images to certain attacks that will compromise their confidentiality. Image encryption is one of the methods used to protect against the confidentiality threat. A Hill Cipher has been applied in image encryption because of its simple operation and fast computation, but it also possesses a weak security level which requires the sender and receiver to use and share the same private key within an unsecure channel. Thus, there are many solutions been proposed in utilizing hybrid approach of Hill Cipher where one of them is Elliptic Curve Cryptosystem together with Hill Cipher (ECCHC) to utilize the beauty of Hill Cipher while managing its weaknesses. However, the ECCHC only been experimented over four images which leads to inaccuracy of the results. Thus, this study extended the experiments on 209 images from USC-SIPI database in order to investigate the efficiency of ECCHC. The result shows the ECCHC produces poor performances on security analysis on grayscale and RGB images, which then concludes it is not suitable to encrypt grayscale and RGB images.


Introduction
Most of current communication technology use images to convey information, which include email, social media, text message and so on. However, sharing through unsecure channels may expose the images and other data to untrusted parties or attackers. Thus, the data i.e., images should be protected from adversary to avoid further cyber-attacks (Thein et al., 2017). The images should only be known to the authorized sender and receiver. To address the issue, cryptography technique is the most common way to secure the images transmissions occurring over the Internet (Patel and Belani, 2011).
There are two common types of cryptography, which are symmetric and asymmetric encryption. Symmetric concept uses the same private key for encryption and decryption process. For asymmetric, the sender will use public key to enable the encryption process, while the receiver will use his/her private key to enable the decryption process. Elliptic Curve Cryptosystem (ECC) which was proposed separately by (Miller, 1985;Koblitz, 1987) is an example of effective public key cryptography technique (Dawahdeh et al., 2018). ECC possesses the advantages of small key, rapid computation and high level security (Zhang et al., 2012).

Related Works
A Hill Cipher algorithm is one of the symmetric techniques which been used by several researches to encrypt an image due to its simple structure and fast computations. The image encryption using an Advanced Hill Cipher algorithm has been introduced by (Acharya et al., 2007) to solve the problem of the inverse key matric that usually did not exist in Hill Cipher algorithm, hence, eliminating the computation need to be done by the receiver to compute the inverse key. Acharya et al. (2010) was then modified the original Hill Cipher with an involuntary key by using iterations and interlacing. However, the solution only focused on a single grayscale image, thus making the result unreliable due to limited analysis. At the same time, (Hamissa et al., 2011) also overcame the weakness of the original Hill Cipher by introducing a new architecture of encoder-decoder named Coincidence to secure JPEG images by modifying the dynamic key generation, which produced the enhanced secure key matrix that resisted against the so-called plaintextciphertext attack. Moreover, to improve the entropy of the cipher image, few encryption techniques which combined Hill Cipher algorithm with bit rotation and reversal technique have been proposed (Panduranga and Kumar, 2012;Panduranga et al., 2012).
Futhermore, (Mahmoud and Chefranov, 2014) then modified the Hill Cipher to make Hill Cipher algorithm secure over the brute force, statistical attack and plaintext-ciphertext attack. This algorithm is known as HCM-PRE scheme. Sun and Guo (2015) later employed the Hill Cipher in their proposed image encryption algorithm by combining it with steganography technique based on contourlet. At the same time, hybrid of Chaos and Hill Cipher Based Image Encryption which included permutation and diffusion processes was proposed by (Naveenkumar et al., 2015) is another alternative to conventional Hill Cipher algorithm. Moreover, (Sazaki and Putra, 2016) combined the method of affine transform with the Advanced Hill Cipher. Goutham et al. (2017) is then modified the technique used by (Acharya et al., 2007) with a slight modification in terms of the key used which was 128 bits. However, this technique is vulnerable to statistical model-based attack, as the attackers will study the predictability of particular elements or the predictable relationship of some data segments between plain and cipher image due to result of correlation between plain image and cipher image, which is high, compared to other methods.
Even Hill Cipher algorithm is one of the popular symmetric techniques with a simple structure, high throughput and high speed, however it possesses weak security because it requires the sender and receiver to use and share the same private key via unsecured channels (Hill, 1929;Acharya et al., 2009;Dawahdeh et al., 2018). Due to this matter, (Dawahdeh et al., 2018) introduced a new image encryption technique combining Elliptic Curve Cryptosystem with Hill Cipher (ECCHC) to overcome the weakness mentioned. Thus, this combination technique makes the ECCHC technique as an asymmetric technique. This paper then extends the analysis by using images from USC SIPI database and MATLAB software for ECCHC encryption as well as decryption process to examine the reliability of ECCHC. The USC-SIPI image database is a collection of digitized images maintained primarily to support research in image processing, image analysis and machine vision (USC-SIPI, 2020).

Elliptic Curve Cryptosystem with Hill Cipher
There are three algorithms used; particularly Key Generation Algorithm, Encryption Algorithm and Decryption Algorithm. The initial stage of this technique requires the usage of the same Elliptic Curve Function E agreed by both sender and receiver and the domain parameters {a, b, p and G} are shared by the sender where a and b is the coefficient of the elliptic curve function, p is the large prime number and G is the generator point. In the case of key generation, user A represents the sender and user B represents the receiver. The private key from interval [1, p-1] is chosen by each user; nA represents private key for user A, meanwhile nB is the private key for user (Dawahdeh et al., 2018) defined the public key for each user as in Eqs. (1-2): The private key of each user is multiplied with the public key of other user to produce the initial key K1K1 as in (3) before further computed in Eqs. (4-5): In this stage, self-invertible 44 key matrix is generated to enable the encryption and decryption of the image. Self-invertible matrix is a matrix equal to its inverse matrix or K = K 1 K = K 1 . To generate a selfinvertible 44 key matrix Km, a proposed method by (Acharya et al., 2007) is used. Km is a self-invertible that can be viewed as Eq. (6) where, I is the identity matrix. The details algorithm of the key generation is determined as in Step 1-3 in (Dawahdeh et al., 2018). The next stage requires the use of Hill Cipher Algorithm. The linear algebra equation for Hill Cipher can viewed as Eq. (8) (Agrawal and Gera, 2014). Where: In this technique, each letter in the plaintext is assigned to numerical value. Then, the plaintext is divided into blocks consist of the same size m as the key matrix size, m  m. For example, the block size of four (P41) required the key matrix (P44) of size 44 (Dawahdeh et al., 2018). Based on Eq. (8), the ciphertext block with size 41 is generated as follows (Agrawal and Gera, 2014 As proposed by (Dawahdeh et al., 2018), the image pixel values are separated into blocks of size four and each block are converted to a vector of size 41 (P1, P2, P3,…). Ciphertext image C (C1, C2, C3,…) is generated by multiply self-invertible key matrix, Km by each vector and taking the modulo 256. Then, the ciphered image C is reconstructed from the values in the ciphered vectors and send it to the receiver. To generate the complete ciphered image, the following calculation are repeated for each block (Dawahdeh et al., 2018) The decryption process starts when the recipient receives the ciphered image. In the decryption process, the ciphered image undergoes the same techniques as the encryption process in order to generate the decrypted image (Dawahdeh et al., 2018).

Implementation
To illustrate the example of ECCHC implementation, we used the same example as described by (Dawahdeh et al., 2018) but with different image. Assume that User A wants to send an image M to user B by using the elliptic curve function where they both agreed on, which is: and these values satisfied the condition:  (Dawahdeh et al., 2018).
If user A wants to send any grayscale or RGB colour image with any size of 256256, 512512 or 10241024 to User B, both users should apply ECCHC technique on the image described in the next steps. To illustrate the implementation of ECCHC technique, Walter Cronkite (Frame 1) image from USC SIPI Database is used. This image is a grayscale image with size of 256256 pixels. Fig. 1 shows Walter Cronkite (Frame 1) images that have been encrypted and decrypted by the ECCHC.
Step 1: Key Generation

Security Analysis
In this section, the security analyses for the proposed technique are been elaborated; entropy, PSNR and UACI of the encrypted images.

Entropy
The first security parameter is entropy. Generally, the information entropy is an evaluation of the uncertainty degree in the system, which also can be used to express the uncertainty in image encryption. Zhang et al. (2010). Theoretically, eight is the ideal entropy value for the grayscale image with size 256256 (Dawahdeh et al., 2018). This concept is also applied on the RGB color images. If the entropy value of the cipher image is nearly equal to 8, the information leakage during encryption process is negligible (Zhu et al., 2011). The formula of the entropy is shown Eq. (9) where, P(x) is the probability of the pixel value x and computed by Eq. (10):

The frequency of the pixel value x Px
Total number of theimage pixels  (10)

Peak Signal to Noise Ratio (PSNR)
Peak Signal to Noise Ratio, often-abbreviated PSNR, is the ratio between the plain image and the cipher image. The higher the PSNR value, the closer the cipher image to its plain image (Sethi and Vijay, 2013). Higher values of PSNR mean that the loss data in cipher image is negligible, which means the cipher image is almost identical to plain image (Rajput and Gulve, 2014). For good image encryption technique, PSNR value should be the most minimum. Lower PSNR values of cipher image would make it difficult to recover the plain image from its corresponding cipher image, without the knowledge of correct key of decryption. The Eq. (11) is used to compute PSNR (Taneja et al., 2012). We can observed that, if MSE is increased, it will cause the PSNR decrease. The high value of MSE and low value of PSNR indicates that the plain and cipher image are different and not identical and this leads to an efficient encryption technique (Dawahdeh et al., 2018;Naskar and Chaudhuri, 2014).

Unified Average Changed Intensity (UACI)
UACI is the common value used to evaluate the performance of image encryption technique against the differential attack (Wu et al., 2011). Differential attack is a chosen plaintext attack, where the cryptanalyst has made a slight change on the chosen plain image to produce the cipher image. Then, a cryptanalysis will deduce the statistical relationship between cipher image and the corresponding chosen plain image by computing the differences between them. UACI reflects the difference of average intensity between cipher image and plain image (Taneja et al., 2012). To determine the robustness of the image encryption technique against differential attack and attain higher sensitivity of the alteration on the plain image, UACI should be nearly equal to 33.5 (Kabirirad and Hajiabadi, 2015). UACI can be calculated using the Eqs. (13-14) (Li and Lo, 2018): , 100% Where: A(i,j) = The pixel value of the plain image B(i,j) = The pixel value of the cipher image

Security Analysis based on Limit Value
In this analysis, 209 images from (USC-SIPI, 2020) database were used as a dataset. These images are grayscale and RGB color images with variety size of 256256, 512512 and 1024 pixels. The results of the experiments consist of a wide range of value for each security parameter as it involves multiple numbers of images. Thus, a limit value (benchmark) to determine a good result must be set. The limit value is chosen based on the results of (Dawahdeh et al., 2018) due to the fact that the author claimed the produced results are good.
The following values were chosen: i. 7.9848 was pinpointed as limit value for entropy ii. 9.7483 was pinpointed as limit for PSNR iii. 26.9087 was pinpointed as limit value for UACI These three limit values were chosen among the others because they are the farthest from their ideal value, besides they are also significant as the original author claimed them as good results. Table 2 shows that, 109 grayscale images show good results of entropy because the entropy of this encrypted images are greater equal to 7.9848. On the other hand, 50 grayscale images acquire bad results of entropy as they produced entropy values lower than 7.9848.
This shows that, 69% of the total number of grayscale images produced good results of entropy, meanwhile 31% of the total number of grayscale images presented bad results of entropy. As this study focuses on the confidentiality of the encrypted images, thus, the acceptable percentage for confidentiality is 100% because we cannot afford any compromise on the confidentiality. Based on security risk assessment survey done by (Casas, 2006), 100% of the respondents agreed that confidentiality is important despite any situation. Due to that, ECCHC technique should provide 100% of confidentiality and this percentage will be a benchmark to analyze further result regarding percentages. Thus, the analysis concludes that the ECCHC technique produces inefficient result of entropy for grayscale image since 69% is lower than 100%. Table 3 shows that 126 grayscale images have good results for PSNR because the values for these encrypted images are lower equal to 9.7483, on the other hand, 33 images obtained bad results of PSNR because their PSNR values are higher than 9.7483. This shows that the percentage for good results of PSNR is 79% and the percentage for bad results of PSNR is 21%. Based on this analysis, it is appropriate to conclude that ECCHC technique is unable to produce good result of PSNR for grayscale image because 79% is considered as low percentage because it is lower than 100%.    Table 4, 124 grayscale images guaranteed good results of UACI due to values to be greater equal to 26.9087. However, 35 grayscale images produced bad results of UACI as UACI of these encrypted images are lower than 26.9087. This shows that 78% of the total number of grayscale images have good results of UACI, while 22% from total number of grayscale images represent the bad results of UACI. Therefore, ECCHC technique is also unable to produce good result of UACI since 78% is lower than 100%. Table 5 exhibits that 31 RGB colour images show good results of entropy as they are greater or equal to 7.9848, but 19 RGB colour images obtained bad results of entropy as these images produced entropy lower than 7.9848. This shows that 62% of total number of RGB colour images have good results of entropy and 38% of total number of RGB colour images have bad results of entropy. Thus, the ECCHC technique is again unable to produce good result of entropy for RGB colour image because 62% is a low percentage. Table 6 shows that 43 RGB colour images obtained good results of PSNR; which is lower than 9.7483. On the contrary, other 7 images produced bad results of PSNR analysis because their PSNR values are higher than 9.7483. This shows that 86% of the total number of RGB colour images represent the good results of PSNR, while the rest of the percentages, 14%, represent the bad results of PSNR. Even though 86% is quite high, yet, in this study, we must attain 100% to ensure that there is no encrypted image identical to its original image. Thus, ECCHC technique is unable to provide good result of PSNR for RGB colour image.
By referring to Table 7, 40 RGB colour image confirmed good results of UACI; where values are greater equal to 26.9087. However, 10 RGB colour images produced bad results of UACI; as they are lower than 26.9087. This shows that the percentage of RGB colour image that produced good results of UACI is 80%, while 20% of the total number of RGB images produced bad results of UACI. Hence, ECCHC technique is also unable to provide good result of UACI for RGB colour image.
From Tables 2-7, it can be observed that several images produced not good results for the three security parameters. Hence, we concluded that ECCHC technique does not provide good results of entropy, PSNR and UACI for both grayscale and RGB colour image.
However, the analysis had been extended by categorizing the encrypted images as work well, moderate and not work well to determine the security level for each of the images. The requirements for these three categories are summarized in Table 8.
As shown in Table 8, to ensure the encrypted image is labelled as work well, the entropy of the encrypted image should be greater equal to 7.9848 because work well encrypted images should have entropy that closer to 8. Besides, the encrypted images should have PSNR lower equal to 9.7483 because the lower PSNR value of the cipher image makes it difficult to recover the original image from its corresponding cipher image and the last requirement to be defined as work well category is that UACI should be greater or equal to 26.9087. This is because, UACI should be closer to 33.5 to ensure that the technique is secure against differential attack.
Meanwhile, for a not work well category, all the requirements must contradict to the requirements of work well category. Thus, the encrypted images labelled as not work well should have the entropy lower than 7.9848, PSNR must be higher than 9.7483 and UACI lower than 26.9087. Lastly, for moderate category, the encrypted images should not fulfil at least one requirement of work well category.
The pie charts shown in Figs. 2 and 3 represent the number of encrypted images labelled as work well, not work well and moderate for grayscale and RBG colour images, respectively.    Therefore, ECCHC technique does not guarantee providing an image encryption with 100% work well on all grayscale and RGB images and does not guarantee that these encrypted images are 100% resist against entropy attack, differential attack (due to entropy and UACI value that is far away from their identical value) and the cipher image might reveal the secrecy of the plain image as well due to high value of PSNR.

Analysis on the Actual Data (Encrypted Images)
In this experiment, analysis is done on actual data by observing the encrypted images labelled as work well and moderate. This is to ensure the secrecy of the plain image cannot be seen through encrypted image. Through an observation, for work well encrypted image, there is no secrecy being exposed. However, for moderate encrypted images, there are some images that exposed as part of the secrecy of the plain images. The results of moderate encrypted images are represented by pie charts in Fig. 4 and 5 for grayscale and RGB colour images, respectively.
Based on Fig. 4, 56% of the moderate encrypted grayscale images (23 images) promise the secrecy of the plain image. However, 44% of the moderate encrypted grayscale images (18 images) are not actually encrypted well because these images exposed a part of secrecy of the plain image. Almost half of moderate encrypted grayscale images are not encrypted well and these images should be labelled as not work well.  As shown in Fig. 5, 50% of the moderate encrypted RGB colour images (7 images) successfully concealed the secrecy of the plain image and another 50% of the moderate encrypted RGB colour images (7 images) exposed a part of the secrecy of the plain image and are not encrypted well. This shows that half from the total number of moderate encrypted RGB colour images should be labelled as not work well. Based on these two results, we can conclude that the security analysis of ECCHC technique is not reliable and the analysis does not represent the confidentiality of the encrypted images for both grayscale and RGB colour image.

Conclusion
Based on the experiments and results obtained, ECCHC technique is unable to encrypt some of the grayscale and RGB colour images given that some of these encrypted images produced bad results of security analysis. The results from experiments already proved that 21 grayscale and 6 RGB colour images are labelled as not work well; hence, these images are probably vulnerable to entropy and differential attack and the encrypted image might be almost identical to plain image. Therefore, making an attack becomes an easier task for attackers. Furthermore, by extending the analysis on the actual data by doing the observation on the encrypted images, there are several images initially labelled as moderate, but they are not been encrypted well. In consequence, making the security analysis of ECCHC technique does not represent the confidentiality of the encrypted images. Even though ECCHC technique involves the ECC algorithm, ECC only work in key generation however, the encryption process is fully comes from the Hill Cipher algorithm. Therefore, Hill Cipher is not suitable to be deployed to encrypt the images.