Design and Analysis of an Image Encryption Scheme Based on Magic Square and HKDF
Keywords:
magic squares, image encryption, Elliptic Curve Diffie Hellman (ECDH), Hash Based Key Definition Function (HKDF)Abstract
The increasing demand for secure digital image transmission has motivated the development of encryption schemes that provide strong confusion and diffusion while maintaining efficient key generation. This study proposes an image encryption framework that combines magic-square-based permutation with Elliptic Curve Diffie–Hellman (ECDH) key exchange and the HMAC-based Extract-and-Expand Key Derivation Function (HKDF). In the proposed scheme, the input image is partitioned into blocks, ECDH is used to establish a secret key from which HKDF derives pseudorandom key definition material. The derived HKDF values are associated with the image blocks and arranged in lexicographic order to generate a key dependent block of images. A fixed magic square is employed to further rearrange the image block thereby providing positional confusion. The resulting pixel values are then processed using an HKDF derived key stream through an XOR operation achieving the diffusion stage. The decryption process reverses the encryption operations to recover the original image. Experimental evaluation demonstrates that the encrypted images exhibit approximately uniform histograms, high entropy value of 7.999840 bits, NPCR value of approximately 99.6% and UACI of approximately 33.4%.
DOI: https://doi.org/10.5281/zenodo.22165070