You are on page 1of 6

Ciphers based on Special Graphs

Priyadarsini P. L. K.* Ramakalyan Ayyagari


Department of Computer Science Department of Instrumentation and Control Engineering
PRIST University National Institute of Technology
Thanjavur, India Trichy, India
priya.ayyagari@yahoo.co.in rkalyan@gmail.com

Abstract— Applications of Graph theory in Cryptography have Hadamard matrices can be obtained by changing labeling of
recently gained momentum. In the last two decades new methods the Shrikhande graph vertices in 16! ways. Hence cracking
of encryption and decryption using extremal graph theory and key from 16! (which is equal to 20,922,789,888,000) random
expander graphs have been proposed. In this work, new permutations, makes the algorithm stronger against attacks.
algorithms for binary encoding and decoding are designed. These The performance of encoding and decoding algorithms is
algorithms use Hadamard encoding by generating random
tested with different images and text messages.
Hadamard matrices of order 16 X 16 from strongly regular
graphs that have a specific property. Choice of keys from 16!
number of random permutations makes the algorithms stronger Rest of the paper is organized as follows. In the next
against attacks. The performance of these algorithms is section, a brief survey on graph theory in the field of
demonstrated on different images and text messages. cryptography is given. In section III, details of the algorithm
are given after presenting some preliminaries. Results are
Keywords—Encryption, Decryption, Hadamard Matrices, Strongly discussed in section IV and the paper is concluded in section
Regular Graphs V.
I. INTRODUCTION II. LITERATURE SURVEY

In recent years there has been an explosive growth in the Gideon [2] patented an encryption method based on
use of computers and their network connections. Military charting a path on a graph which is the encryption key.
communications amass a great deal of confidential Mittenthal [3] proposed methods for finding complete Latin
information and hence it is needless to mention how much squares based on the concept of directed graphs. In [4], Lu et
important it is to keep the confidentiality, authentication and al proposed a new visual cryptography scheme that allows
access control in all the defence communications. This led to for sharing of multiple secret images on graphs.
the importance of protecting information and the systems from
network attacks [1]. The idea to use families of simple graphs of large
girth in Cryptography had been explored in [5 -11]. The
Graph theory has always been in main stream research general idea in [5, 6] is to consider the set of vertices as the
because of its applications in diverse fields such as plainspace and a path in the graph as an encryption tool such
biochemistry, coding theory, communication networks and as password. The absence of short cycles ensures that
their security etc. In particular researchers are exploring the different passwords convert chosen plaintext to different
concepts from graph theory that can be put to use in different ciphertexts. In [7-10], the cryptographical properties of
areas of Cryptography [2-18]. infinite families of simple graphs of large girth with special
colouring of vertices were investigated.
In the proposed work, new algorithms for encoding based
on strongly regular graphs that have a specific property, and a An expander graph is a graph with a property that
corresponding decoding algorithm were designed. It is a every subset of the vertices has many neighbors. This concept
hybrid cryptosystem operating with a combination of was used in [12-15] for solving different problems in
symmetric key and a public key. Simplicity and speed Cryptography.
strengthen the algorithms.
Codes generated by the adjacency matrix of a graph
Shrikhande graph is a strongly regular graph having did not get the deserved attention, specifically of strongly
above mentioned specific property. The proposed algorithms regular graphs [16]. In [17], theoretical properties of Binary
use Hadamard codes by generating a Hadamard matrix of codes of Strongly Regular Graphs, in general, were derived.
order 16 X 16 from Shrikhande graph and by increasing it to The properties of Ranks of the Adjacency Matrices of graphs,
the required size using Sylvester method. Shrikhande graph Strongly Regular Graphs in particular were given in [18, 19]
with a specific labeling will be private key. Different Tonchev [20] derived Binary codes from the Hoffman-
Singleton and Higman-Sims graphs.
*This research work is sponsored by Defence Research and Development
Organization (DRDO), Govt. of India, New Delhi

978-1-4673-6217-7/13/$31.00 2013
c IEEE 460
III. PROPOSED WORK 10
11

A. Preliminaries
1 2

Adjacency matrix of a simple graph G [21] on n vertices is 12


9
an n × n matrix of entries aij, ‫ ͳ׊‬൑ ݅ǡ ݆ ൑ ݊ such that
8 3
aij = 1 if (vi , vj ) ∈ G

0 otherwise. 7 4

16 13
A regular graph is a graph with vertices of equal degree, i.e.
every vertex of a regular graph has a fixed number of edges 6 5
incident on them. If that degree is k then the graph is said to be
having valency k.
15
A strongly regular graph [16] with parameters (n; k; Ȝ; ȝ) is 14
a graph on n vertices which is regular with valency k and has Fig 1: Shrikhande Graph
the following properties:
Let G be a strongly regular graph with parameter set (n; k;
• Any two adjacent vertices have exactly Ȝ common Ȝ; ȝ) and A be its adjacency matrix. If these parameters have
neighbours. following values:
• Any two nonadjacent vertices have exactly ȝ common
k = (n í İ¥n)/2 and / or
neighbours.
Ȝ = (n í 2İ¥n)/4 and / or
ȝ = (n í 2İ¥n)/4 )
A Hadamard matrix H [22] of order n is an n × n matrix of
1s and -1s with a property that where ¦ is േ1.

HHT = n In Then J í 2A will be a regular graphical Hadamard matrix


where J is a unit matrix. The type of this matrix (positive or
where In is n×n identity matrix and HT is the transpose of H. negative) depends on ¦ value [23]. Shrikhande Graph has
Equivalently, a Hadamard matrix is an n× n matrix of 1s and this property because it is with all the above said parameter set
-1s in which any two distinct rows agree in exactly n/2 with ¦ = +1 and n = 16.
positions (and thus disagree in exactly n/2 positions.) A
Hadamard matrix is called graphical if it is With these preliminaries, the proposed algorithm is briefly
symmetric with identical diagonal elements. given in the next subsection.

Hadamard matrix of order i+1 can be constructed from a


Hadamard matrix of order i as follows, by using Sylvester B. The algorithm
Method [24-26]:
Algorithm uses the adjacency matrix of Shrikhande
Graph as a private key. Distinct A matrices and corresponding
Hadamard Matrices can be generated by changing vertex
labels in 16! ways. This results in computational difficulty to
Hi+1 = crack the code by the intruder as one has to try all the 16!
ways of labeling in order to get the private key. Hadamard
matrices of higher orders which are even multiples of 16 can
Shrikhande Graph is a strongly regular graph with be constructed, starting from 16 X 16 matrix, by using
parameters (16, 6, 2, 2) i.e. it is a graph with 16 vertices each Sylvester Method. It can easily be observed that both encoding
having degree six. Any pair of adjacent vertices or any pair of and decoding algorithms are of polynomial time complexity.
nonadjacent vertices have exactly two common neighbours.
Figure 1 below illustrates Shrikhande Graph. Encoding Algorithm:
1. The adjacency matrix of a Shrikhande graph with fixed
labels will be a private key available with both the sender
and the receiver. This is selected from 16! choices.

2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI) 461
2. Generate randomly, a permutation of numbbers 1 to 16. This value for each pixel. The largest JPEG image was of size
permutation vector will be of size 64 bits. 545 X 365 and all the images are withw 0 to 255 RGB values.
The processing is faster as the algorrithm is of polynomial time
3. Obtain new labeling for the Shrikhande grraph, by applying
complexity. The algorithm performss accurately on all images.
the above permutation to the availabble private key
(Adjacency Matrix) and construct the new adjacency matrix
The encoding of GIF images can c be viewed as a cipher
A16 X 16.
n Figure 2(a – b).
images and two of them are given in
4. Construct Hadamard Matrix H16X16 = J16 X 16 – (2 . A16 X 16 )
5. Let the message be a text overr an alphabet
Ȉ ൌ  ሼߪଵ ǡ ߪଶ ǥ ߪଶ௡ ሽ. Without loss of gennerality, it can be
assumed that n is a power of 2, as the text mmessages or RGB
images are taken as binary representaations. Construct
Hadamard matrix of order n, say Hn , from H16 using
Sylvester method.
6. Now consider the 2n × n matrix

Fig 2(a)- Encoding of a GIF Image


C=

Let ci be the ith row of C. Encode the mmessage over the


alphabet Ȉ by substituting any symbol ıi ∈ Ȉ , with ci for
all 1 ” i ” 2n
7. The message encoded as described above,, padded with the
permutation vector will be sent across to tthe receiver.

Decoding Algorithm:
Fig 2 (b) : Encoding of another GIF Image
1. When a sequence of n-vectors is receiveed along with the
permutation, obtain new labeling for the Shrikhande Decoding of the images is correctlly done in all the formats.
graph, by applying the permutation to the available private The original images are given in figures 3- 8(a) and
key (Adjacency Matrix) and constructt new adjacency corresponding decoded images are shown for a comparison in
matrix A16 X 16. figures 3 - 8(b) respectively.
2. Construct the Hadamard Matrices H16, Hn and a matrix C,
as described in the encoding algorithm.
3. Now, decode each of the blocks containiing n symbols, in
the received message, using C. Let v bee any n-vector of
encoded symbols. Search for any row ci oof C that matches
with v in more than n − 1 positions.
4
4. Decode that block of n symbols as ıi . A Assuming that the
message is transmitted with at most n/4 errors [22], this
method results in correct decoding of the m
message. Fig 3(a)

IV. RESULTS

The algorithm is programmed using Matlabb for checking its


performance. Text messages were encodeed and decoded
correctly and the results are not given for breevity. In general,
encoding of Images in GIF format can be ccarried out easily
when compared to JPEG format as JPEG hass RGB values for
each pixel. Among the images used for encrypption, largest GIF
image was of size 650 X 491 and the imagees are with 8-bit
Fig 3(b)

462 2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI)
Fig 6(a): Defence Image 545 X 365
Fig 4(a) : Satellite Image 650 X 491

Fig 6(b)
Fig 4(b)

Fig 5 (a) 552 X 350


Fig 7(a) 545 X 365

Fig 5(b)
Fig 3 - 5 (a): original images in GIF format
Fig 3 - 5 (b): Decoding of images in figures 3 - 5(aa) respectively Fig 7(b)

2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI) 463
Fig 8(a) 545 X 365
Fig 10: Histogram of corresponding decoded GIF Image

Fig 8(b)
Fig 6 - 8 (a) original images in JPEG format
Fig 6 - 8 (b): Decryption of images in figures 6 - 8(a) respectively
Fig 11: Histogram of an original JPEG Image

The following histograms show the correspondence


between the original image and the image after
decoding.

Fig 12: Histogram of corresponding decoded JPEG Image

V CONCLUSIONS

Fig 9: Histogram of an original GIF Image The objective of our work is to develop simple and
efficient cryptographic algorithms using the concepts from
Graph Theory. It can easily be verified that both the

464 2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI)
algorithms presented here have polynomial time complexity [8] V. A. Ustimenko, On Graph-Based Cryptography And Symbolic
and their implementation is simple. Computations, Serdica J. Computing, Vol 1, pp. 131-156, 2007

The algorithms use the methodology of Hadamard [9] J.S.Kotorowicz_ and V.A.Ustimenko, On The Implementation Of
coding. But a new approach for the generation of random Cryptoalgorithms Based On Algebraic Graphs Over Some Commutative
Hadamard matrices is proposed. This generation of random Rings, Condensed Matter Physics Vol. 11, No 2(54), pp. 347–360, 2008
Hadamard matrices out of n! choices for encoding and
decoding, makes the algorithms resistant to attacks as the [10] V. Ustimenko, On the hidden discrete logarithm for some polynomial
intruder has to check all the choices to get the basic graph stream ciphers, Proceedings Of The IMCSIT. Vol 3, pp. 297–301, 2008
labeling. Any other strongly regular graph [24] can also be
considered for the construction of Hadamard matrix if it has [11] V. Ustimenko, On Extremal Graph Theory for Directed Graphs and its
the parameter set as ( n, (n í İ¥n)/2, (n í 2İ¥n)/4, (n í Applications to Information Security,
2İ¥n)/4 ) where n is the number of vertices. Computational http://www.imath.kiev.ua/~congress2009/Abstracts/Ustymenko.pdf
difficulty of cracking the code increases exponentially with
choice of strongly regular graph with larger n. [12] D. Song,_D. Zuckermany and J. D. Tygar, Expander Graphs for Digital
Stream Authentication and Robust Overlay Networks, Proceedings of
Video cameras, image scanners, and digital cameras, the 2002 IEEE Symposium on Security and Privacy (S&P.02), 2002
computer and mobile phone displays etc use RGB format for
images. Among different image formats, encryption of RGB [13] D. Jao, Stephen D. Miller and R.Venkatesan, Expander graphs based on
images is complicated as each pixel consists of three 8-bit GRH with an application to elliptic curve cryptography,
values. It is observed that the proposed technique does lossless http://arxiv.org/abs/0811.0647v2
encryption, decryption and it works faster for RGB and many
other formats. [14] D. X. Charles and K. E. Lauter, Cryptographic Hash Functions from
Expander Graphs, J. Cryptology, Vol. 22, pp. 93-113, 2009

ACKNOWLEDGMENT [15] O. Goldreich, Candidate One-Way Functions Based on Expander


Graphs, http://www.wisdom.weizmann.ac.il/~oded/COL/ow-cand.pdf

The first author would like to thank Defence Research and


[16] P. J. Cameron, “Strongly regular graphs”,
Development Organization, Government of India, for designtheory.org/library/preprints/srg.pdf
sponsoring this research and the authorities of PRIST
University for the support. [17] W. H. Haemers, R.´E Peeters and J. M. V. Rijckevorsel, Binary Codes
of Strongly Regular Graphs, Designs, Codes and Cryptography, 17, pp.
187–209 , 1999
REFERENCES
[18] A. E. Brouwer and C. A. van Eijl, On the p-Rank of the Adjacency
[1] W. Stallings, Cryptography and Network Security Principles and Matrices of Strongly Regular Graphs, J. Algebraic Combin., Vol. 1 pp.
Practices, Prentice Hall India, 2006 329–346, 1992

[2] S. Gideon, “Denial Cryptography based on Graph Theory”, US patent [19] R. Peeters, Ranks and Structure of Graphs, dissertation, Tilburg
6823068-2004 http://www.patentstorm.us/patents/6823068.html University , 1995

[3] L. Mittenthal, “Sequencings and Directed Graphs with Applications to [20] V. D. Tonchev, Binary codes derived from the Hoffman-Singleton and
Cryptography”, S.W. Golomb et al. (Eds.): Springer-Varlag LNCS 4893, Higman-Sims graphs, IEEE Trans. Inform. Theory, Vol. 43, pp. 1021–
2007, pp 70-81 1025, 1997

[4] S. Lu, D. Manchala and R. Ostrovsky, “Visual Cryptography on [21] D.B.West, Introduction to Graph Theory, Prentice Hall of India, 1999
Graphs”, COCOON 2008: pp. 225-234, 2008.
[22] Weisstein, Eric W., Hadamard Matrix from MathWorld, A Wolfram
[5] V. Ustimenko, “CRYPTIM: Graphs as tools for symmetric encryption” Web Resource accessed April 14, 2013
in Lecture Notes in Comput. Sci., vol. 2227, 2001 <http://mathworld.wolfram.com/HadamardMatrix.html>

[6] V. A. Ustimenko, “Graphs with Special Arcs and Cryptography”, Acta [23] W. H. Haemers, Strongly Regular Graphs with Maximal Energy,
Applicandae Mathematicae, Vol. 74, No. 2, pp. 117-153, 2002 Tilburg University discussion paper, No. 2007–37, 2007

[7] Ustimenko V.A., “On Linguistic Dynamical Systems, Graphs of Large [24] Parameters of Strongly Regular Graphs, accessed April 14, 2013
Girth and Cryptography”, J. of Mathematical Sciences, Springer, vol
<http://www.win.tue.nl/~aeb/graphs/srg/srgtab.html>
140-3, pp. 412-434, 2007.

2013 International Conference on Advances in Computing, Communications and Informatics (ICACCI) 465

You might also like