Você está na página 1de 24

A Thesis Proposal

on

An Encryption algorithm using Graph theory using XOR operator

For Partial Fulfillment of the Requirements for the Degree of


Master of Science in Computer Science Awarded by
Pokhara University

Submitted by
Manoj Giri
MSc Cs
Roll No.
172540

DEPARTMENT OF GRADUATE STUDIES

NEPAL COLLEGE OF INFORMATION TECHNOLOGY


Pokhara University
Balkumari, Lalitpur, Nepal

April 27, 2019


ABSTRACT

Cryptography involves creating written or generated codes that allow information to be kept
secret. Cryptography converts data into a format that is unreadable for an unauthorized user,
allowing it to be transmitted without unauthorized entities decoding it back into a readable
format, thus compromising the data. There are lots of algorithm for encrypting a given data and
turn it into not readable form. One of the method is using Graph theory and matrix calculation
for the encryption process. Wael Mahmood has presented one of such method where we can use
Graph for encryption purpose. But, there are lot of unanswered things involved in Mahmood’s
work. In this research an attempt has been made to answer such questions.

Keywords: Cryptography; Graph theory; encryption algorithms;

i
Table of Contents

Abstract i

Table of Contents ii

List of Figures iv

List of Tables v

1 INTRODUCTION 1
1.1 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Symmetric ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Asymmetric ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Graph theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.7 Research Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 LITERATURE REVIEW 6
2.1 Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Uses of Graph theory in Cryptography . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Wael Mahmoud Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.1 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Encryption Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.3 Decryption Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5 Drawbacks of Algorithm presented by Wael Mahmood . . . . . . . . . . . . . 12

3 PROPOSED RESEARCH 13

ii
iii

4 METHODOLOGY 14
4.1 True Experimental research . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.1 Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2 Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.3 Randomization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Research flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.1 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.2 Data Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2.4 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5 DELIVARABLES 17

Bibliography 18
List of Figures

Figure 1.1: Symmetric Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2


Figure 1.2: Symmetric Ciphers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Figure 1.3: Example of a Graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 1.4: Adjacency matrix for graph in 1.3 . . . . . . . . . . . . . . . . . . . . 4

Figure 2.1: Conversion to Vertex . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


Figure 2.2: Weighted graph for the plain text character . . . . . . . . . . . . . . . . 10
Figure 2.3: Complete plain graph with special character . . . . . . . . . . . . . . . 10
Figure 2.4: Minimum spanning Tree Graph . . . . . . . . . . . . . . . . . . . . . 11

Figure 4.1: Flow diagram for the research . . . . . . . . . . . . . . . . . . . . . . 15

iv
List of Tables

v
Chapter 1
INTRODUCTION

1.1 Cryptography

Cryptography has always been an important task. The main goal of every cryptographic activ-
ity is Data Security (e.g. “hiding messages from unauthorized eyes”). Cryptography encodes
messages in such a way, that only the sender and the receiver can understand them. One famous
story, if not the most famous story, about cryptography is the break of the ENIGMA-Code [1]
in World War II. The British MI6 made an enormous effort to break into ENIGMA – with
success by the way. Some estimations say, that without this, the end of the war would have
been at least six months later... Cryptography, or “Crypto Analysis” if we’re talking just about
“breaking codes”, is an interesting research area, in particular for military purposes, obviously.
Today, cryptography has its place not only in the army, but also in the civilian sector: With the
upcoming mainframe computers in the seventies and with the personal computers in the eight-
ies, cryptography has become available to everyone. Nowadays an ordinary PC can produce
codes of such complexity, that the most powerful supercomputer, using the best available attack
algorithms, would not break them in millions of years! Cryptography is used to secure tele-
phone, internet, and email communication and to protect software and other digital property.
Generally: to keep privacy in the bad world of communication [2].

1.2 Symmetric ciphers

Classical (symmetric) algorithms, such as DES, are based on a common secret key for both,
encryption and decryption. This is the reason why this scheme is also called “Secret-Key”-
Scheme:

As all cryptographic algorithms, symmetric ones have their strengths and weaknesses, too.
Their strengths include especially fast encryption/decryption. However, their weaknesses in-

1
2

Figure 1.1: Symmetric Ciphers

clude the need for a separate (secure) channel for key transfer, and the need for very complex
key management. Especially the key transfer is a big problem [3].

1.3 Asymmetric ciphers

Asymmetric ciphers are based on principles that differ to those governing symmetric ones in
the following ways:

• The encryption key is different than the decryption key.

• The decryption key cannot be calculated from the encryption key (i.e. it is a one- way
function).

Such a scheme is also called a “Public-Key”-Scheme, because the encryption key is made
public. This way, a complete stranger can use the encryption key to encrypt a message, but
only someone with the corresponding decryption key can decrypt the message. The encryption
key is called the Public Key, and the decryption key is called the Private Key. Opposing to the
Secret-Key-Cryptography, the pool of good Public-Key algorithms is far smaller. Today, the
best-known and also most used asymmetric cipher, is RSA [3].

Asymmetric ciphers provide secrecy by having the sender use the receiver’s public key to en-
crypt the data, while only the intended receiver, using his private key, can decrypt the data and
use it 1.2

Again, asymmetric ciphers offer both, strengths and weaknesses. Their primary weakness is
that encryption/decryption is relatively slow, involving intensive computations. Their strengths
3

Figure 1.2: Symmetric Ciphers

include:

• Fewer security issues in key transfer (all public).

• Simple key management (Nusers −→ N publickeys)

1.4 Graph theory

Although graph theory is one of the younger branches of mathematics, it is fundamental to a


number of applied fields, including operations research, computer science, and social network
analysis. The fundamental concept of graph theory is the graph, which (despite the name) is
best thought of as a mathematical object rather than a diagram, even though graphs have a very
natural graphical representation.

Graph definition: A graph – usually denoted G(V, E)orG = (V, E) – consists of a set of ver-
tices V together with a set of edges E. The number of vertices in a graph is usually denoted n
while the number of edges is usually denoted m.

Vertices: Vertices are also known as nodes, points and (in social networks) as actors, agents or
players.

Edges: Edges are also known as lines and (in social networks) as ties or links. An edge
e = (u, v) is defined by the unordered pair of vertices that serve as its end points.

As an example, the graph depicted in Figure 1.3 has vertex set V = a, b, c, d, e. f and edge set
E = (a, b), (b, c), (c, d), (c, e), (d, e), (e, f ).

Adjacency: Two vertices u and v are adjacent if there exists an edge (u, v) that connects them.
4

Figure 1.3: Example of a Graph.

Incidence: An edge (u, v) is said to be incident upon nodes u and v.


Loops: An edge e = (u, u) that links a vertex to itself is known as a self-loop or reflexive tie.
Adjacency matrix: Every graph has associated with it an adjacency matrix, which is a binary
n × n matrix A in which ai j = 1 and a ji = 1 if vertex vi is adjacent to vertex v j , and ai j = 0 and
a ji = 0 otherwise. The natural graphical representation of an adjacency matrix is a table, such
as shown in 1.4:

Figure 1.4: Adjacency matrix for graph in 1.3

Completeness: Examining either 1.3 or 1.4, we can see that not every vertex is adjacent to
every other. A graph in which all vertices are adjacent to all others is said to be complete.
5

1.5 Motivation

The availability of high speed digital hardware has made the implementation of high grade
cryptographic devices possible, so that they find their application in commercial fields such as
remote cash dispensers and computer terminals. In turn, such applications create a need for
few types of cryptographic system which minimizes the necessity of secure key distribution
channels and supply the equivalent of written signature. At the same time theoretical develop-
ment in information theory and computer science show promise of providing provably secure
cryptosystem.

It is necessary to secure the secrets secret, in this context, we need to have a cryptosystem
which is provably secure and it should give a great deal of security. Graph theory provided
immense of application to cryptography using the same a highly secured system can be devised.
Cryptography can be used to provide confidentiality using encryption methods and can also
provide data integrity, authentication and non-repudiation. The purpose of this thesis is to
deploy Graph theory based cryptography schemes for secure sharing of data. The Algorithm
proposed in this thesis can help in increasing the accuracy and completeness of Encryption
techniques.

1.6 Problem Statement

The research problem taken up is to create an encryption technique, using XOR and basic
Matrix operation which is better in Time Complexity and Space Complexity when compared
to Wael Mahmoud’s algorithm.

1.7 Research Objectives

The main objectives of this research are:

• To propose Graph based encryption algorithm using XOR operator.

• To study the feasibility of Graph based encryption algorithm using XOR operator.

• To improve the algorithm presented by Wael Mahmood in [5].


Chapter 2

LITERATURE REVIEW

2.1 Cryptography

The field of cryptography deals with the techniques for conveying information securely. The
goal of cryptography is to allow the intended recipients of a message to receive the message se-
curely. Cryptography tries to prevent the eavesdroppers from understanding the message. The
message in its original form is called plaintext. The transmitter of a secure system will encrypt
the plaintext in order to hide its meaning. This meaning will be revealed only after the correct
recipient tries to access it. This reversible mathematical process produces an encrypted output
called cipher-text. The algorithm used to encrypt the message is a cipher. The unauthenticated
user can also try to access the information. The analysis is carried out to check if cipher’s secu-
rity is satisfactory from unauthorized access. Cryptanalysis is the science of breaking ciphers,
and cryptanalysts try to defeat the security of cryptographic systems. A cipher-text can be
transmitted openly across a communications channel. Because of its encrypted nature, eaves-
droppers who may have access to the cipher-text will ideally be unable to uncover the meaning
of the message. Only the intended recipient, who has the valid key, can decrypt the message to
recover the plaintext and interpret.

Ciphers can be classified using several criteria. According to one criterion, the ciphers are clas-
sified as symmetric key and asymmetric key. In symmetric key ciphers, the same key is used
for both encryption and decryption. A major problem with such a system is that the sender and
receiver must know the key prior to transmission. This requirement makes such a system diffi-
cult to use in practice. The key cannot be openly transmitted since that would compromise the
security of system. One possibility is for the two parties to meet and exchange the keys prior
to transmitting their messages. However, this exchange becomes more difficult when many
parties are involved in a communications network. An asymmetric key cipher uses different

6
7

keys for encryption and decryption [4]. These two keys are mathematically related, but it is
very difficult to obtain one from the other unless one knows the transformation. The key used
for encryption is called the public key and the key used for decryption is called the private
key. The public key can be revealed without compromising the security of the system. The
corresponding private key, however, must not be revealed to any party. Currently information
is electronically processed and conveyed through public networks. The main objective of cryp-
tography is, to conceal the content of messages transmitted through insecure channels such
that it guarantees privacy and confidentiality in the communications to the authorized users.
Since the early 1960‘s, cryptography has no longer been restricted to military or governmental
concerns, that has spurred an unprecedented development of cryptographic technique [9]. This
advancement of digital communication technology benefitted the field of cryptography. The
efficient encryption schemes were designed.

2.2 Uses of Graph theory in Cryptography

Yamuna M et. al. [10] presented an encryption mechanism using Hamilton path properties(path
that covers all vertices in the graph), they encrypt data twice, once using the Hamilton path,
and the second using the complete graph to impose more secure method. Rick Kilma and Neil
Sigmon showed how graph can be used in cryptanalysis of Vigenere ciphers. Ustimenko VA [6]
used symbolic computations techniques to create a public key mode based on algebraic graphs
that can be used for the implementation of secure and fast symmetric encryption algorithm. In
[7], they present a method of using paths between a pair of graph vertices for designing poly-
alphabetic substitution ciphers, and also they modify the labels of vertices or edges (arcs) of
the graph in order to influence the statistical properties and period lengths. Steve et. al.[8] use
an arbitrary graph where every node and every edge are assigned an arbitrary image; Images
on the vertices are “public” and images on the edge are “secret”, using this approach, pixel
expansion and contrast are proportional to the number of images.

2.3 Wael Mahmoud Algorithm

In [5], they considered an un-directed graph G(V, E), where V is the set of vertices and E is a
set to edges that connect vertices each other. Graphs are represented in two ways, adjacency-
list and adjacency-matrix. The adjacency-list representation of a graph G(V, E) consists of an
8

array of V lists, one for each vertex in V . For each vertex v, the adjacency-list of v contains all
vertices adjacent (there is an edge between them) to him. The adjacency-matrix representation
of graph G(V, E) consists of a |V | ∗ |V | matrix gi j such that:

 1, if ij∈E,

gi j =
−1, otherwise.

for unweighted graph and Wi j in place of 1 if it is a weighted graph.

2.3.1 Algorithm

The first step as suggested in [5], is to represent data as vertices in a graph, each character
represented by a vertex while all adjacent characters in the data will be represented as adjacent
vertices in the graph, we keep adding vertices until we form a cycle graph. Every edge in the
graph has its own weight represents the distance of these two characters in the encoding table,
which is used to encode all alphabets characters. Then each vertex in the graph will joined
with edges to make the graph a complete graph, while every new added edge has a sequence
weight started from the last index in the encoding table. Adjacency matrix is constructed for
the complete graph. After that Minimum Spanning Tree (MST) is computed from the complete
graph and represented as adjacency-matrix that keeps data characters order in its diagonal.
Adjacency-matrix of the complete graph multiplied to the adjacency matrix of MST. The re-
sultant matrix multiplied to the key matrix. The final matrix is the encryption data to be sent to
the recipient.

2.3.2 Encryption Steps

• Add a special character to indicate the starting character (Let $).

• Add vertex for each character in the plain text to the graph.

• Link vertices together by adding an edge between each sequential character in the plain
text until we form a cycle.

• Weight each edge using the encoding table. Each edge’s weight represents the distance
9

between the connected two vertices from the encoding table.

• Adding more edges to form a complete graph M1 , each new added edge has a sequential
weight starting from the maximum weight in the encoding table.

• Then, find the minimum spanning tree M2 .

• Then store the vertices order in the M2 matrix in the diagonal places.

• Then we multiply M1 and M2 to get M3 .

• After that we multiply M3 by a predefined Shared key K to form C.

• The Cipher text contains Matrix C and Matrix M1 line-by-line in a linear format.

2.3.3 Decryption Steps

• The receiver computes M3 by using the inverse form of the shared key K − 1.

• Then compute M2 by using the inverse form of M1 .

• Then compute the original text by decoding M1 using the encoding table.

2.4 Example

Encryption process:

The example taken from [5] is described here: Suppose we want to encrypt the message WAEL
to send it to the receiver. The first step is to convert the message to graph, by converting each
character to a vertex: In the next step, each sequential characters are linked together to form a

Figure 2.1: Conversion to Vertex

Cycle graph. Then we weight each edge using the encoding table(We have assumed the stan-
dard ASCII code as the encoding table). The weight of an edge represents the distance between
the connected two vertices from the encoding table. So, distance between two characters X1
10

and X2 is: Code(X1 )˘Code(X2 ). The weighted Graph containing plain text characters is in fig-
ure 2.2. Now, we keep adding edges to form a complete graph; each new added edge has a

Figure 2.2: Weighted graph for the plain text character

sequential weight starting from the maximum weight in the encoding table, which is 255+1 in
the case of ASCII values. We add a special character before the first character to point to the
first character, let it be the character whose ASCII value is 0. The complete graph with added
special character is shown in figure 2.3.

Figure 2.3: Complete plain graph with special character

We represent the graph in figure 2.3 in the form of adjacency matrix, M1 .


 
0 87 0 0 0
 
87 0 −22 256 11 
 
 
M1 =  0 −22 0
 
4 257
 
 
 0 256 4 0 7 
 
0 11 257 7 0
11

In the next step, we need to find the Minimum spanning tree of the graph presented in figure
2.3, which is shown in figure 2.4:

Figure 2.4: Minimum spanning Tree Graph

We represent this graph in the form of adjacency matrix as we did previously. Let this matrix
be M2 .  
0 87 0 0 0
 
87 0 −22 0 0
 
 
M2 =  0 −22 0 4 0
 
 
 
0 0 4 0 7
 
0 0 0 7 0

The order of characters is stored in the diagonal. So, instead of 0 in the diagonal we put the
order number of characters. So modified M2 will be:
 
0 87 0 0 0
 
87 1 −22 0 0
 
 
M2 =  0 −22 2 4 0
 
 
 
0 0 4 3 7
 
0 0 0 7 4
12

The next step is we multiply M2 , M1 and store it in M3 .


 
7569 87 −1914 0 0
 
 
 0 8053 980 757 1836
 
M3 = −1914 −22
 
500 1811 1056
 
168 −5624 65
 
 22272 28 
 
957 −5643 300 1049 49

Now, M3 is multiplied with the shared key K. The data send to other side will be M3 ∗ K.

Decryption Process:

The shared data will be multiplied with K − 1, which returns M3 . And, when multiplied M3 by
M1 − 1, we get the original M2 ; from where we can fetch the message.

2.5 Drawbacks of Algorithm presented by Wael Mahmood

In the receiver side, Wael Mahmood [5] says that we need to compute M1 using M2 − 1 which
is very confusing. How the receive will get M2 ? If we need some separate channel to send M2
to the receiver then this encryption algorithm will be of no sense. Furthermore, he described a
very poor technique at the beginning of Algorithm. Why should one turn the initial graph into
complete graph and then again turn the complete graph into minimum spanning tree which in
actual return the original graph?
Chapter 3

PROPOSED RESEARCH

In this research work, we propose an algorithm for cryptography using Graph theory, basic
Matrix operations and XOR operator. Basically, we deal most of the time with the algorithm
presented by Wael Mahmood and we propose that their exist a better solution for the task which
Wael Mahmood did; better in both – space and time complexity as well as from the view of
Algorithmic correctness.

13
Chapter 4

METHODOLOGY

This research is a total experimental research. Experimental is the most scientifically sophis-
ticated research method. It is defined as the “Observation under controlled” condition. Ex-
perimental research designs are concerned with the examination of the effect of independent
variable on the dependent variable, where the independent variable is manipulated through
treatment or intervention(s), and the effect of those interventions is observed on the dependent
variable. There are generally three types of Experimental designs: pre experimental design.
Quasi experimental design and True Experimental design. This research being a True Experi-
mental research, the focus will be only on this method of research.

4.1 True Experimental research

True experimental research designs are those where researchers have complete control over
the extraneous variables and can predict confidently that the observed effect on the dependent
variable is only due to the manipulation of the independent variable. A true experimental
research design must essentially consists of the following three characteristics: Manipulation,
Control and Randomization.

4.1.1 Manipulation

Manipulation refers to conscious control of the independent variable by the researcher through
treatment or intervention(s) to observe its effect on the dependent variable. In other words, it is
a conscious act by the researcher, where he or she varies the independent variable and observes
the effect that manipulation has on the dependent variable of interest.

14
15

4.1.2 Control

Control is another essential element of true experimental design. Control refers to the use of
control group and controlling the effects of extraneous variables on the dependent variable in
which researcher is interested. The subject in the control and experimental groups are similar
in number and characteristics, but the subject in the control group receive no experimental
treatment or any intervention at all. The experimental group receives the planned treatment
or intervention and comparison is made with the control group to observe the effect of this
treatment or intervention.

4.1.3 Randomization

Randomization means that every subject has an equal chance of being assigned to experimental
or of study subjects on a random basis. Through random assignment of subject under experi-
mental or control group. Chances of systematic bias is eliminated. Randomization is used in
true experimental research design to minimize the threat of internal validity of the study and
to eliminate the effect of extraneous variables on dependent variables. Through randomization,
on average the characteristics of the subject in experimental and control groups are similar,
thus influence of extraneous variables on dependent variable is eliminated by dispersing the
variability of the subject characteristics equally in both the groups.

4.2 Research flow

Figure 4.1: Flow diagram for the research

4.2.1 Literature Review

The Literature in the field of Database will be gathered. Functional Dependency and Database
Normalization are the key terms for our literature.
16

4.2.2 Data Collection

The data will be generated manually with different set of plaintexts. Data are generated in such
a way so that they can cover a huge variations. Generation of around 10000 set of data will be
enough for this research.

4.2.3 Implementation

The algorithm proposed by Wael Mahmoud will be modified and will be implemented using
a programming language to check the correctness. The modified version of algorithm is pre-
sented below:

4.2.4 Analysis

The Space and Time Complexity will be analyzed in this phase and a comparative study will be
done. An attempt will be done to test some cryptanalysis methods for the presented algorithm
in this thesis.
Chapter 5

DELIVARABLES

The completion of this research will end up with an Encryption and Decryption module using
Graph Theory. And, the result of different Cryptanalysis over the cipher text will also be
discussed.

17
Bibliography

[1] B. Schneier, “Applied cryptography, ohn wiley & sons inc,” New York, New York, USA,,
1996.
[2] F. L. Bauer, Entzifferte geheimnisse: methoden und maximen der kryptologie. Springer-
Verlag, 2013.
[3] K. Schmeh, Kryptografie: verfahren, protokolle, infrastrukturen. dpunkt. verlag, 2016.
[4] G. Mullen and C. Mummert, Finite Fields and Applications, ser. Student mathematical
library. American Mathematical Soc. [Online]. Available: https://books.google.com.np/
books?id=yDgWctqWL4wC
[5] W. M. Al Etaiwi, “Encryption algorithm using graph theory,” Journal of Scientific Re-
search & Reports, vol. 3, no. 19, pp. 2519–2527, 2014.
[6] V. Ustimenko, “On graph-based cryptography and symbolic computations,” Serdica Jour-
nal of Computing, vol. 1, no. 2, pp. 131–156, 2007.
[7] A. Paszkiewicz, A. Górska, K. Górski, Z. Kotulski, K. Kulesza, and J. Szczepański, “Pro-
posals of graph based ciphers, theory and implementations,” in Proceedings of the Re-
gional Conference on Military Communication and Information Systems. CIS Solutions
for an Enlarged NATO, RCMIS, 2001.
[8] S. Lu, D. Manchala, and R. Ostrovsky, “Visual cryptography on graphs,” in International
Computing and Combinatorics Conference. Springer, 2008, pp. 225–234.
[9] H. Delfs and H. Knebl, Introduction to Cryptography: Principles and Applications,
ser. Information Security and Cryptography. Springer, 2007. [Online]. Available:
https://books.google.com.np/books?id=Nnvhz_VqAS4C
[10] A. S. Yamuna M, Meenal Gogia and M. J. H. Khan, “Encryption using graph theory and
linear algebra,” 2012.

18

Você também pode gostar