You are on page 1of 8

International Research Journal of Computer Science (IRJCS)

Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

ARABIC Cryptography Technique Using Neural Network and


Genetic Algorithm
Shaza D. Rihan

Dr.Saif Eldin F.Osma

Omdurman Islamic University


Research and Islamic world studies center
Khartoum, Sudan

Emirates College for Science and Technology


Computer science Department
Khartoum, Sudan

Abstract- Cryptography is the science of Encrypting/Decrypting information. The goals of cryptography is to keep
message confidentiality, message integrity and sender authentication. The techniques used to encrypt information in
Arabic language are few and old. The neural net application represents a way of good cryptography technique in English
language. This proposed study introduces cryptography technique for Arabic language using neural network. An
experiment will be conducted to evaluate the proposed technique.
Key words: Encryption, Decryption, Neural network, a genetic algorithm
I. INTRODUCTION:
As stated in [16, 17] information security is the collection of technologies, standards, policies and management practices that
are applied to information to keep it secure. There are many methods to secure information the most important is the
cryptographic methods which enhance the security of digital contents and have gained high significance in the current era
[22]. Cryptography has a long and fascinating history since its initial and limited use by the Egyptians some 4000 years ago
[2]. Cryptography algorithms become much more important in data transmission through unsecured channel [18]. The
cryptography is done by encryption which is the transformation of data into some unreadable form and decryption which is
the reverse of encryption; it is the transformation of encrypted data back into some intelligible form [13]. Arabic language is
the one of widely spoken language in the world [15]. It belongs to the Semitic languages branching family of the AsianAfrican languages Group [4]. Of all the spheres of knowledge in the Arab heritage, cryptography has received the least
attention from historians and researchers [14]. David Kahn stated that the cryptography was porn among the Arab [10].
Cryptography is used to achieve Authentication, Privacy/confidentiality, Integrity and Non-repudiation [3]. There are, in
general, three types of cryptographic schemes: secret key (or symmetric) cryptography, public-key (or asymmetric)
cryptography, and hash functions. Researchers in this field present many cryptography techniques depend on the three types
of cryptography using different computer science techniques. There is a lack of using neural network in Arabic cryptography.
This proposed study presents an Arabic cryptography algorithm using neural network.
Artificial neural networks (ANN) are simplified models of the central nervous system. They are networks of highly
interconnected neural computing elements that have ability to respond to input stimuli. Researchers in cryptography field
present many cryptography techniques the following section discusses the some of these works.
II. GENETIC ALGORITHMS:
Genetic algorithms1 (GAs) are a subclass of evolutionary algorithms where the elements of the search space G are binary
strings (G = B) or arrays of other elementary types. As sketched in Figure 3.1, the genotypes are used in the reproduction
operations whereas the values of the objective functions f F are computed on basis of the phenotypes in the problem space
X which are obtained via the genotype-phenotype mapping gpm. [5], [8], [9]
Genetic Algorithm is applicable in many ways:
State Assignment Problem
Economics
Scheduling
Computer-Aided Design
III. NEURAL NETWORK
Artificial neural networks have motivated from their inception by the recognition that the brain computes in an entirely
different way from the conventional digital computer. The brain contains billions of neurons with massive interconnections.
Similarly, neural networks are massively parallel distributed processors that are made up of artificial neurons with
interconnections. These are nonlinear dynamic machines which expand the expression of input data as a linear combination
of inputs to synapses and then perform a nonlinear transformation to compute output [21]. Here are several strategies for
learning: [6]
_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -35

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

1- Supervised Learning: Essentially, a strategy that involves a teacher that is smarter than the network itself.
2- Unsupervised Learning: Required when there isnt an example data set with known answers.
Reinforcement Learning: A strategy built on observation. This research, Depends ON the first type
HEBBIAN NETWORK:
Discovered by Donald Hebb in 1949. The purpose of it is to modulation the weight matrix that correlation between nodes.
Hebb introduced first base for training the neural network ( Hebbian learning Rule ) Which Adopted as basic rule for the
development of encryption algorithms [19]. In this research use hebbian network Supervised. Where give code for each
character. Network one features of this network IS Does not contain the Activation Function. When weight is modulation.
Another feature of Hebbian learning for development is its automatic, self-organizing nature. This kind of learning can
proceed simply in response to an array of inputs from the environment, without any consideration of what outputs should be
produced in response to those inputs.[7]
NETWORK ARCHITECTURE:
Figure (1) shows the general network structure, which consists of a single layer explain the inputs and outputs

Figure(1) Hebbian Network architecture


To take the output of this neural network we apply the following
Equation: iWij Yj
Yj =

XiWij (1)

To modify the weights matrix we apply the following Equation


Wij(new) = Wij(old) + CXiYj. (2)
Where:
Xi: input value i
Yj: input value i
Wij : weight matrix ij
C: Education rate ranging between (0<C1)
The weight matrix is calculated using a genetic algorithm Instead of modifying the matrix equation weight to take the output
required values.
GENETIC NEURAL NETWORK:
The genetic algorithm used in this research deals with the neural network weights Hebbian nerve to reach better results.
Where traditional network training Hortamlah using the following characteristics:
1. Neural network consists of 12 knots in the input layer, and (20) a node in the output layer and there are no hidden layers,
So we will have a matrix weights consisting of (144) weight - and that will be used chromosomes - were trained matrix
weights this through the properties of mutations, crossover and selection. In order to get a correct matrix weights In order to
get the matrix leads to Fitness Function. Fitness Function used in this research are referred to the equation (3)
FitnessFunction = @(x)curvefit(x,d)................. (3)
IV. RELATED WORKS:
Adnan Abdul-Aziz Gutub, etl. [1] Exploits the existence of the redundant Arabic extension character, i.e. Kashida. They
proposed the pointed letters in Arabic text with a Kashida to hold the secret bit one un-pointed letters with a Kashida to hold
zero. Their method can be classified under secrecy feature coding methods where it hides secret information bits within the
letters benefiting from their inherited point.
_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -36

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

Prakash Kuppuswamy, Saeed Q Y Al-Khalidi [20] proposed new symmetric key algorithm using modular 37 and select any
number and calculate inverse of the selected integer using modular 37. The symmetric key distribution should be done in the
secured manner. Prakash Kuppuswamy, Yahya Alqahtani [18] proposed a modular 37 symmetric key algorithm in which an
Arabic letters assigning to the integer value and the numerals 0-9 also assigned as an integer number called as synthetic
value. The procedure of encryption and decryption is done by selecting random integer and calculate inverse of the selected
integer with modular 37. The symmetric key distribution should be done in the secured channel for decrypting message.
Khalid Alallayah, etl. In [11] introduced a Neuro-Identifier as a block box model simplified DES crypto systems. The goals
of their model are to emulate construction the target cipher system and determine the key from given plaintext-cipher text
pair. Mohammed Abdullah, etl. [12] Proposed and encryption algorithm based on simple multiplication and logarithm
function with Caesar cipher. Their algorithm is adopted the coding of advanced language and is safe enough.
V. ENCRYPTION SYSTEM IN THIS SEARCH
Practical steps are summarized in the following two algorithms:
The first algorithm includes steps of encryption text.
The second algorithm includes steps of decode the text by using Genetic algorithm
After applying encryption and decoding algorithm. Time is calculated for each case:
ENCRYPTION:
1-Read file:
Open file that located at the memory address ID
Read file data and put it into the text file" in.txt"
id = fopen('in.txt','r');
in=fscanf(id,'%s%[^\n]');
2-Extract the characters
Convert the data file to a decimal value (ASCII CODE)
Convert data file from a decimal value to a binary value of length 12 -bit and put it in variable cb.
c=double (in);
cb=de2bi(c,12);
3-Generate random integer numbers are not duplicated between 1 and 9 value of length 12 bit for each character (the
encrypted message)
r = randi([1 9],m,12);
[n,m]=size(c);
m=number of rows
n=number of charters with spaces
From this step we get code for any char (length 12 bit)
4-Train NN with Genetic algorithm
Put the result in beam in one line w = [];
Create loop of the number of text characters with spaces
for i=1:m
w= [w train_nnga(cb(i,:),r(i,:))];
End
We get from this step beam in one line" w" contains the keys show blow:

_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -37

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

5- Writing letters:
Open text file "w.txt"
id = fopen('w.txt','wt');
Print char i , its ASCII code and its encryption like this:

6- Write decryption message (The same way the previous step)


7-Decryption
Convert the file data from the binary value to an absolute decimal value
Multiply the inverted matrix (w) with r Transported matrix (r ) to get outc ( Characters matrix after decoding )
outc=[ ];
for i=1:m
outc=[outc bi2de(min(abs(round(inv(w(:,1+12*(i-1):i*12))*r (i,:)')), ones (12,1))')];
end
-Write decryption massage (same way in step 5)
Training network steps:
-a genetic algorithm use Fitness Function to calculate the error FitnessFunction=@(x)curvefit(x,d);
The number of variables of genetic algorithm is =12*12=144
x is Weights get from genetic algorithm
x=ga(FitnessFunction,numberOfVariables);
-Reshape x by matrix
w=reshape(x,12,12);
y must equal zero until there is no error
function y = curvefit(x,d)
y = 0;
w=reshape(x,12,12);
y = y+norm(d(:,2)-w*d(:,1));
end

_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -38

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

Finger [5]: Flowchart shows the encryption algorithm

Finger [6]: Flowchart shows the decryption algorithm

_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -39

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

VII. EXPERIMENTAL DESIGN:


The experiment is performed on a laptop core I5 , 2.5 GH. CPU with operating system windows 7. program performance
metrics are collected: encryption and decryption time for any char and total time of encryption and decryption. Program
written in matlab2014. The interface displays the following elements:

Plaintext size
Decrypted text
Text size
Decrypted text size
Time any letter( for encryption and decryption process)
Total time ( for encryption and decryption process)
Current weigh ( for encryption and decryption process)
Current letter( for encryption and decryption process)
Current code ( for encryption and decryption process)
Encryption char time( for encryption and decryption process)

Figure [1], Figure [2] Figure [3] and Figure [4] shows the value of each element during and after the encryption and
decryption.

Figure [1]: show encryption time and current weight of current letter

Figure [2]: show encryption text and total encryption time


_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -40

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)

ISSN: 2393-9842
www.irjcs.com

Figure [3]: show decryption time and current weight of current letter

Figure [4]: show decryption text and total decryption time


THE TIME TAKES FOR THE ENCRYPTION AND DECRYPTION:
Time encryption calculated for any char is was (2900 ms) and time decryption for any char is (0.33 ms).It is noted that
encryption time greater than the decoding time, because the network training and calculating weights is in the encryption
stage while the decryption stage depends on applying of equation.
TABLE 1 SHOWS THE TIME OF IMPLEMENTATION OF DIFFERENT FILES SIZES.
SIZE OF TEXT
(BYTE)
48
102
242
504

SIZE OF
DECRYPTION TEXT
288
612
1452
3024

ENCRYPTION
TIME(SEC)
95
189.93
521.63
916

DECRYPTION
TIME(SEC)

TOTAL TIME FOR


ENCRYPTION AND DECRYPTION

0.01783
0.012695
0.0309
0.118

95.18
189.94
521.66
916.11

Table (1) : the time of implementation of the encryption and decryption processes

1.
2.
3.

VIII. RESULTS
Design Genetic neural network in order to encrypt texts, by training neural network weights using a genetic
algorithm.
A neural network use in this research is consisted of 12 notes in input represent ascii code of char , and 12 notes in
output are represent random numbers
Neural network using genetic algorithm , considered a matrix weights as chromosome of genetic algorithm to get
the best results

_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -41

International Research Journal of Computer Science (IRJCS)


Issue 05, Volume 3 (May 2016)
4.
5.

6.

ISSN: 2393-9842
www.irjcs.com

Encryption process by using genetic neural network includes high secret because of genetic algorithm accuracy.
Weights that get from genetic neural network training process be shared by the sender and the recipient. Where use
matrix weights in the encryption char ascii code process. recovery char's ascii code for Arabic letters .and use
inverse matrix weights in the decryption process recovery char's ascii code
Genetic neural network in this research has been successful in the processes of encryption and decryption 100%
REFERENCES

[1]. Adnan Abdul-Aziz Gutub, LahouariGhouti, Alaaeldin A. Amin, Talal M. Alkharobi , Mohammad K. Ibrahim,
"Utilizing Extension Character Kashida With Pointed Letters For Arabic Text Digital Watermarking", proceeding of:
Computer Systems and Applications, 2009. AICCSA. IEEE/ACS International Conference, 2009
[2]. Alfred J. Menezes, Paul C. van Oorschot, Scott A. Vanstone, "HANDBOOK of APPLIED CRYPTOGRAPHY", CRC
Press, ISBN: 0-8493-8523-7, October 1996.
[3]. Ayushi, A Symmetric Key Cryptographic Algorithm, International Journal of Computer Applications (0975 - 8887),
Volume 1 No. 15, 2010.
[4]. Bomhard, Allan R. "Toward Proto-Nostratic: A new approach to the comparison of Proto-Indo-European and ProtoAfroasiatic". Amsterdam: John Benjamins 1984, Publishing Company.
[5]. David E. Goldberg and Kalyanmoy Deb. A comparative analysis of selection schemes used in genetic algorithms. In
Proceedings of the First Workshop on Foundations of Genetic Algorithms FOGA
[6] Daniel Shiffman - he Nature of Code-2012-edition 1 .[6]
[7] Hebbian learning and development Yuko Munakata,Jason Pfaffly Issue on line :12march2004 .[7]
[8]. Jorg Heitkotter and David Beasley, editors. Hitch-Hikers Guide to Evolutionary Computation: A List of Frequently
Asked Questions (FAQ). ENCORE (The Evolutionary Computation Repository Network), 1998.
[9]. John Henry Holland. Adaptation in Natural and Articial Systems: An Introductory Analysis with Applications to
Biology, Control, and Articial Intelligence. The University of Michigan Press, Ann Arbor, 1975
[10]. Kahn David " The Code Breaker: The Story of Secret Writing", New York, Macmillan, 1967.
[11]. Khalid Alallayah, Mohamed Amin, Waiel AbdElwahed, Alaa Alhamami," Applying Neural Networks for Simplified
Data Encryption Standard (SDES) Cipher System Cryptanalysis", The International Arab Journal of Information
Technology, Vol 9, No, 2, March 2012.
[12]. Mohammed Abdullah, Mohammed Aysan, Prakash Kuppuswamy, "Hybrid Combination of Message Encryption
Techniques on Text: Using New Symmetric Key and Simple Logarithm Function", International Journal of Scientific
Research and Management Studies (IJSRMS) ISSN: 2349-3771 Volume 1 Issue 6, pg: 192-199.
[13]. Maram Balajee, "UNICODE and Colors Integration tool for Encryption and Decryption", International Journal on
Computer Science and Engineering, Vol. 3 No. 3 Mar 2011.
[14]. MOHAMMED MRAYATI, YAHYA MEER ALAM., M. HASSAN at-TAYYAN, "The Arabic Origins of Cryptology,
published by KFCRIS & KACST, 1992.
[15]. Mohammed Naji AL-Kabi, Ronza S. Al- Mustafa, "Arabic Root Based Stemmer, The 2006 International Arab
Conference on Information Technology (ACIT'2006)
[16]. Nadeem, A, Javed, M.Y, A Performance Comparison of Data Encryption Algorithms," IEEE Information and
Communication Technologies, ICICT 2005, First International Conference, P.P. 84- 89, 2005.
[17]. Obulam Suguna Mani, U.Nanaji, Y.Swapna, A New Method in Symmetric Encryption for block cpher module: A Bit
Shifting Approach, IJAIR, ISSN: 2278-7844, 2012.
[18]. Prakash Kuppuswamy, Yahya Alqahtani, "NEW INNOVATION OF ARABIC LANGUAGE ENCRYPTION
TECHNIQUE USING NEW SYMMETRIC KEY ALGORITHM", International Journal of Advances in Engineering &
Technology, Mar. 2014.
[19]. Patterson, Dan W. (1996): Artificial neural networks, theory and application, Prentice Hall.
[20]. Prakash Kuppuswamy, Dr.Saeed Q Y Al-Khalidi, Implementation of Security through simple symmetric key
algorithm based on modulo 37, International Journal of Computers & Technology, ISSN: 2277-3061 Volume 3 No. 2,
OCT, 2012.
[21]. S. Haykin. Neural Networks: a Comprehensive Foundation. 2nd edition, Prentice Hall, 1998
[22]. Yahya
Alqahtani, Prakash Kuppuswamy, Sikandhar Shah, "NEW APPROACH OF ARABIC
ENCRYPTION/DECRYPTION TECHNIQUE USING VIGENERE CIPHER ON MOD 39", International Journal of
Advanced Research in IT and Engineering, Vol. 2 | No. 12 | December 2013.

_____________________________________________________________________________________________________
IRJCS: Impact Factor Value - Scientific Journal High Impact Factor value for 2014= 2.023
2014-16, IRJCS- All Rights Reserved
Page -42

You might also like