Algorithm For Digital Image Encryption Using Multiple Hill Ciphers, A
Algorithm For Digital Image Encryption Using Multiple Hill Ciphers, A
Samsul Arifin1*, Axel Nicholas2, Suwarno3, Herolistra Baskoroputro4, Faisal5, Abram Setyo Prabowo6,
Muhammad Amien Ibrahim7, Anita Rahayu8
Abstrak: The security of digital images is becoming increasingly important due to the widespread use of image transmission through
networks. Therefore, encryption is necessary to protect the confidentiality and integrity of digital images. In this paper, a new digital
image encryption algorithm is proposed by combining multiple Hill ciphers, unimodular matrix, and logistic map. The proposed
algorithm can improve the security of the image encryption process by introducing multiple encryption layers. The unimodular matrix is
used to shuffle the image pixels and the logistic map is used to generate the encryption keys. The performance of the proposed algorithm
is evaluated by applying it to various types of digital images. The experimental results show that the proposed algorithm can achieve
high-level security. Moreover, the proposed algorithm has a faster encryption time compared to other existing image encryption
algorithms. Therefore, it is a promising algorithm for digital image encryption applications that require high security and fast processing
time.
Keywords: image encryption, multiple hill ciphers, unimodular matrix, logistic map
1,8
Statistics Department, School of Computer Science, Bina Nusantara
University, Jakarta, Indonesia.
2,4,5
Mathematics Department, School of Computer Science, Bina
Nusantara University, Jakarta, Indonesia.
6,7
Computer Science Department, School of Computer Science, Bina
Nusantara University, Jakarta, Indonesia.
3
Primary Teacher Education Department, Faculty of Humanities, Bina
Nusantara University. Jakarta. Indonesia.
*Corresponding Author: [email protected]
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 311
Fig 1. The concept of symmetric encryption in general [4].
Cryptography can be categorized into two types, namely safeguarding confidential information, such as personal,
classical and modern cryptography. Classical business, and military data. Without cryptography,
cryptography involves using techniques that have been unauthorized individuals or parties can easily access
used since ancient times, including Hill Cipher, Caesar such information, leading to significant losses.
Cipher, Playfair Cipher, and Vigenere Cipher. In Therefore, the use of cryptography is necessary to ensure
contrast, modern cryptography uses more complex and the security of sensitive information [5], [6]. Figure 2
challenging techniques, such as RSA, AES, and DES. below describes some of the keywords attached to the
The application of cryptography is crucial in concept of cryptography.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 313
increasingly crucial. Apart from that, digital images can the limitations of this research include the inability to
also be used as a form of evidence in criminal or civil evaluate the proposed algorithm under all possible
cases. In this context, it is important to ensure that digital scenarios and the inability to ensure that the proposed
images are secure and cannot be altered by unauthorized algorithm is completely secure under all circumstances
parties. By using digital image encryption, you can [22]. Digital image encryption is an important area of
ensure that the evidence cannot be changed and remains research in information security that has received
safe, so that it can be used as legal evidence. Digital significant attention in recent years due to the rapid
image encryption is also important when it comes to growth of multimedia communication technologies [23].
privacy. Many people share their personal photos The main objective of digital image encryption is to
through social networks or instant messaging transform an original image into an encrypted version
applications. In this case, it is important to ensure that that is unintelligible and protected from unauthorized
the image cannot be accessed by unauthorized persons or access. There are many encryption techniques that have
hackers. By using encryption techniques, these images been proposed in the literature, including symmetric key
can be kept confidential and can only be accessed by algorithms such as Advanced Encryption Standard
people who have access rights. In conclusion, digital (AES), Data Encryption Standard (DES), and Triple
image encryption is becoming more and more important DES (3DES), as well as asymmetric key algorithms such
in everyday life because a lot of important information is as RSA and Elliptic Curve Cryptography (ECC) [24].
stored in the form of digital images. This requires the use
The Unimodular n-Hill Cipher (UHC) is a symmetric
of strong encryption techniques to maintain the security
key encryption algorithm that uses matrices to encrypt
and privacy of data contained in digital images [10],
plaintext data. The UHC algorithm is based on the Hill
[17].
Cipher and has been shown to be resistant against many
The increasing use of digital images has led to a growing types of attacks, including brute-force attacks,
concern about the security of these images. Many differential attacks, and linear attacks. However, the
encryption algorithms have been proposed to ensure the original UHC algorithm has a fixed key length, which
security of digital images, but most of them have some limits its applicability in certain scenarios. To overcome
weaknesses that make them vulnerable to attacks [18], this limitation, several variants of UHC have been
[19]. Therefore, there is a need for new encryption proposed in the literature, including the Unimodular
algorithms that provide high security and efficiency for Adaptive n-Hill Cipher (UAHC), which uses an adaptive
digital images. In order to address the shortcomings of key length to improve the security of the algorithm [14].
current algorithms and provide high security for digital The Logistics Map is a non-linear mathematical model
images, we present a novel image encryption technique that exhibits chaotic behavior and has been widely used
in this paper based on the unimodular n-Hill cipher and in various fields, including physics, biology, and
logistic map [1], [14]. The main objective of this economics. In recent years, the Logistics Map has also
research is to develop a new image encryption algorithm been applied in the field of cryptography, where it is
based on the unimodular n-Hill cipher and logistic map used as a source of randomness to generate
that can provide high security and efficiency for digital cryptographic keys. The Logistics Map has several
images. To achieve this objective, we will analyze the desirable properties for encryption applications,
security and efficiency of the proposed algorithm and including unpredictability, sensitivity to initial
compare it with existing encryption algorithms. We will conditions, and ergodicity. These properties make the
also evaluate the performance of the proposed algorithm Logistics Map a promising tool for developing secure
using various metrics [20]. encryption algorithms [1].
The proposed image encryption algorithm based on the 2. Methods
unimodular n-Hill cipher and logistic map is a new
Hill Cipher is a classic cryptographic method utilized to
contribution to the field of image encryption. This
encrypt and decrypt digital data and text, which involves
algorithm provides high security and efficiency for
a matrix as the key for encryption and decryption. Hill
digital images and overcomes the weaknesses of existing
Cipher is an effective method to safeguard information
algorithms. The proposed algorithm can be used in
as it produces large and complex keys, making it difficult
various fields, such as medical, military, and
for unauthorized parties to break into. However, Hill
communication, where the security of digital images is a
Cipher, like other classical cryptographic methods, has
major concern [21]. The scope of this research is limited
some limitations that require attention. One of Hill
to the development of a new image encryption algorithm
Cipher's advantages is that it can encrypt and decrypt not
based on the unimodular n-Hill cipher and logistic map.
only text but also digital data such as audio and video
The proposed algorithm will be evaluated using various
files, which is very beneficial for securing digital data.
metrics to analyze its security and efficiency. However,
Conversely, Hill Cipher's most significant disadvantage
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 314
is its sensitivity to key errors. If a value in the key matrix algorithm using Python, its advantages and
is incorrect, the encryption and decryption process will disadvantages should be considered to ensure that the
fail, and incorrect output will be generated. Hill Cipher is audio data is well protected and not easily accessed by
also vulnerable to frequency attacks as it uses a pattern unauthorized or authorized parties [25], [26]. The
that repeats itself in the encrypted message. Therefore, detailed illustration of the research method in this article
while implementing Hill Cipher on the audio encryption is available in Figure 4.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 315
learning. Additionally, its open-source nature and Logos from the python language used in this study is
availability of online resources make it affordable and shown in the following Figure 5.
accessible to developers of all skill levels [18], [32].
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 316
-----------------------------------------------
Starts the encryption process.
-----------------------------------------------
Based on password1, here is a triangular matrix with size 8 x 8 which will be the key matrix:
[[1. 0. 0. 0. 0. 0. 0. 0.]
[0. 1. 0. 0. 0. 0. 0. 0.]
[0. 0. 1. 0. 0. 0. 0. 0.]
[0. 0. 0. 1. 0. 0. 0. 0.]
[0. 0. 0. 0. 1. 0. 0. 0.]
[0. 0. 0. 0. 0. 1. 0. 0.]
[0. 0. 0. 0. 0. 0. 1. 0.]
[0. 0. 0. 0. 0. 0. 0. 1.]]
Your key matrix (unimodular matrix) based on password1, password2, and the logistic function with size 8 x 8 is:
[[ 57 16 55 ... 7 8 8]
[ 8 7 7 ... 100 83 85]
[ 33 7 11 ... 56 51 52]
...
[192 123 46 ... 5 5 5]
[ 4 4 4 ... 32 17 51]
[ 63 18 23 ... 40 42 37]]
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 317
The matrix of ciphertext before reshaping is as follows:
-----------------------------------------------
Your encrypted image is located in the same folder and is named "enkripsi.png."
It took 0.9235615730285645 seconds to encrypt the data.
Remember your two-layer password, please:
1st password: 8
Second password: 88888
-----------------------------------------------
Furthermore, the decryption process for the encrypted Note that what guarantees that encrypted digital image
digital image file above is more or less the same as the files can be restored to their original state is that the key
above process, but slightly different in the multiplication matrix is a unimodular matrix which has the property of
process, namely multiplying the inverse of the key always having an inverse so that it is always possible to
matrix by the matrix of the encrypted digital image file. do the decryption process [34].
3. Result and Discussions namely monochrome and color images. For monochrome
images, one monochrome image with a size of 97 kB has
We describe the experimental findings from the use of
been selected. This image is obtained from wikimedia
the suggested Digital Image Encryption Algorithm using
with the name “500px_photo_ (68947463).jpeg”. For
Unimodular n-Hill Cipher and Logistic Map in this part.
color images, one color image of 3.1 MB has been
These tests are meant to measure the effectiveness and
selected. This image is obtained from wikimedia with the
safety of the suggested algorithm. We conduct
name "A view of a sunrise from a countryside in Jhang,
experiments on a dataset of grayscale and color images.
Punjab, Pakistan.jpg". For more details, see Figure 6
In this study, two digital image samples were used,
below.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 318
(b) color images
(a) monochrome image
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 319
20 202020 10 0.2897672653198242 0.2727062702178955
Here's the result of running the code on a color image (size 3.1 MB), which can be seen in more detail in Table 2.
Note that based on Tables 1 and 2, it can be concluded histogram analysis. Here is a histogram for a
that the larger the iterations performed (n>1), the greater monochrome image before and after the encryption
the time required for the encryption process. Next is the process which can be seen in more detail in Figure 7.
Fig 7. histogram for a monochrome image before encryption and after encryption for n = 10
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 320
Next up is the histogram for color images. The following carried out, which can be seen in more detail in Figure 8.
is how it looks before and after the encryption process is
Fig 8. histogram for a color image before encryption and after encryption for n = 10
This means that the histogram of an image does not that need to be addressed in future research. One of the
change much with respect to n, the number of times a limitations is the computational complexity of the
given image A is multiplied by a matrix key K. This is algorithm, which can be improved by optimizing the key
because each item at some position i,j in the matrix has a generation process and reducing the number of iterations
limited result set that it can result in. Overall, the in the encryption and decryption processes. Another
experimental results demonstrate the effectiveness and limitation is the requirement of a large amount of
security of the proposed Digital Image Encryption memory to store the encryption and decryption keys,
Algorithm using Unimodular n-Hill Cipher and Logistic which can be addressed by developing a more efficient
Map. The proposed algorithm can be used for secure key storage method. The following Table 3 which
communication of digital images in various applications, contains a comparison of standard Hill ciphers and
such as military, healthcare, and e-commerce. However, proposed algorithms will close this session.
there are still some limitations of the proposed algorithm
Tabel 3. Comparison of the suggested method and the traditional Hill cipher
Properties Standar Hill Cipher Proposed algorithm
Key matrix size Kn Usually small n, n <= 4 All n > 0
Key matrix storage Kn One whole matrix of Kn 2 parameters only
The number of matrix multiplication Only one All n > 0
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 321
such as statistical attacks, differential attacks, and brute- 3-030-33846-6_40.
force attacks. The decryption process successfully
[4] S. Ventures, “APA ITU ENKRIPSI
retrieved the original image without any distortion or
ASIMETRIS & SIMETRIS?”
loss of quality. However, there are still some limitations
https://www.websiterating.com/id/vpn/glossary/
to this proposed algorithm. One limitation is that the
what-is-asymmetric-symmetric-encryption/
encryption process is computationally intensive and may
(accessed Feb. 25, 2023).
require more processing power for larger images.
Another limitation is that the key generation process [5] M. Fadlan, Haryansyah, and Rosmini, “Three
using Logistic Map may result in the generation of weak Layer Encryption Protocol: An Approach of
keys that could compromise the security of the Super Encryption Algorithm,” in 3rd
encryption. Further research is needed to improve the International Conference on Cybernetics and
efficiency of the algorithm and to develop a more robust Intelligent Systems, ICORIS 2021, 2021. doi:
key generation process. In conclusion, the proposed 10.1109/ICORIS52787.2021.9649574.
Digital Image Encryption Algorithm Using Unimodular [6] P. N. Lone, D. Singh, V. Stoffová, D. C. Mishra,
n-Hill Cipher and Logistic Map offers a high level of U. H. Mir, and N. Kumar, “Cryptanalysis and
security and performance for digital image encryption. Improved Image Encryption Scheme Using
The implementation of this algorithm is feasible and can Elliptic Curve and Affine Hill Cipher,”
be used to protect sensitive image data in various Mathematics, vol. 10, no. 20, 2022, doi:
applications. The contributions of this research include 10.3390/math10203878.
the development of a new encryption algorithm that
combines the advantages of Unimodular n-Hill Cipher [7] S. M. Zia Sardar, Aaron Arellano,
and Logistics Map, and the evaluation of the algorithm's “Cryptographic Implementations: Hardware vs.
security and performance using various metrics. The Software,” Electronic Design, 2020.
implications of this research are significant, as it can https://www.electronicdesign.com/technologies/e
contribute to the advancement of image encryption mbedded/article/21132412/maxim-integrated-
techniques and enhance the protection of digital image cryptographic-implementations-hardware-vs-
data. Future research could focus on improving the software
efficiency of the algorithm and developing a more robust [8] E. A. Jameel and S. A. Fadhel, “Digital Image
key generation process Encryption Techniques: Article Review,” Tech.
Rom. J. Appl. Sci. Technol., vol. 4, no. 2, pp. 24–
Acknowledgment 35, 2022, doi: 10.47577/technium.v4i2.6026.
This work is funded by the Bina Nusantara University's [9] J. R. Paragas, “An Enhanced Cryptographic
Research and Technology Transfer Office under the Algorithm in Securing Healthcare Medical
terms of the university's International Research Grant Records,” in Proceeding - 2020 3rd
(PIB 2023) under contract number 029/VRRTT/III/2023. International Conference on Vocational
Education and Electrical Engineering:
References Strengthening the framework of Society 5.0
[1] I. B. Muktyas, Sulistiawati, and S. Arifin, through Innovations in Education, Electrical,
“Digital image encryption algorithm through Engineering and Informatics Engineering,
unimodular matrix and logistic map using ICVEE 2020, 2020. doi:
Python,” in AIP Conference Proceedings, 2021, 10.1109/ICVEE50212.2020.9243228.
vol. 2331. doi: 10.1063/5.0041653. [10] P. N. Lone and D. Singh, “Application of algebra
[2] A. J. Akinboboye, A. S. Oluwole, O. Akinsanmi, and chaos theory in security of color images,”
and A. E. Amoran, “Cryptographic Algorithms Optik (Stuttg)., vol. 218, 2020, doi:
for IoT Privacy: A Technical Review,” Int. J. 10.1016/j.ijleo.2020.165155.
Eng. Trends Technol., vol. 70, no. 8, pp. 185– [11] D. Nofriansyah et al., “A New Image Encryption
193, 2022, doi: 10.14445/22315381/IJETT- Technique Combining Hill Cipher Method,
V70I8P219. Morse Code and Least Significant Bit
[3] N. Faizal, S. Sharan, P. S. Nair, and D. S. Algorithm,” in Journal of Physics: Conference
Sankar, Securing Color Image Using Combined Series, 2018, vol. 954, no. 1. doi: 10.1088/1742-
Elliptic Curve Crypto-System and Hill Cipher 6596/954/1/012003.
Encryption Along with Least Significant Bit - [12] F. Serzhenko, “JPEG2000 vs JPEG vs PNG,”
Steganography, vol. 98. 2020. doi: 10.1007/978- Fastvideo, 2020.
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 322
https://www.fastcompression.com/blog/jpeg-j2k- 10.1007/978-3-319-01628-3_8.
png-review.htm
[23] P. Hernández-Lamas, B. Cabau-Anchuelo, Ó. de
[13] A. Laurinavicius et al., “Digital image analysis Castro-Cuartero, and J. Bernabéu-Larena,
in pathology: benefits and obligation,” Anal. “Mobile Applications, Geolocation and
Cell. Pathol., vol. 35, no. 2, pp. 75–78, 2012. Information Technologies for the Study and
Communication of the Heritage Value of Public
[14] S. Arifin, F. I. Kurniadi, I. G. A. Yudistira, R.
Works,” Sustainability, vol. 13, no. 4, p. 2083,
Nariswari, N. P. Murnaka, and I. B. Muktyas,
2021.
“Image Encryption Algorithm Through Hill
Cipher, Shift 128 Cipher, and Logistic Map [24] Z. E. Dawahdeh, S. N. Yaakob, and R. Razif bin
Using Python,” in 2022 3rd International Othman, “A new image encryption technique
Conference on Artificial Intelligence and Data combining Elliptic Curve Cryptosystem with Hill
Sciences: Championing Innovations in Artificial Cipher,” J. King Saud Univ. - Comput. Inf. Sci.,
Intelligence and Data Sciences for Sustainable vol. 30, no. 3, pp. 349–355, 2018, doi:
Future, AiDAS 2022 - Proceedings, 2022, pp. 10.1016/j.jksuci.2017.06.004.
221–226. doi:
[25] M. Toorani and A. Falahati, “A secure variant of
10.1109/AiDAS56890.2022.9918696.
the hill cipher,” in Proceedings - IEEE
[15] M. Terras, Digital images for the information Symposium on Computers and Communications,
professional. Routledge, 2016. 2009, pp. 313–316. doi:
10.1109/ISCC.2009.5202241.
[16] S. Kanwal et al., “An Effective Color Image
Encryption Based on Henon Map, Tent Chaotic [26] J. R. Paragas, A. M. Sison, and R. P. Medina, “A
Map, and Orthogonal Matrices,” Sensors, vol. new variant of hill cipher algorithm using
22, no. 12, 2022, doi: 10.3390/s22124359. modified S-Box,” Int. J. Sci. Technol. Res., vol.
8, no. 10, pp. 615–619, 2019.
[17] M. T. Suryadi, Y. Satria, and A. Hadidulqawi,
“Implementation of the Gauss-Circle Map for [27] 3rd International Conference on Smart
encrypting and embedding simultaneously on Computing and Informatics, SCI 2018, vol. 159.
digital image and digital text,” J. Phys. Conf. 2020.
Ser., vol. 1821, no. 1, 2021, doi: 10.1088/1742-
[28] S. J. Gladwin and P. Lakshmi Gowthami,
6596/1821/1/012037.
“Combined Cryptography and Steganography for
[18] S. Arifin, I. B. Muktyas, P. W. Prasetyo, and A. Enhanced Security in Suboptimal Images,” in
A. Abdillah, “Unimodular matrix and bernoulli 2020 International Conference on Artificial
map on text encryption algorithm using python,” Intelligence and Signal Processing, AISP 2020,
Al-Jabar J. Pendidik. Mat., vol. 12, no. 2, pp. 2020. doi: 10.1109/AISP48273.2020.9073306.
447–455, 2021.
[29] S. Kanwal, S. Inam, O. Cheikhrouhou, K.
[19] S. Arifin and I. B. Muktyas, “Membangkitkan Mahnoor, A. Zaguia, and H. Hamam, “Analytic
Suatu Matriks Unimodular Dengan Python,” J. Study of a Novel Color Image Encryption
Deriv. J. Mat. dan Pendidik. Mat., vol. 5, no. 2, Method Based on the Chaos System and Color
pp. 1–10, 2018. Codes,” Complexity, vol. 2021, 2021, doi:
10.1155/2021/5499538.
[20] M. A. Lone and S. Qureshi, “Encryption scheme
for RGB images using chaos and affine hill [30] R. Tuli, H. N. Soneji, and P. Churi, “PixAdapt:
cipher technique,” Nonlinear Dyn., vol. 111, no. A novel approach to adaptive image encryption,”
6, pp. 5919–5939, 2023, doi: 10.1007/s11071- Chaos, Solitons and Fractals, vol. 164, 2022,
022-07995-2. doi: 10.1016/j.chaos.2022.112628.
[21] A. Kaur and S. Singh, “A hybrid technique of [31] S. Arifin, K. Tan, A. T. Ariani, S. Rosdiana, and
cryptography and watermarking for data M. N. Abdullah, “The Audio Encryption
encryption and decryption,” in 2016 4th Approach uses a Unimodular Matrix and a
International Conference on Parallel, Logistic Function,” Int. J. Emerg. Technol. Adv.
Distributed and Grid Computing, PDGC 2016, Eng., vol. 13, no. 4, pp. 71–81, 2023.
2016, pp. 351–356. doi:
[32] T. E. Oliphant, “Python for scientific
10.1109/PDGC.2016.7913175.
computing,” Comput. Sci. Eng., vol. 9, no. 3, pp.
[22] J. F. Dooley, The machines take over: Computer 10–20, 2007.
cryptography, vol. 0, no. 9783319016. 2013. doi:
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 323
[33] Python Software Foundation, “Python TM,” WikimediaCommons, 2018.
Python.org. https://www.python.org/ (accessed https://commons.wikimedia.org/wiki/File:500px
Feb. 15, 2023). _photo_(68947463).jpeg
[34] S. Hraoui, F. Gmira, M. F. Abbou, A. J. Oulidi, [36] H. Nasir, “A view of a sunrise from a
and A. Jarjar, “A New Cryptosystem of Color countryside in Jhang, Punjab, Pakistan.,”
Image Using a Dynamic-Chaos Hill Cipher WikimediaCommons, 2017.
Algorithm,” Procedia Comput. Sci., vol. 148, pp. https://commons.wikimedia.org/wiki/Category:G
399–408, 2019, doi: reen_landscapes#/media/File:A_view_of_a_sunr
https://doi.org/10.1016/j.procs.2019.01.048. ise_from_a_countryside_in_Jhang,_Punjab,_Pak
istan.jpg
[35] DarwIn, “File:500px photo (68947463).jpeg,”
International Journal of Intelligent Systems and Applications in Engineering IJISAE, 2023, 11(6s), 311–324 | 324