Anda di halaman 1dari 4

(IJCNS) International Journal of Computer and Network Security, 89

Vol. 2, No. 6, June 2010

Cryptography of a Gray Level Image


Using a Modified Hill Cipher
V. U. K. Sastry1*, D. S. R. Murthy2, S. Durga Bhavani3
1
Dept. of Computer Science & Engg., SNIST,
Hyderabad, India,
vuksastry@rediffmail.com
2
Dept. of Information Technology, SNIST,
Hyderabad, India,
dsrmurthy.1406@gmail.com
3
School of Information Technology, JNTUH,
Hyderabad, India,
sdurga.bhavani@gmail.com

Abstract: In this paper, we have used a modified Hill cipher Consider a gray level image whose gray level values can
for encrypting a Gray level image. Here, we have illustrated the be represented in the form of a matrix given by
process by considering a couple of examples. The security of the P = [Pij], i = 1 to n, j = 1 to n. (2.1)
image is totally achieved, as the encrypted version of the Here, each Pij lies between 0 - 255.
original image, does not reveal any feature of the original Let us choose a key k let it be represented in the form of
image.
a matrix given by
K = [Kij], i = 1 to n, j = 1 to n, (2.2)
Keywords: Cryptography, Cipher, Gray level image, Encrypted
image, Modular arithmetic inverse.
where each Kij is in the interval [0, 255].
Let C = [Cij], i = 1 to n, j = 1 to n (2.3)
be a matrix, obtained on encryption.
1. Introduction
The process of encryption and the process of decryption,
The study of cryptography of gray level images [1 – 3] by which are quite suitable, for the problem on hand, are given
using block ciphers has gained considerable impetus in the in Fig. 1.
recent years. The transformation of an image from its
original form to some other form, such that it cannot be
deciphered what it is, is really an interesting one.
In a recent investigation [4, 5], we have developed two
large block ciphers by modifying the Hill cipher [3]. In these
ciphers, the key is of size 512 bits and the plain text is of
size 2048 bits. In one of the papers [6], the plain text matrix
is multiplied by the key on one side and by its modular
arithmetic inverse on the other side. From the cryptanalysis
and the avalanche effect, we have noticed that the cipher is a
strong one and it cannot be broken by any cryptanalytic
attack.
In the present paper, our objective is to develop a block
cipher, and to use it for the cryptography of a gray level
image. Here, we have taken a key containing 64 decimal
numbers (as it was in [1]), and generated a key matrix of
size 32 x 32 by extending the key in a special manner
(discussed later), and applied it in the cryptography of a
gray level image.
In Section 2, we have developed a procedure for the
cryptography of a gray level image. In Section 3, we have Figure1. The process of encryption and the process of
used an example and illustrated the process. Finally, in decryption
Section 4, we have drawn conclusions from the analysis.

Here, Mix ( ) is a function used for mixing thoroughly the


2. Development of a Procedure for the decimal numbers (on converting them into binary bits)
Cryptography of a Gray Level Image arising in the process of encryption at each stage of
90 (IJCNS) International Journal of Computer and Network Security,
Vol. 2, No. 6, June 2010

iteration. IMix ( ) is a function which represents the reverse


process of Mix ( ). For a detailed discussion of these
functions, and the algorithms involved in the processes of
encryption and decryption, we refer to [1].

3. Illustration of the cryptography of the image


Let us choose a key Q consisting of 64 numbers. This
can be written in the form of a matrix given by

The length of the secret key (which is to be transmitted)


is 512 bits. On using this key, we can generate a new key E
in the form

Now we obtain the key matrix K given by


where U = QT, in which T denotes the transpose of a matrix,
and R and S are obtained from Q and U as follows. On
interchanging the 1st row and the 8th row of Q, the 2nd row where J is obtained from H by rotating, circularly, two rows
and the 7th row of Q, etc., we get R. Similarly, we obtain S in the downward direction.
from U. Thus, we have

The afore mentioned operations are performed for


The size of this matrix is 16 x 16. This can be further (1) enhancing the size of the key matrix to 32 x 32, and
extended to a matrix L of size 32 x 32 (2) obtaining the modular arithmetic inverse of K, in a trial
and error manner.
where The modular arithmetic inverse of K is obtained as
where H = ET, in which T denotes the transpose of a matrix,
and F and G are obtained from E and H as follows. On
interchanging the 1st row and the 16th row of E, the 2nd row
and the 15th row of E, etc., we get F. Similarly, we obtain G
from H. Thus, we have L.
Here,
(IJCNS) International Journal of Computer and Network Security, 91
Vol. 2, No. 6, June 2010

From (3.8) and (3.10), we can readily find that On using (3.8), (3.10), (3.17), and the procedure for
K K–1 mod 256 = K–1 K mod 256 = I. (3.15) decryption (See Fig. 1.(b)), we get back the original binary
Let us consider the image of a hand, which is given image P, given by (3.16).
below. From the matrix C, on connecting each 1 with its
neighbouring 1, we get an image which is in a zigzag
manner (See Fig. 3).

Figure 2. Image of a Hand


This image can be represented in the form of a binary
matrix P given by

Figure 3. Encrypted image of the hand


It is interesting to note that, the original image and the
encrypted image differ totally, and the former one, exhibits
all the features very clearly, while the later one does not
reveal anything.

4. Conclusions
In this analysis, we have made use of a modified Hill
cipher for encrypting a binary image. Here we have
illustrated the procedure by considering a pair of examples:
(1) the image of a hand, and (2) the image of upper half of a
where 1 denotes black and 0 denotes white. person.
On adopting the iterative procedure given in Fig. 1, we Here, we have noticed that, the encrypted image is
get the encrypted image C totally different from the original image, and the security of
the image is completely enhanced, as no feature of the
original image can be traced out in any way from the
encrypted image.
This analysis can be extended for the images of
signatures and thumb impressions.

References
[1] Hossam El-din H. Ahmed, Hamdy M. Kalash, and
Osama S. Farag Allah, “Encryption Efficiency Analysis
and Security Evaluation of RC6 Block Cipher for
92 (IJCNS) International Journal of Computer and Network Security,
Vol. 2, No. 6, June 2010

Digital Images”, International Journal of Computer,


Information, and Systems Science, and Engineering,
Vol. 1, No. 1, pp. 33 – 39, 2007.
[2] M. Zeghid, M. Machhout, L. Khriji, A. Baganne, and
R. Tourki, “A Modified AES Based Algorithm for Image
Encryption”, World Academy of Science, Engineering
and Technology, Vol. 27, pp. 206 – 211, 2007.
[3] Bibhudendra Acharya, Saroj Kumar Panigrahy, Sarat
Kumar Patra, and Ganapati Panda, “Image Encryption
Using Advanced Hill Cipher Algorithm”, International
Journal of Recent Trends in Engineering, Vol. 1, No. 1,
May 2009.
[4] V. U. K. Sastry, D. S. R. Murthy, S. Durga Bhavani, “A
Block Cipher Involving a Key Applied on Both the
Sides of the Plain Text”, International Journal of
Computer and Network Security (IJCNS), Vol. 1, No. 1,
pp. 27 – 30, Oct. 2009.
[5] V. U. K. Sastry, D. S. R. Murthy, S. Durga Bhavani, “A
Block Cipher Having a Key on One Side of the Plain
Text Matrix and its Inverse on the Other Side”,
Accepted for Publication in International Journal of
Computer Theory and Engineering (IJCTE), Vol. 2, No
5, Oct 2010.
[6] William Stallings, Cryptography and Network Security,
Principles and Practice, Third Edition, Pearson, 2003.

Anda mungkin juga menyukai