Encryption and Decryption of Digital Images Using the XOR Algorithm

Zwha Abdulhmid Mohamed Albeerish
( Faculty member, Department of Computer Science, Faculty of Science, University of Benghazi, Libya )
Saedah Mohammed Omar Albeerish
( Faculty member, Department of Computer Science, Faculty of Science, University of Benghazi, Libya )

This research demonstrates the performance of the XOR algorithm in symmetric encryption and decryption of digital images, which is important for the safe transfer of data by internet. The method uses the inherent properties of XOR, such as the bitwise exclusivity (where A⊕0=A and A⊕A=0) and commutative nature to generate a pseudo-random keystream from which a private-key is applied on. This keystream is then used to perform pixel-wise XOR operations on picture data formats like BMP, JPEG and PNG. This approach transforms the starting pixel values within color channels into a ciphered image without changing the dimensions or memory requirements, thereby preserving confidentiality, integrity, and rapid recovery by employing the same keystream. MATLAB was used to implement XOR algorithm by translated picture matrices in to integers. Analysis of the original images’ histograms against the encrypted ones indicated equality in terms of the metrics involved, including means, which stood at 129.57 and 127.50, variance at 5445.09, and entropy at 7.25, thereby indicating uniformity of the pixels in the histograms of the encrypted images, thus improving their resistance towards cryptanalytic attacks. The paper indicates how the use of symmetric XOR encryption proves much more efficient in computing terms compared to the asymmetric approach such as RSA, which involves high computing costs and may prove difficult when it comes to encrypting very large images. It shows how XOR encryption minimizes computational time and is able to handle issues of key reuse efficiently, making it suitable for application in the context of live streams and signals

https://doi.org/10.65723/RMSP2680

مشاركة المقال