# A Lightweight Image Cryptosystem for Cloud-Assisted Internet of Things
## 3 Materials and Methods
### Proposed Lightweight Image Cryptography Algorithm
These results reveal that HXP is capable of securing images and that the recovered images from the cipher images are of a high quality, such that mere visual inspection cannot detect any difference between the original image and the decrypted images. 2. Encryption quality of the HXP algorithm: The encryption quality of HXP was analyzed using the metrics one to eleven. Each cipher image C, in Figure 3k-o, was compared with their corresponding original image P, in Figure 3f-j, based on these metrics. Table 3 shows the results that were obtained. The high values of EQ, MSE, MAE, NAE, MD, and AD indicate that C is very different from P. Furthermore, the low values of the metrics PSNR, SSIM, NCC, and DCC establish the fact that C is very different from P. The inability of the algorithm to produce a value of one for the metric SC is also an indication that C is different from P. Overall, these results showed that the quality of C produced by the HXP algorithm is not of the same quality as that of P. This is an indication of a secure image encryption algorithm. iii. Decryption quality of HXP: Metrics two to ten were used to measure the decryption quality of HXP. The values of these metrics were compared with the ideal values of these metrics in order to ascertain the quality of the decrypted images. Table 4 shows the results of the evaluation. The first row shows the ideal value of each metric in the heading of the table, while the subsequent rows show the obtained value for each metric in the headings of the columns of the table when the images in Figure 3p-t were compared with the images in Figure 3p-t. The second row shows the





were obtained during the key sensitivity analysis. These results reveal that HXP is very sensitive to a slight change in the plain image. * Cipher Image Sensitivity Analysis From the results shown in Table 7, it is obvious that HXP has a poor cipher image sensitivity. This is revealed from the values of PSNR, SC, SSIM, NCC, DCC MSE, MAE, NAE, MD, and AD, that were very close to the ideal values when two images of a similar quality were compared. These results revealed that there was no significant difference between the cipher image and the altered cipher image. This means that the two cipher images are of a similar quality. The obtained results for the NPCR and UACI were very far from the ideal values for the images that were different. Hence, HXP has a poor cipher image sensitivity. However, this poor cipher image sensitivity should not be seen as a weakness, as cipher image sensitivity and a chosen cipher image attack are not related. On the contrary, a cryptosystem that has a poor cipher image sensitivity is capable of resisting against certain noise interference. Hence, it can be said by these results that the proposed lightweight cryptosystem is resistant to some noise interference. * Statistical Analysis and Results
* Histogram and Chi-Square Analysis Results Each of the figures in Figures 4-8 shows the plain image, histogram of the plain image, the cipher image, and histogram of the cipher image, respectively. By visual inspection, the histograms of the plain images are not uniform, while those of the encrypted images appear uniform. The results from the chi-square tests carried out on the histograms are shown in Table 8. As shown in Table 8, the chi-square values for the plain images were very high, while the chi-square values of the encrypted images were very low. The lower the value of chi-square, the more uniform the histogram. All the \(p\)-values of the plain images were found to be less than the significance value; hence, their histogram is not uniform. In contrast, all the \(p\)-values of the encrypted images were greater than the significance value of 0.05; hence, they are uniform. These results prove that HXP is resistant to histogram analysis.