Advanced Hill Cipher Algorithm For Security Image
Advanced Hill Cipher Algorithm For Security Image
Series
1
Department of Mathematics and Science, Cenderawasih University, Jayapura,
Indonesia
Abstract. The security of important and confidential data is a top priority. Therefore, it is
necessary to secure appropriate data to ensure confidentiality. Secrecy of data security can be
done by randomizing the data in order to make the data is difficult to understand by anyone.
One of the data security techniques that can be used is Advanced Hill Cipher cryptography.The
purpose of this research was to create an application or software used to secure an image's data
by applying the Advanced Hill Cipher algorithm. A classic cryptographic technique, which use
a matrix as a key in the process of encrypting and decrypting data with the type of key used is
the symmetric key type. The data used in this study was an image data, while the application
development used the language of MATLAB Programming.The method used in this study was
the Advanced Hill Cipher Cryptographic Algorithm. Basically the Advanced Hill Cipher
Cryptography algorithm is much more like the Hill Cipher algorithm. However, on Advanced
Hill Cipher, algorithms are developed using a key matrix that always has inverse; so that the
disadvantages of the hill cipher algorithm are that the key matrix does not always have inverse
resolved. In this research,the key matrix used is a 2x2 order involuntary matrix with integer
elements.The output of this study is anapplication that can be used to encrypting and
decryptinggrayscaleand color image data with key matrix that always have inverse.
1. Introduction
Cryptography is an art or science that includes principles and methods to change plaintext into
ciphertext and then transform the message back into its original form [1]. The purpose of cryptography
is to maintain the confidentiality of information contained in the data so that the information cannot be
known by unauthorized parties.
Digital image as one form of digital data is currently many used for storing photos, images, or
works in digital format. When the data is confidential and its security is not guaranteed, it is feared
that the data can fall to unwanted parties, which are then misused for negative things. One way to
overcome this problem is to encode the image so that the image becomes scrambled form, and when
falling into unwanted hands, these images cannot be used [2].
As with any text messages in keeping confidential messages, the image is also requires encryption
techniques as much as possible simple but difficult to solve. The process of securing the messages in
the form of images can be done by encrypting images into the image form again using certain
algorithms. Therefore the development of cryptographic methods needs to expanded use not only
limited to the encoding of text, but also images [3], audio and video [4].
Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution
of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Published under licence by IOP Publishing Ltd 1
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
In this study the advanced hill cipher method will be implemented to encode an image. This is
possible considering that an image can be represented in a matrix containing integers. The image used
in this research is limited to an image with 24 bit bmp format and the key matrix used is the Involutory
matrix. The purpose of using the Involutory matrix is to overcome the disadvantages of using a
random key matrix in the encryption process, which allows it to not be able to return the message as
before, because the key matrix cannot be reversed and also to reduce computational complexity when
the process finds inverse of the matrix at the time of decryption.
2. Research Methods
(2)
= mod 26
or simply we can write as = , where and are column vectors of length 2, representing the
plaintext and ciphertext respectively, and K is a key matrix 2 × 2. Therefore, when the decryption
process requires the matrix inverse of the matrix K.The inverse matrix ( ) is defined by the
equation . = . = I, where I is the identity matrix [6, 7]. In general process encryption
and decryption we can write as follows:
For encryption:
= ( )= (3)
For decryption:
= ( ) = C= KP = P (4)
2
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
a mod p = p (a mod p)
Subtraction
(a b) mod p =[(a mod p (b mod p)] mod p
Multiplication
(a b) modp = [(amod p) (b mod p)] mod p
Division
(a / b) modp = c when a = (b c) mod p
3
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
Take the color component value (in pixel) from the image then change its size to a
row vector with a size [1 ... m x m].
Share pixel values or images in blocks which if expressed in matrix form, the row
size is as much as m.
Encrypt using the hill cipher key for each matrix of each color component using the
following equation;
= , = dan =
where P = Plaintext; C = Ciphertext, dan K = The Key Matrix
Change the size of the encrypted matrix to the original image.
The encrypted matrix is returned as an intent value using color transformation to
produce a new image that has been encoded.
The decryption process uses the advanced hill cipher method, the process is the same as the
step in the encryption process for each color matrix. The deciphering process is carried out
using the following equation;
= ( )= =
4
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
The decrypted vector is returned as the color intensity value using color transformation. The
decryption results will produce the same image as the original image if the application runs
properly and correctly.
3.a 3.b
3.c 3.d
Figure 3. Results of the encryption process of 3 color images and a grayscale
image
Figure 3 indicates that the original image cannot be seen after the encryption process. Image
encoding results show significant color randomness and color intensity changes, this indicates that the
encryption process works well. The following are examples of a histogram of a color image.
The results of the histogram analysis in Figure 4 and Figure 5 show visually that there is a
significant difference between the image histogram before and after encryption. In the
encrypted histogram it looks flat for each color intensity, this shows that the encryption
algorithm used cannot provide any instructions for statistical attacks by cryptanalysts
because there is no prominent intensity as seen in the original image histogram.
5
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
Color Image Histogram before encrypted. Color Image Histogram after encrypted.
4.a 4.b
4.c 4.d
4.e
4.f
Figure 4. Color image histogram before and after encryption from image 3.a
The following figures are example of a histograms of grayscale image.
5.a 5.b
6
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
decryption process of the encrypted image as in Figure 6. The key used in the decryption
process is the same key in the encryption process.
Decryption Result Image
Encryption Decryption Results Encryption Decryption Results
6.a 6.b
6.c 6.d
Figure 6. Results of the decryption process
Figure 6 shows that the image that has been encrypted can be returned like the original image. The
decrypted image shows image distortion. However, this result shows that the decryption process works
well.
5. Conclusion
Based on the discussion above:
An involutory matrix with round elements can be used as a key matrix in Advanced
Hill Cipher cryptography
The image encoding process with Hill Cipher shows significant color randomness,
this indicates that the encryption process works well.
Decryption process with Advanced Hill Cipher technique from the encrypted image
can be returned as the first image or original image even though the decrypted image
has a distortion. Yet, the decryption process still works well.
References
[1] Bibhudendra A, Girija S R, Sarat K P, Saroj K P 2007 Novel Methods of Generating Self-
Invertible Matrix for Hill Cipher AlgorithmInternational Journal of Security Vol 1 Issue 1
2007 pp. 14-21.
[2] Marta K 2017 Implementasi Algoritma Affine Cipher Pada Citra Menggunakan Binomial
Newton Sebagai Matriks KunciPelita Informatika Budi Darma Vol XVI, Nomor: 1 Januari
ISSN : 2301-9425
[3] Siang J J 2002 Implementasi Sand Hill untuk Penyandian CitraJurnal Informatika vol 3 No.1
[4] Soplanitand Susani 2005 Digital Audio Encryption Using New Chaotic Substitution
ImageEncryption (NCSIE)Prosiding SNTI 2005 ISSN: 1829-9156 vol 2 Nomor 1.
[5] Menezes A J, P C Van Oorschotand S A Van Stone 1996 Handbook of Applied
CryptographyCRC press.
7
WEAST 2020 IOP Publishing
Journal of Physics: Conference Series 1899 (2021) 012116 doi:10.1088/1742-6596/1899/1/012116
[6] Imai H, Hanaoka G, Shikata J, Otsuka A, and Nascimento A C 2002 Cyptography with
Information Theoretic SecurityInformation Theory Workshop 2002 Proceedings of the IEEE,
20-25 Oct 2002
[7] Overbey J, Traves W, and Wojdylo J 2005 On the keyspace of the Hill cipherCryptologia, vol
29 No. l:59-72.
[8] Bruce S1996Applied Cryptography 2nd edition, John Wiley & Sons
[9] Highamand Nicholaz 2008Involutory Matrices Functions of Matrices :Theory and
ComputationPhiladelphia PA: Society for Industrial and Applied Mathematics (SIAM),
pp. 165–166
[10] Li S, and Zheng X 2002. On the Security of an Image Encryption Method.
[11] Stallings W 2005Cryptography and Network Security 4th edition, Prentice Hall.
[12] Supiyanto 2015 Implementasi Hill Cipher Pada Citra Menggunakan Koefisien Binomial
Sebagai Matriks Kunci, Seminar Nasional Informatika 2015 (Semnasif 2015) ISSN: 1979-
2328 UPN ”Veteran” Yogyakarta, 14 November 2015