M3notes For Cse
M3notes For Cse
net/publication/355084570
Article in International Journal of Advanced Computer Science and Applications · January 2021
DOI: 10.14569/IJACSA.2021.0120982
CITATION READS
1 394
3 authors, including:
All content following this page was uploaded by Soumia Ziti on 25 October 2021.
Abstract—Sharing private data in an unsecured channel is Over the years, cryptography has continued to be improved
extremely critical, as unauthorized entities can intercept it and and has progressively became an indispensable part for pri-
could break its privacy. The design of a cryptosystem that fulfills vate data sharing. All contributions dedicated to this field of
the security requirements in terms of confidentiality, integrity research have aroused great interest. In the literature, cryptog-
and authenticity of transmitted data has therefore become an raphy can be classified into three categories: Symmetric Key
unavoidable imperative. Indeed, a lot of work has been carried
out in this regard. Although many cryptosystems have been
Cryptography, which is an encryption system where both the
proposed in the published literature, it has been found that transmitter and the recipient of the message use one common
their robustness and performance vary relatively from one to key such as DES [2], AES [3], or IDEA [4], to encrypt and
another. Adopting this reflection, we address in this paper the decrypt the messages. The second category is Asymmetric
concept of block cipher, which is a major cryptographic solution Key Cryptography. In this system, a couple of keys(private
to guarantee confidentiality, by involving the properties of graph and public keys) are used in order to encrypt and decrypt
theory to represent the plaintext message. Our proposal is in the messages such as RSA [5], ElGamal [6], Diffie-Hellman
fact a new symmetric encryption block cipher that proceeds [7], etc. The last category is Hybrid key Crypthography,
by representing plaintext messages using disjoint Hamiltonian Which consist of using an encryption mode that utilizes both
circuits and then dealing with them as an adjacency matrix in a symmetric and asymmetric public key encryption. This method
pre-encryption phase. The proposed system relies on a particular
sub-key generator that has been carefully designed to produce
benefits from public key cryptography for key sharing and from
the encryption keys according to the specifications of the system. the speed of symmetric encryption for message encryption.
The obtained experimental results demonstrate that our proposed Nowadays, cryptology is able to handle a substantial set of
cryptosystem is robust against statistical attacks, particularly mathematical tools, that allowed for improvements in terms
the DIEHARD test, and presents both good confusion and good of efficiency and performance. In particular, graph theory is a
diffusion. field that is considered very promising in this regard, since it
provides concepts that could be useful in solving problems in
Keywords—Cryptosystem; graph theory; hamiltonian circuits;
every network related areas.
adjacency matrix; block cipher; encryption
Graph theory in mathematics refers to the study of graphs,
which are a major object of discrete mathematics. Generally,
I. I NTRODUCTION a graph is represented as a set of vertices linked by edges.
Cryptography is a component of cryptology that is based on They are thus mathematical structures used for modelling
a number of methods and principles for converting a readable pair-wise relationships between objects. It can be found in
message to a totally unreadable one. This field is dealing with road networks, electrical circuits, constellations, etc. Graphs
many security problems such as the confidentiality of commu- provide a way of thinking that can be used for modeling a
nications via non-secure channels, the privacy of individuals, vast range of problems. They are the foundation of numerous
the data storing on unsecured mediums, and so on. Cryptogra- computer programs that allow communication and advanced
phy refers to the study and analysis of data encryption systems technological processes. The seven bridges of Konigsberg
intended to reduce the impact of hackers and to prevent, as (1736) [8] is a mathematical problem well known for having
best as possible, any unauthorized attempts to gain access to established the foundations of the theory of graphs. Graph
these confidential data. The main principles of information theory is a relatively new concept that has been successfully
security, notably confidentiality, integrity, authentication, and incorporated and has enabled the development of stronger
non-repudiation [1]. encryption algorithms that have proven to be difficult to break,
even for the latest software solutions. In fact, it consists of
Confidentiality is a crucial part of security. It can be modeling encryption problems by graph representation, so
ensured by an encryption process, whereby the data becomes that they eventually become problems in graph theory where
non-intelligible to any non-authorized parties trying to gain the solutions are usually well-known. Although solutions to
access to it. The idea behind of encryption process is to graph problems can be fairly easy and efficient (with respect
transform a plaintext into a ciphertext, so only authorized to the time required for computational processing which is
parties can obtain the message in its original format by revers- reasonable), they can also be rather difficult (relative to the
ing the encryption process, known as decryption. Technically, processing time increases exponentially). This resulted in the
decryption should be extremely difficult for any unauthorized application of concepts introduced in graph theory to large-
and unqualified parties attempting to perform it. scale cryptography, since many NP-hard problems are derived
www.ijacsa.thesai.org 742 | P a g e
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 9, 2021
n=78
the processing that the plaintext messages are subjected to Plainntext
during their encryption process. Indeed, this is the objective
of the contribution in this paper, which is to improve the
processing of the plaintext by making it more difficult and Block0 Block1 Block2 Block3
more complex than [17], using mainly all the Hamiltonian
circuits that represent the plaintext.
The scheme proposed in [17] used a block of 25-characters
length, which can be represented by 2 disjoint Hamiltonian G0= G2= G3=
G1=
circuits in a graph of order 13, given that a graph of order
13 contains 6 disjoint Hamiltonian circuits (Theorem 1). In
contrast to [17], which used only 2 of the 6 circuits, the M0= M1= M2= M3=
concept put forward in this approach makes use of all the
disjoint Hamiltonian circuits of the graph (6 circuits), which
IM = M’0 = M’1 = M’2= M’3=
allows the representation of blocks with 78-characters length
in a single graph.
C0= M’0K0 C1= M’1K1 C2= M’2K2 C3= M’3K3
k′ = k C0= M’0K0
If the division is exact.
(3)
k′ = k + 1 otherwise.
Cipher text
′ 132
Where k represents the total number of blocks resulting
from the division. Each Blocki is partitioned into 6 sub-blocks Fig. 1. Comparaison between the Encryption Process in [17] and the
of size 13(each sub-block is represented by subBlockij ), Proposed One.
which are then converted into Hamiltonian circuits where the
weights of the edges of the graph Gi are represented by the
ASCII values of the characters that compose them. Finally, the
resulting graph is converted into an adjacency matrix Mi .
in the process allows the generation of a vector Si of size
The main process involving in our proposed system are 13 from N using BBS generator. The fourth and final step
presented in the following: uses the resulting Si to generate the sub-keys Ki as a square
matrix of order 13. The all sub-keys Ki (i = 0,. . ., k’-1) that are
A. Key Generation / Re-Generation Algorithms generated constitute the set SKk′ . This process is illustrated
The generation of the sub-key Ki occurs in four steps. The in F IG . 2.
first involves the random selection of a character Char from
the Blocki . The second step consists in using the position The regeneration of Ki during the decryption process
corresponding to the ASCII value of Char in two ways, to begins with the use of V P to recreate a key Key of size
construct the vector of positions V P that is necessary for the 132 k ′ from KEK. Key is then divided into sub-vectors Si of
decryption, as well as to recover the value N located in the size 13 which are subsequently used to generate the sub-keys
same position in the master key KEK (of size 256), which Ki as square matrices of order 13. This process is described
will be used as the seed of the BBS generator. The third step in F IG . 3.
www.ijacsa.thesai.org 744 | P a g e
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 9, 2021
Ci = Mi′ ⊕ Ki (5)
B. Encryption Process
The encryption process begins with the pre-encryption step Since the first block does not have an antecedent. We gen-
described above. Cipher block chaining (CBC) is used as mode erate an random matrix referring to IM (initialization matrix)
of operation in our approach. The chaining uses a feedback which allows to perform the XOR operation with M0 . Each
method, in the sense that the result of the encryption of the encrypted block consequently depends not only on the corre-
previous block Ci−1 is reused for the purpose of encrypting sponding plaintext block, but also on all the encrypted blocks
the current block Mi . More specifically, an exclusive or (XOR) that precede it. The rows of the matrix Ci are concatenated to
operation is applied between the current block Mi and the form a vector eBlocki of size 132 , representing each encrypted
previous block of ciphertext Ci−1 as shown below: block.
The resulting vectors eBlocki (i = 0,. . ., k’-1) generated
from all blocks are then concatenated to form a single vector
Mi′ = Ci−1 ⊕ Mi (4)
EM of size 132 k ′ . The encryption process, as shown in F IG . 4,
ends with the transmission of the encrypted message EM in
A second XOR operation is then performed between the addition to the vector V P that is related to the decryption
result of operation (3) and the sub-key Ki generated by the process.
www.ijacsa.thesai.org 745 | P a g e
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 9, 2021
C. Decryption Process
with m is the size of the ciphertext.
In general, the process of decryption corresponds to the
The sub-key generation algorithm presented in A LGO -
process of encryption performed in reverse order (A LGO -
RITHM 2 makes use of the provided vector V P to produce
RITHM 4). In the decryption process described in this paper,
a key of size 132 k ′ from the master key KEK. Each block
the ciphertext EM refers to the input of the algorithm. EM
Ci (i = 0,. . ., k’-1) is decrypted using its own sub-key Ki using
is decomposed into k ′ vectors (eBlocki ) and then gathered to
the following formula:
constitute the set eBlockSetk . The eBlocki (i = 0,. . ., k’-1)
are subsequently transformed into a matrix Ci . The number of
blocks k ′ is calculated as follows: Mi = Ci−1 ⊕ Mi′ (7)
V. S ECURITY A NALYSIS AND E XPERIMENTAL R ESULTS probability of half (this is referred to as the strict avalanche
criterion). Accordingly, the used equation (10) is:
The evaluation of the encryption system addressed the
reliability of the suggested algorithm. For this purpose, we bitsdif f = (1 ÷ (132 × 16) × w(C ⊕ C ′ ) (10)
study the system reaction in terms of performance and security = (1 ÷ (2704) × w(C ⊕ C ′ ) (11)
according to fundamental criteria. For which we also perform
different statistical tests. This evaluation is described in the Where w is the hamming weight, C and C ′ are respectively
following sections. the original and modified inputs, and the value 16 refers to the
number of bits representing each element in the cipher.
A. Confusion and Diffusion Tests
B. Plaintext Sensitivity Test
Diffusion and confusion are very important as aspects
of the functioning of a secure encryption which were first The diffusion property is intended to produce an avalanche
identified in 1949 by Claude Elwood Shannon [23]. In his effect [24] between the plaintext and the encrypted messages.
original definitions: The sensitivity test of the bit change in the plaintext is used
Confusion means making the relationship between key and to verify the diffusion property of a particular algorithm.
ciphertext as complicated and as involved as is feasible, Given pairs of plaintext and secret keys, we generate the
whereas in this case refers to the property that redundancy ciphertext corresponding to each pair (plaintext, secret key)
in the plaintext’s statistics is “dissipated” in the ciphertext’s through our cryptosystem, changing one or more bits (Know-
statistics. ing that a change at character level implies a change of bit)
Diffusion is related to the reliance of the output bits upon in the randomly generated plaintext, and by retaining the key
the input bits. In a cipher with proper diffusion, the changing unchanged.
of an input bit is expected to change every output bit with a Subsequently, we calculate the average of the percentage of
www.ijacsa.thesai.org 747 | P a g e
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 9, 2021
compared to AES-128. 50
49.5
52
49
Our Algorithme
51.5 AES-128
48.5
51
48
Average of bits difference percentage
50.5
47.5
50
47
49.5
46.5
0 1 2 3 4 5 6 7 8 9 10 11
49 Number of modified bites respect to the original key
48.5
Fig. 7. Number of Modified Bits with respect to the Original Key.
48
47.5
TABLE I. D IEHARD T EST also investigate other properties of graph theory for a more
discriminating and robust representation of the data.
Test Name P-value Interpretation
R EFERENCES
diehard bitstream 0.59537390
diehard squeeze 0.97442749 [1] A. J. Menezes, J. Katz, P. C. Van Oorschot, and S. A. Vanstone,
diehard sums 0.11133210 Handbook of applied cryptography. CRC press, 1996.
diehard count 1s str 0.60934773 [2] P. FIPS, “81, des modes of operation,” Issued December, vol. 2, p. 63,
diehard count 1s byt 0.78478421 1980.
diehard parking lot 0.55915630 [3] V. Rijmen and J. Daemen, “Advanced encryption standard,” Proceedings
diehard birthdays 0.03222200 of Federal Information Processing Standards Publications, National
Institute of Standards and Technology, pp. 19–22, 2001.
diehard operm5 0.75636037
diehard oqso 0.33566335
[4] W. Meier, “On the security of the idea block cipher,” in Workshop on
the Theory and Application of of Cryptographic Techniques. Springer,
diehard dna 0.45051943
1993, pp. 371–385.
diehard 2dsphere 0.53656799
[5] N. P. Smart, “The “naive” rsa algorithm,” in Cryptography Made Simple.
diehard 3dsphere 0.62980562
Springer, 2016, pp. 295–311.
diehard rank 32x32 0.40775458
[6] ——, “Public key encryption and signature algorithms,” in Cryptogra-
diehard rank 6x8 0.45554634 phy Made Simple. Springer, 2016, pp. 313–347.
diehard opso 0.44037399
[7] A. J. Menezes, J. Katz, P. C. Van Oorschot, and S. A. Vanstone,
diehard runs 0.86351847 PASSED Handbook of applied cryptography. CRC press, 1996.
diehard craps 0.15275419
[8] G. Alexanderson, “About the cover: Euler and königsberg’s bridges: A
rgb bitdist 0.69014502 historical view,” Bulletin of the american mathematical society, vol. 43,
rgb minimum distance 0.57113046 no. 4, pp. 567–573, 2006.
rgb permutations 0.60422228 [9] L. Blum, M. Blum, and M. Shub, “A simple unpredictable pseudo-
rgb lagged sum 0.60927830 random number generator,” SIAM Journal on computing, vol. 15, no. 2,
rgb kstest test 0.26054914 pp. 364–383, 1986.
dab bytedistrib 0.68169231 [10] P. Amudha, A. C. Sagayaraj, and A. S. Sheela, “An application of graph
dab dct 0.25149694 theory in cryptography,” International Journal of Pure and Applied
dab filltree 0.88848873 Mathematics, vol. 119, no. 13, pp. 375–383, 2018.
dab filltree2 0.29185197 [11] S. G. Akl, “The graph is the message: design and analysis of an
dab monobit2 0.74899931 unconventional cryptographic function,” in From Parallel to Emergent
sts monobit 0.68441660
Computing. CRC Press, 2019, pp. 425–442.
sts runs 0.37246909 [12] K. D. Rangaswamy and M. Gurusamy, “Application of graph theory
sts serial 0.50145101
concepts in computer networks and its suitability for the resource
provisioning issues in cloud computing-a review.” J. Comput. Sci.,
marsaglia tsang gcd 0.47467308
vol. 14, no. 2, pp. 163–172, 2018.
[13] D. Sensarma and S. S. Sarma, “Application of graphs in security,” Inter-
national Journal of Innovative Technology and Exploring Engineering,
TABLE II. E NCRYPTION T IME C OMPARISON BETWEEN OUR B LOCK vol. 8, no. 10, pp. 2273–2279, 2019.
C IPHER AND OTHERS B LOCK C IPHERS USING D IFFERENT M ESSAGE S IZE [14] S. H. Hashem, “Proposal hybrid cbc encryption system to protect e-
mail messages,” Iraqi Journal of Science, vol. 60, no. 2, pp. 157–170,
AES 3DES 2019.
Message Size (Kilo Byte) Our encryption algorithm
(ms) (ms) [15] A. Yousif and A. H. Kashmar, “Key generator to encryption images
3 248.07 247.47 4.9 based on chaotic maps,” Iraqi Journal of Science, vol. 60, no. 2, pp.
10 951.2 614.9 10.4 362–370, 2019.
20 1972 1096 21.2 [16] T. A. Khaleel and A. A. Al-Shumam, “A study of graph theory
applications in it security,” Iraqi Journal of Science, vol. 61, no. 10,
pp. 2705–2714, 2020.
[17] K. Bekkaoui, S. Ziti, and F. Omary, “A robust scheme to improving
VI. C ONCLUSION AND F UTURE W ORK security of data using graph theory,” International Journal of Advanced
Computer Science and Applications, vol. 11, no. 5, 2020.
The work presents a new cryptosystem that takes advantage
[18] C. Beaula and P. Venugopal, “Cryptosystem using double vertex graph,”
of the principles of graph theory, which enable a high degree of Indian Journal of Science and Technology, vol. 13, no. 44, pp. 4483–
security while maintaining the performance of data processing. 4489, 2020.
Our proposed encryption block cipher using in particular [19] P. Perera and G. Wijesiri, “Encryption and decryption algorithms in
the disjoint Hamiltonian circuits that have been adopted to symmetric key cryptography using graph theory,” Psychology and
represent the plaintext in a pre-encryption phase. the process Education Journal, vol. 58, no. 1, pp. 3420–3427, 2021.
makes use of a specific sub-key generator that has been set up [20] S. G. Akl, “How to encrypt a graph,” International Journal of Parallel,
to generate the encryption keys according to the requirements Emergent and Distributed Systems, vol. 35, no. 6, pp. 668–681, 2020.
of the proposed system. We have performed different statistical [21] P. Venugopal, “Encryption using double vertex graph and matrices,”
Solid State Technology, vol. 64, no. 2, pp. 2486–2493, 2021.
tests, specifically the DIEHARD, confusion and diffusion tests
[22] N. Deo, Graph theory with applications to engineering and computer
to prove the security and performance of our cryptosystem. The science. Courier Dover Publications, 2017.
experiments results proved the good behaviour of our proposed
[23] C. E. Shannon, “Communication theory of secrecy systems,” The Bell
design in terms of robustness and CPU time compared to 3DES system technical journal, vol. 28, no. 4, pp. 656–715, 1949.
and AES. In a future work, we intend to use another pseudo- [24] J. C. H. Castro, J. M. Sierra, A. Seznec, A. Izquierdo, and A. Ribagorda,
random generator, such as the one proposed in [28] known as “The strict avalanche criterion randomness test,” Mathematics and
PSOCA, which is mainly based on cellular automata, and we Computers in Simulation, vol. 68, no. 1, pp. 1–7, 2005.
www.ijacsa.thesai.org 749 | P a g e
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 12, No. 9, 2021
[25] G. Marsaglia, “Diehard test suite,” Online: http://www. stat. fsu. 2016.
edu/pub/diehard, vol. 8, no. 01, p. 2014, 1998. [28] C. Hanin, F. Omary, B. Boulahiat, and S. Elbernoussi, “Design of
[26] D. Coppersmith, D. B. Johnson, and S. M. Matyas, “A proposed mode new pseudo-random number generator based on non-uniform cellular
for triple-des encryption,” IBM Journal of Research and Development, automata,” International Journal of Security and Its Applications,
vol. 40, no. 2, pp. 253–262, 1996. vol. 10, no. 11, pp. 109–118, 2016.
[27] N. P. Smart and N. P. Smart, Cryptography made simple. Springer,
www.ijacsa.thesai.org 750 | P a g e