0% found this document useful (0 votes)
105 views

Circular Queue in Encryption and Decryption

Uploaded by

DEVASHIS GUPTA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Circular Queue in Encryption and Decryption

Uploaded by

DEVASHIS GUPTA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/322977495

A Data Structure Encryption Algorithm based on Circular Queue to Enhance


Data Security

Conference Paper · February 2018


DOI: 10.1109/ISCES.2018.8340522

CITATIONS READS

10 1,529

3 authors:

Ali Alburghaif Abbood Jassim


University of Diyala University of Baghdad
13 PUBLICATIONS   23 CITATIONS    5 PUBLICATIONS   13 CITATIONS   

SEE PROFILE SEE PROFILE

Ali J. Abboud
University of Diyala
19 PUBLICATIONS   107 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Quality aware adaptive biometric systems View project

Benefits and damage to tilapia View project

All content following this page was uploaded by Ali J. Abboud on 18 June 2018.

The user has requested enhancement of the downloaded file.


st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)

A Data Structure Encryption Algorithm based on


Circular Queue to Enhance Data Security

Ali N. Albu-Rghaif Abbood Kirebut Jassim Ali J. Abboud


Department of Computer Engineering, Department of Computer Science, Department of Computer Engineering,
College of Engineering, University of College of Science for women, College of Engineering, University of
Diyala,Iraq University of Baghdad, Iraq Diyala, Iraq
[email protected] [email protected]
[email protected]

Abstract— Data security is an ongoing challenge for networks. It allows people to communicate or transfer data
developers and hackers. To combat different attacks by hackers, electronically without worries of deception. In addition, ensure
there is a necessity for more reliable security technologies. In this the integrity of the message and authenticity of the sender [4].
research, a low complexity circular queue data structure security Furthermore, this paper presents data security algorithm which
algorithm is developed. Employing multiple complicating
is based on the circular queue data structure and multiple
variable factors is the strength of this algorithm and makes
recovery of original message by attackers more difficult. These challenging factors. It can be applied to several applications
tuneable factors are the size of the circular queue, the beginning including communication networks, messaging services,
of the chosen keyword letter and the multiple representations of a mobile applications. The rest of this paper is organized as
number in the Fibonacci format. All letters should be converted follows. Section II summarizes encryption and decryption
into ASCII binary format in order to be used by security algorithms. Section III shows the structure of our proposed
algorithm in the logical and shift operations. The results show model of using circular queue to enhance information security.
that our proposed security algorithm has 50% low complexity Section IV presents the experimental results and analysis.
than compared multiple circular queues algorithm (MCQA). In Section V is used to explain conclusions and future work.
addition, the Fibonacci format and variable number of
challenging factors in this algorithm provide flexibility in
changing the security of the algorithm according to the
II. RELATED WORK
circumstances.
Circular queue is a data structure can be employed in the
Keywords— Data Security, Circular Queue, Fibonacci format information security to make ciphered message more difficult
and complicating factors. to decipher. For instance, the authors of paper [5] developed
an algorithm that uses the shifting and replacing operations of
I. INTRODUCTION bi-column-bi-row for circular queue to increase security. A
Data security is one of ultimate crucial topics in the random number was used in this algorithm to control the
networked community. The importance of this subject belongs shifting between the row and column, eventually this lead to
to several modern issues including different kinds attacks in increase the complexity of plaintext decryption. In the same
cyber networking environment, breaching the privacy of users vein, an elliptic curve algorithm was designed based on matrix
and increasing usage of internet for electronic transactions [1]. scrambling using circular queue [6]. In this research also
The main tools of data security are cryptography, utilizes shifting process to accomplish the encryption and the
steganography, watermarking and data integrity algorithms. decryption of the text. In addition, a multiple circular arrays
Firstly, cryptography algorithms are classified into symmetric algorithm was developed to encrypt data using three circular
and asymmetric. The symmetric algorithms use single arrays. This algorithm enabled the shifting (elements in the
common key for both sender and receiver while asymmetric outer or inner array), swapping (elements among the circular
algorithms use two keys for each user. Public key arrays) and XORing (for encrypting the text) based on
cryptography is an example of asymmetric algorithms that generating random number [7]. In contrast, a double
involve use public and private keys. Secondly, steganography encryption double decryption technique is proposed, which
is another valuable tool to hide information inside a cover means the transmitter encrypts the text two times that leads the
carrier to protect information. Thirdly, watermarking is the receiver decrypt the cipher text twice using public key [8].
security apparatus to check the authenticity of the information. Also, an elliptic curve algorithm is developed to produce a
Lastly, data integrity algorithms represent the tools that test cipher text [9]. Actually, in this work the text firstly formed
the integrity of the data. They include hash function, message into ASCII code, and then the prime number and random
authentication codes (MAC) and digital signatures [2, 3]. To number are chosen and formed into binary format. Where the
sum up, information security plays a major role in protection “0” representation of the prime number is responsible of
and authenticity of data and applications running in computer shifting the row/column in upward and left respectively. In

978-1-5386-1498-3/ 18/31.00$©2018 IEEE

24
st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)

addition, a multiple access circular queues algorithm is letters are converted to their equivalent 8 bits ASCII code and
proposed with variable length in [10]. In this work; different XORed with each other. After that, the resultants are
numbers of rotations are applied to the circular queues, represented as decimal numbers. Finally, these numbers are
swapping the elements in the same queue and XORing the demonstrated into Fibonacci format to be sent as a cipher text,
elements with generating key number. The authors as depicted in Fig. 2.
recommended that these processes would make a secure
plaintext over the transmission line. On the other hand, Agreed on the 3 factors
Fibonacci sequence is mostly used for image encryption. A
Determine the size of circular queue
text to image encryption algorithm is designed using Select the beginning of a keyword letter
Fibonacci sequence [11]. This algorithm firstly converts the Choose the Fibonacci representation
plaintext using Fibonacci sequence, and then the Unicode is
converted to hexadecimal number and a RGB matrix. Finally,
a shuffling operation is made to obtain the image to be sent.
Distributing the plain text in the circular
III. PROPOSED ALGORITHM queue
In this section, the proposed algorithm is illustrated m = no. of letters
thoroughly. It is based mainly on employing a circular queue c = 1 (counter)
data structure in encryption and decryption processes. At the
beginning, a circular queue that used in our proposed
algorithm is shown in Fig 1. The "n" in this figure refers to the
size of the circular queue and the plaintext is shown inside the Convert the plaintext’s letter to the
circular queue. The letters in the core of the circle represents ASCII code
the keyword letters to be shifted to the right and left and then
XORed with plaintext to obtain ciphertext.

Reading the letter


c = c +1

XORing the plaintext’s letters with the


keyword’s letters

Representing the results (Encryption


Letter) as Decimal No.

Converting the Decimal No. to


Fig. 1 Circular Queue for Encryption and Decryption Process Fibonacci format

Using circular queue in this research provides several


factors that make the encryption/decryption process more
difficult for eavesdroppers to decrypt the ciphertext. Yes
Moreover, these factors are agreed upon by both sender and c<m
receiver before the encryption process. These factors can be
summarized as follows:
No
 The size of the circular queue is variable.
 The beginning of the keyword letter is variable.
 The representation number in the Fibonacci format. Sending Fibonacci No. as
Binary numbers
A. Encryption Process
The encryption process begins by distributing plaintext
Fig. 2 Encryption Process
letters in the circular queue. Then these letters and keyword

25
st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)

Fig. 3 shows the distribution of the plaintext in the circular Step 2: XORing the plaintext letters with keyword letters.
queue. The encryption process in this data structure starts with
XORing the plaintext letters with the keyword letters that Plain letter A 0 1 0 0 0 0 0 1
started with letter” E”. keyword letter E 0 1 0 0 0 1 0 1
Encrypted letter 0 0 0 0 0 1 0 0

L 0 1 0 0 1 1 0 0
F 0 1 0 0 0 1 1 0
Encrypted letter 0 0 0 0 1 0 1 0

I 0 1 0 0 1 0 0 1
G 0 1 0 0 0 1 1 1
Encrypted letter 0 0 0 0 1 1 1 0

@ 0 1 0 0 0 0 0 0
H 0 1 0 0 1 0 0 0
Encrypted letter 0 0 0 0 1 0 0 0

A 0 1 0 0 0 0 0 1
I 0 1 0 0 1 0 0 1
Encrypted letter 0 0 0 0 1 0 0 0
Fig. 3 Circular Queue Example
B 0 1 0 0 0 0 1 0
Given example below illustrates the encryption process in a J 0 1 0 0 1 0 1 0
number of steps. Let take the first name of the authors as a Encrypted letter 0 0 0 0 1 0 0 0
plaintext “ALI@ABBOOD”. As shown in Fig. 2 earlier, the
sender and receiver should agree on three factors. The values B 0 1 0 0 0 0 1 0
of these factors in this example as follows: K 0 1 0 0 1 0 1 1
factor1: the size of circular queue is 26 as shown in Fig. 3. Encrypted letter 0 0 0 0 1 0 0 1

factor2: the keyword letter started with letter “E” as shown in O 0 1 0 0 1 1 1 1


Fig.3. L 0 1 0 0 1 1 0 0
Encrypted letter 0 0 0 0 0 0 1 1
factor3: the representation of the Fibonacci number is the 1st
representation as shown in Table I. Also, this table shows the
O 0 1 0 0 1 1 1 1
first ten element of Fibonacci number in two representations to
M 0 1 0 0 1 1 0 1
demonstrate that a number can have several representations.
Encrypted letter 0 0 0 0 0 0 1 0
1st representation of number 5 is: 1 0 0 0 0
2nd representation of number 5 is: 1 1 0 0 D 0 1 0 0 0 1 0 0
N 0 1 0 0 1 1 1 0
TABLE I. FIBONACCI SEQUENCE Encrypted letter 0 0 0 0 1 0 1 0
F1 F2 F3 F4 F5 F6 F7 F8 F9 F10
Step 3: Represent the encrypted outputs as decimal numbers.
1 1 2 3 5 8 13 21 34 55
Encrypted letter Decimal Number
The steps of an example are: 0 0 0 0 0 1 0 0 4
Step 1: convert the plaintext and keyword letters into the 0 0 0 0 1 0 1 0 10
ASCII code as shown below in Table II for plaintext letters.
0 0 0 0 1 1 1 0 14
TABLE II. REPRESENTATION THE PLAINTEXT IN ASCII CODE 0 0 0 0 1 0 0 0 8
Letters ASCII code 0 0 0 0 1 0 0 0 8
A 0 1 0 0 0 0 0 1
L 0 1 0 0 1 1 0 0 0 0 0 0 1 0 0 0 8
I 0 1 0 0 1 0 0 1
@ 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 9
A 0 1 0 0 0 0 0 1
B 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 3
B 0 1 0 0 0 0 1 0
O 0 1 0 0 1 1 1 1 0 0 0 0 0 0 1 0 2
O 0 1 0 0 1 1 1 1
D 0 1 0 0 0 1 0 0
0 0 0 0 1 0 1 0 10

26
st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)

Step 4: This step is concerned with converting the decimal


Distributing the plain text in the circular
numbers into Fibonacci format to be sent as binary numbers. queue
m = no. of letters
Decimal number Fibonacci format c = 1 (counter)
21 13 8 5 3 2 1 1
4 0 0 0 0 1 0 0 1
10 0 0 1 0 0 1 0 0
Reading the letter
c = c +1
14 0 1 0 0 0 0 0 1
8 0 0 1 0 0 0 0 0
8 0 0 1 0 0 0 0 0 Converting the Fibonacci No. to Decimal
No.
8 0 0 1 0 0 0 0 0
9 0 0 1 0 0 0 0 1
Representing the Decimal No. as Binary
3 0 0 0 0 1 0 0 0 No.

2 0 0 0 0 0 1 0 0
10 0 0 1 0 0 1 0 0
XORing the Binary No with the
Step 5: The final step is to send the Fibonacci numbers as keyword’s letters
binary numbers that are represented in decimal as shown
below.
Fibonacci numbers Decimal
Convert the output (ASCII code) to
(AS) Number decrypted letter
binary numbers
0 0 0 0 1 0 0 1 9
0 0 1 0 0 1 0 0 36 Yes
c<m
0 1 0 0 0 0 0 1 65
No
0 0 1 0 0 0 0 0 32
0 0 1 0 0 0 0 0 32 Extracting the original
plain text
0 0 1 0 0 0 0 0 32
Fig. 4 Decryption Process
0 0 1 0 0 0 0 1 33
0 0 0 0 1 0 0 0 8 Decimal
Fibonacci numbers
Number
0 0 0 0 0 1 0 0 4 21 13 8 5 3 2 1 1
0 0 1 0 0 1 0 0 36 0 0 0 0 1 0 0 1 4
B. Decryption Process 0 0 1 0 0 1 0 0 10
The decryption process is the reverse operation of 0 1 0 0 0 0 0 1 14
encryption to recover the original message. After receiving the
ciphertext in Fibonacci format, it converted back to the 0 0 1 0 0 0 0 0 8
decimal number as shown in Fig. 4. Then, these numbers are 0 0 1 0 0 0 0 0 8
XORed with keyword letter according to their locations.
Eventually, the original message is restored. The key point in 0 0 1 0 0 0 0 0 8
this process is to perform the conversion process of the 0 0 1 0 0 0 0 1 9
Fibonacci number carefully. To demonstrate the decryption
process, we have used encryption letters of preceding 0 0 0 0 1 0 0 0 3
example. The steps of an example are: 0 0 0 0 0 1 0 0 2
Step 1: convert the received encrypted message (Fibonacci
number) to decimal number. 0 0 1 0 0 1 0 0 10

27
st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)

Step 2: convert the decimal number to binary format. Step 4: convert the XORing output which represent the ASCII
code of the plaintext letters to original message as illustrated in
Decimal number Binary format Table III.
4 0 0 0 0 0 1 0 0
TABLE III. REPRESENTATION OF THE ASCII CODE OUTPUT INTO LETTERS
10 0 0 0 0 1 0 1 0
XORing Output (ASCII code) Letter
14 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 A
0 1 0 0 1 1 0 0 L
8 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 I
0 1 0 0 0 0 0 0 @
8 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 A
0 1 0 0 0 0 1 0 B
8 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 B
0 1 0 0 1 1 1 1 O
9 0 0 0 0 1 0 0 1 0 1 0 0 1 1 1 1 O
0 1 0 0 0 1 0 0 D
3 0 0 0 0 0 0 1 1
2 0 0 0 0 0 0 1 0
10 0 0 0 0 1 0 1 0
IV. SECURITY ANALYSIS
In order to analysis the security performance of our
Step 3: XORing the binary numbers with the keyword letters. encryption/decryption algorithm, let assume eavesdroppers
Binary No. 4 0 0 0 0 0 1 0 0 have the ciphertext as illustrated in the example. They try to
keyword letter E 0 1 0 0 0 1 0 1 decrypt the message by converting these binary digits to the
Decryption letter 0 1 0 0 0 0 0 1 ASCII code. Hence, the cracked result as follows:
10 0 0 0 0 1 0 1 0
F 0 1 0 0 0 1 1 0
Original ASCII
Decryption letter 0 1 0 0 1 1 0 0 Output Message
Letters Code
14 0 0 0 0 1 1 1 0
A 0 0 0 0 1 0 0 1 HT
G 0 1 0 0 0 1 1 1
Decryption letter 0 1 0 0 1 0 0 1 L 0 0 1 0 0 1 0 0 $
8 0 0 0 0 1 0 0 0 I 0 1 0 0 0 0 0 1 A
H 0 1 0 0 1 0 0 0
Decryption letter 0 1 0 0 0 0 0 0 @ 0 0 1 0 0 0 0 0 Space
8 0 0 0 0 1 0 0 0 A 0 0 1 0 0 0 0 0 Space
I 0 1 0 0 1 0 0 1
Decryption letter 0 1 0 0 0 0 0 1 B 0 0 1 0 0 0 0 0 Space
8 0 0 0 0 1 0 0 0 B 0 0 1 0 0 0 0 1 !
J 0 1 0 0 1 0 1 0
Decryption letter 0 1 0 0 0 0 1 0 O 0 0 0 0 1 0 0 0 BS

9 0 0 0 0 1 0 0 1 O 0 0 0 0 0 1 0 0 EOT
K 0 1 0 0 1 0 1 1 D 0 0 1 0 0 1 0 0 $
Decryption letter 0 1 0 0 0 0 1 0
3 0 0 0 0 0 0 1 1 The recovered message by eavesdroppers is totally different
L 0 1 0 0 1 1 0 0 from original message and such result proves difficulty of
Decryption letter 0 1 0 0 1 1 1 1 some kinds of attacks such as statistical and linear. Such
2 0 0 0 0 0 0 1 0 achievement of difficulty is attributed to the challenging
M 0 1 0 0 1 1 0 1 factors of variable queue size, variable key size and different
Decryption letter 0 1 0 0 1 1 1 1 Fibonacci format representations. Consequently, our proposed
algorithm is satisfying required confidentially by employing
10 0 0 0 0 1 0 1 0
variable size factors. Moreover, Fibonacci format adds more
N 0 1 0 0 1 1 1 0
Decryption letter 0 1 0 0 0 1 0 0 complexity to the decryption process. Furthermore, Table IV
demonstrates another example of our encryption algorithm,
where the symbol “…” is an extended of the ASCII code and
has no description.

28
st rd
2018 1 International Scientific Conference of Engineering Sciences - 3 Scientific Conference of Engineering Science (ISCES)
TABLE IV. OUR ALGORITHM’S EXAMPLE V. CONCLUSIONS AND FUTURE WORK
Plain-text
Beginning of
Cipher-text
In this research a new data structure based security
Keyword Letter algorithm is proposed. The significance of this algorithm is
$ DC1 Space ! ! HT SOH … using circular queue and Fibonacci sequence to be sent as a
HELLOCIPHER B
EOT $ i cipher text. The decryption process is challenging due to the
DC4 … ¤ … … DC1 @ … @ usage of variable factors. In addition, our algorithm offers
CRYPTOGRAPHY D
… DC1 …
flexible size tunable mechanism. The most important issue is
the agreement between sender and receiver to change circular
However, there is exceptional difficult case if we have the queue size, keyword letter/symbol and the representation of
symbol “>” to be encrypted. When this symbol is XORed with the Fibonacci number before establishment of connection.
keyword letter “A”, the length of encrypted letter will be Furthermore, our algorithm is faster than MACQ algorithm
sixteen bits instead of eight bits. This issue is solved by adding due to low complexity of the encryption/decryption processes.
eight bits (one byte) at the end of most significant bit as We have to mention that proposed algorithm is used for text
illustrated below. messages. However, we will plan to encrypt other types of
> 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 data such images, voice and video using this algorithm.
A 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1
output 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
The decimal representation of the XORing output is the
number 127. Then the Fibonacci format of resultant decimal REFERENCES
number is shown below, and these two bytes represent “ENQ”
and “I” respectively.
0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 [1] Kahate, Atul., "Cryptography and Network Security", Tata
McGraw-Hill Education, 2013.
[2] Ali J. Abboud, "Multifactor Authentication For Software
It is worthwhile to mention the comparison of complexity Protection", Diyala Journal of Engineering Sciences, Vol. 08,
of our algorithm with other algorithm such as multiple access No. 04, Special Issue, 2015.
circular queues “MACQ” [10]. As shown in the Table V the [3] Ali J. Abboud ,"Protecting Documents Using Visual
breakdown complexity of our algorithm. Cryptography", International Journal of Engineering Research
and General Science ,2015.
TABLE V. BREAKDOWN COMPLEXITY
[4] E. Barker, W. Barker, W. Burr, W. Polk and M. Smid,
Our Algorithm Complexity MACQ Algorithm Complexity "Recommendation for Key Management-Part 1: General
(Revision 3)", Computer Security Division (Information
Converting the
O log(n) Technology Laboratory), 2016.
Converting the plaintext to 8 bite
O log(n) [5] Wu, Suli, Yang Zhang, and Xu Jing. "A Novel Encryption
plaintext to 8 bite XORing with
O(n2) Algorithm based on Shifting and Exchanging Rule of bi-column
generating key
bi-row Circular Queue", IEEE International Conference on
XORing the key Computer Science and Software Engineering, Vol. 3. , 2008.
with innermost O(n2)
queue [6] Amounas, Fatima., "An Elliptic Curve Cryptography based on
XORing with
O(n2) Matrix Scrambling Method", IEEE International Conference on
keyword letters XORing the key Network Security and Systems (JNS2), 2012.
with second O(n2)
innermost queue [7] S. S. D. Pushpa R. Suri, "A Cipher based on Multiple Circular
Arrays", International Journal of Computer Science Issues
XORing the circular
queues with O(n2) (IJCSI ), Vol. 10, No. 5, pp. 165-175, 2013.
Converting the output innermost queue [8] Merkle, Ralph C., and Martin E. Hellman. "On the Security of
O log(n)
to decimal number Multiple Encryption", Communications of the ACM, Vol. 24,
Converting to
O log(n) No.7, 465-467, 1981.
Hexadecimal
Converting the Applying right shift O (1)
[9] Hankerson, Darrel, Alfred J. Menezes, and Scott
decimal number to O log(n) Vanstone," Guide to Elliptic Curve Cryptography", Springer
Fibonacci Swap operation O nlog(n) Science and Business Media, 2015.
[10] S. Phull and S. Som, "Symmetric Cryptography using Multiple
Access Circular Queues (MACQ)", Proceedings of the Second
International Conference on Information and Communication
Where “n” refers to number of bits, whereby the complexity Technology for Competitive Strategies, 2016.
of our algorithm is much less than the MACQ algorithm by [11] P. Agarwal, N. Agarwal and R. Saxena, "Data Encryption
around 50%. Such result achieved using less number of Through Fibonacci Sequence and Unicode Characters”, MIT
operations in our algorithm. International Journal of Computer Science and Information
Technology, Vol. 5, No. 2, pp. 79-82, August 2015.

29

View publication stats

You might also like