SHA-512 Based Key Generation and Two-Dimensional Logistic Permutation with a Median Filter for Enhanced Grayscale Image Encryption
Ibtisam A. Taqi*
Computer Science Department, University of Baghdad, Baghdad, Iraq
* Corresponding Author: Ibtisam A. Taqi. Email:
Computers, Materials & Continua https://doi.org/10.32604/cmc.2026.082352
Received 14 March 2026; Accepted 23 July 2026; Published online 14 August 2026
Abstract
Multimedia technology and social media platforms like Facebook, Telegram, Viber, and WhatsApp, as well as numerous industries like communications, banking, and the military, depend heavily on images. Therefore, the biggest issue these days is safeguarding the image from theft or hacking during storage or transmission over the internet. This study suggests a novel approach of grayscale image encoding that uses a two-dimensional (2D) logistic map and the Secure Hash Algorithm (SHA). First, convert a color image to grayscale. Second, use the recently proposed equations to calculate the initial states of the Two-Dimensional Logistic Map (2DLM). Then, permute the gray image using the new coordinates produced by a 2DLM. SHA-512 is used to construct an extremely complex random key according to the plain image size. The encoded image is then produced by applying two-directional diffusion stages between the generated key and the shuffled image. Lastly, to improve the effectiveness of the proposed method in recovering the decrypted image, a median filter is applied to the decrypted image as a post-processing step. The proposed method surpasses other works by encrypting large sizes of images equal to 2048 × 2048 and achieves a high entropy approximately equal to 7.99996, a
high Number of Pixel Change Rate (NPCR)of 99.86, a high
Unified Average Changing Intensity (UACI) of 39.31%, a
low Peak Signal to Noise Ratio (PSNR) of 4.9279, and a high Mean Square Error (MSE) of 20,907. Furthermore, a high key precision of 10
−19, a high keyspace of 2
1140, a very low average correlation coefficient of 0.0006, a flat histogram, and a high speed are attained. According to the evaluation metrics, the proposed method performs better than the other tasks that were done. The system outperforms the other works in terms of security against noise attacks, in which approximately 61% of the image with 50% salt and pepper noise and up to 70% of the image with 0.1 Gaussian noise were recovered.
Keywords
Gray image; SHA-512; chaos; 2D logistic map; median filter