## 4 Design, Implementation and Analysis Results of the Image Encryption Algorithm
### Image Encryption Application and Security Analysis  
In this section, by using the developed image encryption algorithm, encryption and decryption processes have been performed on three different images. Also, security analyses of encryption processes have been realized. Original image files, 256\(\times\)256, that were used in encryption can be seen in Figure 7a-c encrypted images are in Figure 7d-f and decrypted image files are located in Figure 7g-i. When the original and decrypted image files are compared, it appears that the encryption process has been successful. Figure 6: The proposed new encryption algorithm. Following the encryption process, performance analyses have been performed to determine the quality of the encryption process. First, a histogram analysis of the encryption process has been performed. In Figure 8a-c, histogram distribution graphs of the encrypted image files are shown. Histogram distribution shows the distribution of pixel values in the image file. The more balanced the distribution, the more successful the encryption has been performed. Correlation coefficient and correlation analysis [62] shows the independence of the relation of the two random variables. When the correlation distribution is linear, there is strong relation between variables and the encryption is not good. So, the distribution should be nonlinear. Correlation distribution graphs are shown in Figure 8d-f, and the calculated correlation coefficients are located in Table 5. When the correlation distribution graphs are examined, it is seen that the encryption processes had a good correlation distribution and the correlation coefficients are close to zero in Table 5.  
Figure 7: The result of image encryption. (**a**) original fan image, (**b**) original city image, (**c**) original baboon image, (**d**) encrypted fan image, (**e**) encrypted city image, (**f**) encrypted baboon image, (**g**) decrypted fan image, (**h**) decrypted city image, (**i**) decrypted baboon image. Other analyses performed on the encryption process is the number of pixels change rate (NPCR) and unified average changing intensity (UACI) [23]. They are cryptanalysis methods to determine resistance of encryption against differential attacks. They are used for detection of effects of small changes in the original images to encrypted images. Table 5 shows the calculated NPCR and UACI values of the performed encryption processes. It has been found that the NPCR values are very close to the results in [63]. That means the pixel values of the images have been changed because of the encryption. Also UACI values are very close to optimum. Information entropy [64] is used to measure randomness and complexity of encrypted data. Encrypted data should be very complex and there must not be any information about the original data. Optimum value of information entropy is eight for an gray scale information. When the entropy values of the encryption processes in Table 5 are examined, it is seen that they are very close to eight. This means that the encryptions in this study are good. Encryption quality is obtained by calculating the differences of the pixel values between the encrypted and original images. If the difference values are greater, the encryption quality is higher. In Table 5, the values of encryption quality are given as 35.8046, 45.3828 and 61.4676 for three images. From the results, it can be seen that the baboon image has the best encryption quality. The encryption and decryption time of the algorithm is very important for performance and usefulness. To show performance of the developed encryption algorithm, encryption and decryption times have been determined as in Table 5. As seen from the results, all of the encryption and decryption processes are performed in approximately 1 s totally. In Table 6, the comparison of the encryption times of