5
www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802 INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS….. Page 37 Design of a Cryptosystem Using Two-Level Hill Cipher Sarla Dewangan 1 , Mrs. Shikha Pandey 2 , Mohammad Imroze Khan 3 1 M-Tech scholar, 2 Assistant Professor, 3 Assistant Professor 1,2 Rungta College of Engineering & Technology, Bhilai (C.G.), 490024 3 National Institute of Technology, Raipur (C.G.), 492010 1 [email protected], 2 [email protected], 3 [email protected] Abstract: Pioneered in the field of polygraph substitution cipher, operation of Hill Cipher is based upon the linear algebraic equation by working on more than three symbols simultaneously. Its high speed of processing is advantageous and so it has inherent property of opposing the analysis based upon frequency letter. The advantage of faster processing time is due to the mode of operation, in which matrices are multiplied linearly. But due to its linearity, it’s very difficul t to decrypt any encrypted message as it consists of all matrices of a given dimension that are invertible over Z m . This is the same reason why it is considered to be difficult for decrypting image of same shade over a large space, which makes it useless to withhold any specific aspect out of an image, which might be pointing out any impression over it. The main aim of this paper is to use a technique for image encryption, which is different from the conventional one. Keywords: Cryptosystem, Encryption, Decryption, Hill Cipher 1. INTRODUCTION With the advancement of network technology, there is a crucial problem regarding the security of the information. Increasing network transmission ability and popular multimedia technology application gradually leads us to retrieve information clearly and directly from images. Therefore, the security of data is very complicated and imperative issue now [3]. Cryptography, which is the science of encryption, plays an important role in communication like mobile phones, pay-TV, e-commerce, private email transformation, financial information transmission, ATM cards security, computer passwords etc are those examples which touches on many things in our daily lives [2, 9]. Science is the study of principles, rules and laws, whereas art is the study of methods to do something. Hence, we consider Cryptography as the art and science, because it includes the principles and methods of transforming an intelligible message (plaintext) into one that is unintelligible (Cipher text) and then retransforming the message into its original form [1, 2, 6]. Now-a-days, Cryptography is also compared with both mathematics and computer science and it has also the affiliation to information theory, computer security and engineering [2]. Substitution cipher is one of the most basic components of the classical cipher. It is an encryption method, which substitutes the units of plaintext with cipher text according to particular system. The units may be in the form of single letters, pairs of letters, triplets of letters, mixture of the above and so forth. By performing the inverse substitution, the receiver can decipher the text [5, 8, and 10]. The units of plaintext are retained in the similar sequence as in the cipher text, but the units themselves are changed. There are different types of substitution cipher. The cipher is called as simple substitution ciphers, when the cipher works on single letters. The cipher is said to be polygraphic, when it works on group of letters. Cipher can be classified in terms of mono alphabetic and poly alphabetic. A fixed substitution is used by the mono alphabetic cipher over the entire message, whereas a number of substitutions are used by the poly alphabetic cipher at different times in the message. Hill cipher is one of the mono alphabetic polygraphic substitution cipher. It is a block cipher which has many advantages like distinguishing letter frequencies of the plaintext, its simplicity because of the use of the multiplication of matrices, and inversion for enciphering and deciphering, its high speed and high throughput [1, 3, and 6]. In our paper, we encrypt gray scale as well as color images using the pseudorandom key matrix. 2. PSEUDO-INVERTIBLE KEY MATRIX The pseudo-inverse of a m x n matrix A is a matrix that generalizes to arbitrary matrices the notion of inverse of a square, invertible matrix. The pseudo-inverse can be expressed from the singular value decomposition (SVD) of A, as follows.

Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

Embed Size (px)

Citation preview

Page 1: Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802

INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN

ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..

Page 37

Design of a Cryptosystem Using Two-Level Hill Cipher

Sarla Dewangan

1, Mrs. Shikha Pandey

2, Mohammad Imroze Khan

3

1M-Tech scholar, 2Assistant Professor, 3Assistant Professor 1,2Rungta College of Engineering & Technology, Bhilai (C.G.), 490024

3National Institute of Technology, Raipur (C.G.), 492010 1 [email protected], [email protected],[email protected]

Abstract: Pioneered in the field of polygraph substitution cipher, operation of Hill Cipher is based upon the linear

algebraic equation by working on more than three symbols simultaneously. Its high speed of processing is advantageous

and so it has inherent property of opposing the analysis based upon frequency letter. The advantage of faster processing

time is due to the mode of operation, in which matrices are multiplied linearly. But due to its linearity, it’s very difficult to

decrypt any encrypted message as it consists of all matrices of a given dimension that are invertible over Zm. This is the

same reason why it is considered to be difficult for decrypting image of same shade over a large space, which makes it

useless to withhold any specific aspect out of an image, which might be pointing out any impression over it. The main aim

of this paper is to use a technique for image encryption, which is different from the conventional one.

Keywords: Cryptosystem, Encryption, Decryption, Hill Cipher

1. INTRODUCTION With the advancement of network technology, there is a

crucial problem regarding the security of the information.

Increasing network transmission ability and popular

multimedia technology application gradually leads us to

retrieve information clearly and directly from images.

Therefore, the security of data is very complicated and

imperative issue now [3]. Cryptography, which is the

science of encryption, plays an important role in

communication like mobile phones, pay-TV, e-commerce,

private email transformation, financial information

transmission, ATM cards security, computer passwords

etc are those examples which touches on many things in

our daily lives [2, 9]. Science is the study of principles,

rules and laws, whereas art is the study of methods to do

something. Hence, we consider Cryptography as the art

and science, because it includes the principles and

methods of transforming an intelligible message

(plaintext) into one that is unintelligible (Cipher text) and

then retransforming the message into its original form [1,

2, 6].

Now-a-days, Cryptography is also compared with both

mathematics and computer science and it has also the

affiliation to information theory, computer security and

engineering [2]. Substitution cipher is one of the most

basic components of the classical cipher. It is an

encryption method, which substitutes the units of plaintext

with cipher text according to particular system. The units

may be in the form of single letters, pairs of letters, triplets

of letters, mixture of the above and so forth. By

performing the inverse substitution, the receiver can

decipher the text [5, 8, and 10]. The units of plaintext are

retained in the similar sequence as in the cipher text, but

the units themselves are changed. There are different types

of substitution cipher. The cipher is called as simple

substitution ciphers, when the cipher works on single

letters. The cipher is said to be polygraphic, when it works

on group of letters. Cipher can be classified in terms of

mono alphabetic and poly alphabetic. A fixed substitution

is used by the mono alphabetic cipher over the entire

message, whereas a number of substitutions are used by

the poly alphabetic cipher at different times in the

message. Hill cipher is one of the mono alphabetic

polygraphic substitution cipher. It is a block cipher which

has many advantages like distinguishing letter frequencies

of the plaintext, its simplicity because of the use of the

multiplication of matrices, and inversion for enciphering

and deciphering, its high speed and high throughput [1, 3,

and 6]. In our paper, we encrypt gray scale as well as color

images using the pseudorandom key matrix.

2. PSEUDO-INVERTIBLE KEY

MATRIX The pseudo-inverse of a m x n matrix A is a matrix that

generalizes to arbitrary matrices the notion of inverse of a

square, invertible matrix. The pseudo-inverse can be

expressed from the singular value decomposition (SVD)

of A, as follows.

Page 2: Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802

INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN

ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..

Page 38

Let the SVD of A be

A = U S 00 0

VT

Where U, V are both orthogonal matrices and S is a

diagonal matrix containing the (positive) singular values

of A on its diagonal.

Then the pseudo-inverse of A is the n x m matrix defined

as

A† = V S−1 00 0

UT

Here, A† has the same dimension as the transpose of A.

The pseudo-inverse matrix has the following properties:

AA† = (AA†)*

A†A = (A†A)*

AA† A = A

A† AA† = A†

3. HILL CIPHER Hill cipher is an application of linear algebra to

cryptology. It was developed by the mathematician Lester

Hill. The Hill cipher algorithm takes m successive

plaintext letters and substitutes them by m cipher text

letters. The substitution is determined by m linear

equations in which each character is assigned a numerical

value (a=0, b=1… z = 25) [4, 8, 10]. Let m be a positive

integer, the idea is to have m linear combinations of the m

alphabetic characters in one plain text element and

produce corresponding m characters in one cipher text

element. Then, a m × m matrix A as shown below in

equation (1) is used as a key of the system such that A is

invertible modulo 26 [1, 2].

Let aij be the entry of A.

A =

a11 a12 … a1m

a21 a22 … a2m

… … … …am1 am2 … amm

(1)

For the plain text block, the numerical equivalents of m

letters are given by Equation (2) as follows.

x = (x1, x2… xm) (2)

and a key matrix A, the corresponding cipher text block

are given by Equation (3) as follows.

y = (y1, y2,….,ym) (3)

Thus the Encryption will be computed as follows in

Equation (4)

(y1, y2,…., ym)) = (x1, x2,…., xm)A (mod 26) (4)

The cipher text is obtained from the plain text by means of

a linear transformation.

Thus the Decryption will be computed as follows in

Equation (5)

(x1, x2,….,xm) = (y1, y2,….,ym) A−1 (mod26) (5)

Where A-1

is given by Equation (6)

A−1 =

a11 a12 … a1m

a21 a22 … a2m

… … … …am1 am2 … amm

−1

(6)

Since the block length is m, there are 26 different m letters

blocks possible, each of which can be regarded as a letter

in a 26 letter combination. Hill’s method amounts to a

mono-alphabetic substitution on this alphabet.

A11 is a 1 x 1 matrix and is given by the Equation (7)

A11 = a11 , (7)

A12 is a 1 x (n-1) matrix and is given by the Equation (8)

A12 = a12 a13 … a1n (8)

A21 is a (n-1) x 1 matrix and is given by the Equation (9)

A21 =

a21

a31

…an1

, (9)

A22 is a (n-1) x (n-1) matrix and is given by the Equation

(10)

A22 =

a22 a23 … a2n

a32 a33 … a3n

… … … …an2 an3 … ann

(10)

So, A12 A21 = I - A112 = I - a112 (11)

And A12 (a11I + A22) = 0. [1,7] (12)

4. TWO-LEVEL HILL CIPHER As we know that both grayscale and color images can be

encrypted using Hill cipher technique [6], they can also be

encrypted using our proposed Two-Level Hill Cipher

algorithm, the modulus will be 256(the no. of levels is

considered as the no. of alphabets). On working with color

images on encryption side, firstly the color image is

decomposed into R-G-B components. Secondly, each

component is encrypted by the algorithm individually. At

last, the encrypted components are combined together to

obtain the encrypted color image.

In a Two – Level Hill Cipher, Hill-Cipher technique is

applied twice onto the blocks. Once, it is applied onto the

Page 3: Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802

INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN

ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..

Page 39

temporary block. Then, the resultant matrix is transposed

and Hill cipher is again applied to this matrix. The

algorithms are given below and the block diagram for the

encryption and decryption processes is shown in Figure 1

and Figure 2 respectively.

4.1 Sender Side:

At the Sender’s side, we implement encryption process.

Figure 1: Sender’s End Flowchart

Encryption:

Generate a Pseudorandom key image of order m

x m (P2).

Convert original image P in RGB2Gray (P1).

Divide P1 into m x m symmetric blocks.

The ith

pixels of each block are brought together

to form a temporary block.

a) Hill cipher technique is applied onto the

temporary block.

b) the resultant matrix is transposed and Hill

cipher is again applied to this matrix.

The final matrix obtained is placed in the ith

block of encrypted image.

Finally encrypted image of length L is obtained.

4.2 Receiver Side:

At the Receiver’s side, we implement decryption process.

Figure 2: Receiver’s End Flowchart

Decryption: Encrypted image of length L is placed such that it

forms an m x m matrix.

Inverse Hill cipher is applied to m x m matrix.

The resultant matrix is reverse transposed and

inverse Hill cipher is again applied to resultant

matrix to form a temporary block.

Temporary block is restored to form a m x m

symmetric blocks by replacing ith

pixel in each

block

Encrypted Image

of Length L

Place Resultant Image

of Length L in ith

Block to form m x m

matrix

Restore Temporary

Block to form a m

x m matrix by

replacing ith pixel

of each block

Apply

Inverse Hill

Cipher

Apply

Inverse

Hill Cipher

Apply

Inverse

Transpose

Two Level Hill Cipher

Pseudo invertible

key matrix image

of order m x m

(P)

Separate Pseudo

invertible Key to

obtain m x m

Symmetric

Blocks

Find Image

Resolution

Original

Image

Original

image

(P)

Rgb2Gray

(P1)

Pseudo invertible

Key Matrix

image of order m

x m (P2)

Construct ith

temporary

block from

ith pixel of

each block

Divide P1 in m

x m symmetric

Blocks

(provide

padding)

Apply

Hill

Cipher

Apply

Transpose

Place Resultant

Image in ith block of

Encrypted Image

Encrypted Image

of Length L

Apply

Hill

Cipher

Two Level Hill Cipher

Page 4: Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802

INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN

ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..

Page 40

Separate pseudorandom key (P2) from m x m

symmetric blocks to restore original image.

5. RESULT Hill cipher is a block cipher that has several advantages

such as disguising letter frequencies of the plaintext, its

simplicity because of using matrix multiplication and

inversion for enciphering and deciphering, its high speed,

and high throughput. However, Hill cipher succumbs to a

known plaintext attack and can be easily broken with such

attacks [2,3,]. Although the algorithm presented in this

paper aims at image encryption, it is not just limited to this

area and can be widely applied in other information

security fields such as video encryption.

(a)

(b)

(c)

(d)

(e)

Figure 3: Encryption Using Two-Level Hill Cipher

(a) Original Image, (b) Histogram of Original Image, (c)

Key Image, (d) Histogram of Key Image,

(e) Encrypted Image

We have taken one image as original image, another as the

key image, which are shown in Figure 3(a) and 3(c)

respectively. The histograms of both the images are shown

in Figure 3(b) and 3(d) respectively. They are encrypted

them using the Two-level Hill cipher algorithm. The result

is shown in Figure 3(e) as the encrypted image.

Figure 4 shows the result of decryption process. Here, we

have decrypted the image shown in Figure 3(a).

(a)

Page 5: Design of a Cryptosystem Using Two-Level Hill Cipher of a Cryptosystem Using Two-Level Hill... · Design of a Cryptosystem Using Two-Level Hill ... useless to withhold any specific

www.ijaret.org Vol. 2, Issue I, Jan. 2014 ISSN 2320-6802

INTERNATIONAL JOURNAL FOR ADVANCE RESEARCH IN

ENGINEERING AND TECHNOLOGY WINGS TO YOUR THOUGHTS…..

Page 41

(b)

Figure 4: Decryption Using Two-Level Hill Cipher

(a) Decrypted Image, (b) Histogram of Decrypted Image

6. CONCLUSIONS The competent method of encryption of an illustration is

presented in this paper. Two-Level Hill Cipher is a fast

encryption technique which can provide satisfactory

results against the normal hill cipher technique. It can

easily resist to the infamous “Known Plain Text Attack”

(KPTA) for secure transmission of graphic encoded

information while taking over various limitation in the

aspect of efficiency and security of various encryption

technologies of previous generation. Hence this hybrid

system proves to be a very sound technique for

transferring messages from sender to the receiver,

achieving confidentiality as well as message

authentication.

REFERENCES [1] 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, Issue. 1, Vol.

1, May 2009.

[2] Bibhudendra Acharya, Girija Sankar Rath,

Sarat Kumar Patra, Saroj Kumar Panigrahy.

“Novel Methods of Generating Self-Invertible

Matrix for Hill Cipher Algorithm”,

International Journal of Security, Vol 1, Issue

1, 2007, pp. 14-21.

[3] S.K.Muttoo, Deepika Aggarwal, Bhavya

Ahuja. ”ASecure Image Encryption Algorithm

Based on HillCipher System” , Buletin Teknik

Elektro dan Informatika (Bulletin of Electrical

Engineering and Informatics) Vol.1, No.1,

March 2012, pp. 51~60 ISSN: 2089-3191

[4] Rushdi A. Hamamreh, Mousa Farajallah, “

Design of a Robust Cryptosystem Algorithm

for Non-Invertible Matrices Based on Hill

Cipher”, International Journal of Computer

Science and Network Security, 2009.

[5] Bibhudendra Acharya, Mohammad Imroze

Khan, S K Patra, G Panda. “Implementation

of Hybrid Cryptosystem Using Non-Invertible

Matrices Based on Hill Cipher and RSA

Algorithm”

[6] Saroj Kumar Panigrahy, Bibhudendra

Acharya, Debasish Jena” Image Encryption

Using Self-Invertible Key Matrix of Hill

Cipher Algorithm” 1st International

Conference on Advances in Computing,

Chikhli, India, 21-22 February 2008

[7] Bibhudendra Acharya, Debasish Jena, Sarat

Kumar Patra, and Ganapati Panda.

“Invertible, Involutory and Permutation

Matrix Generation Methods for Hill Cipher

System”, International Conference on

Advanced Computer Control, 2009.

[8] W. Stallings, Cryptography and Network

Security, 4th

edition, Prentice Hall, 2005

[9] Blakley G.R., “Twenty years of cryptography

in the open literature”, Security and Privacy

1999, Proceedings of the IEEE Symposium, 9-

12 May 1999

[10] A. J. Menezes, P.C. Van Oorschot, S.A. Van

Stone, “Handbook of Applied

Cryptography”,CRC press, 1996