You are on page 1of 6

Seventh IEEE/ACIS International Conference on Computer and Information Science

Implementation of a model of Conventional Encryption


using Hardware Description Language
G.M. Bhat1, M. Mustafa2, Shabir Ahmad2 and Javaid Ahmad2
1
University Science Instrumentation Center, University of Kashmir, Srinagar, India
2
Post Graduate Department of Electronics and Instrumentation Technology,
University of Kashmir, Srinagar, India
shabireltrahmad@gmail.com

Abstract: In this work, we present an This implementation is achieved using the


application based on the encryption algorithm hardware description language VHDL and
IDEA. The application is to encrypt the plain Field Programmable Gate Array Technology
text data into a cipher text by using another (FPGA). The approach is particularly
plain text of fixed length. IDEA algorithm appropriate for packet encryption for a
which is a symmetric block cipher was proposed security meta-layer.
introduced and developed by Xueja Lai and
James Massey. The revised version of the In the subsequent four sections, we provide a
algorithm is so designed to be stronger, against summary of the algorithm, and the
differential cryptanalytic attacks. IDEA is one methodology used in designing the hardware
of the conventional encryption algorithms that circuitry. The results are demonstrated by the
have been proposed to replace Data Encryption timing diagrams and timing reports.
Standard (DES). Furthermore, we
demonstrated the results of implementation of The details of the implementation process are
IDEA structure on to a Field Programmable shown in sections IV, V and VI respectively.
Gated Array with various performance Finally, we present a summary and our
parameters. conclusions.

Keywords:- IDEA, encryption, data security, II. THE ALGORITHM


FPGA, VHDL, architecture.
Basically the algorithm is a block cipher that
I. INTRODUCTION uses 128-bit key to encrypt data in blocks of 64
bits .The characteristics of IDEA includes
In a previous work, Xueja Lai and James block length of 64 bit, key length of 128 bit,
Massey of the swiss federal institute have confusion and diffusion. In this algorithm the
developed a conventional encryption algorithm concept of diffusion is been achieved by three
that is called International Data Encryption different operations and each operation is been
Algorithm (IDEA). performed on two 16 bit inputs.

In this study, we present an architecture The various operations are EX-OR, Addition of
hardware implementation of this algorithm and integers modulo 216, Multiplication of integers
also an application of using this algorithm for modulo 216+1. The various steps involved in
encrypting a plain text with another plain text. encrypting the plain text are summarized as
follows:

978-0-7695-3725-2/08 $25.00 © 2008 IEEE 1270


 
1. From the plain text file, each character is The decryption process is achieved by using
read and has been replaced by a predefined 8 the cipher text file and the same key text file
bit code. The process is continued until 8 that is available to both sender and receiver in
characters are read to have a total block length advance. A summary of this method is shown
of 64 bit. in Fig. 1.
2. 16 characters are read from another plain
text file. Each character has been replaced by a III. METHODOLOGY
predefined 8 bit code total of 128 bits are
obtained. These 128 bits are used as 128-bit The architecture is designed taking into
key. consideration real-time applications. Recently,
3. The obtained 64 bit block data from the first there has been a worldwide competition
step is applied to the IDEA algorithm to between various algorithms to select the most 
convert into 64 bit cipher data. suitable algorithm for implementation using
4. Obtained cipher data is written into a new FPGA. Our algorithm consisting of three 
cipher text file after converting into text data. operations XOR,  modulo addition and modulo
5. The same procedure is repeated for all the multiplication. Consequently appreciably short
characters of plain text file. time delays, makes it a superior candidate for
such applications. 
Read 8 characters from plain
IV. IDEA ENCRYPTION AND DECRYPTION
text file. Convert these
characters into predefined 8 64-Bit Plaintext X
bits each. 

Read 16 characters from key


text file. Convert these
characters into predefined 8
bits each 

Apply all the 64 bits from the


plain text file and 128 bits from
the key text file to IDEA
algorithm to obtain 64 bit
cipher data. 

Resulted cipher data is converted


into text and written into a new
cipher text file. 

Repeat the procedure for all the


characters of the text file.  64-Bit Cipher text Y
Fig.2: IDEA general structure
Fig. 1: Summary of the Encryption Algorithm

1271
 
The encryption (decryption) subkeys are made i. Single Round Specification
ready for the encryption (decryption) using the
specified functions generateEncSubKeys and The main part of the IDEA algorithm consists
generateDecSubKeys. The encryption of the application of 8 similar rounds to the
(decryption) works by taking a list of elements input plaintext and the key as shown in Fig.2.
representing the plaintext (ciphertext) and the In this section we introduce the round
private key. Then, the list of plaintext construct by introducing each of its building
(ciphertext) is segmented as segments of 4- blocks.
elements each element representing a 16-bit
word. These packed lists are then passed to A round is specified as a function singleRound
encryption or decryption along with the input with two input lists, one representing the input
private key. block from the plaintext and the other a pack
of subkeys. A singleRound works by
A functional specification of IDEA encryption composing three different functions
is formulated as a function encryption. The firstSubRound, secondSubRound, and
encryption function works by firstly thirdSubRound (fig.3).
segmenting the input list using the function
segs. Secondly, it maps the function The function firstSubRound employs modular
responsible for a single block encryption with multiplication and addition to the first 4
the input private key to all segmented input elements of both input lists. This function also
list elements. The function responsible for forwards the last two subkeys from input to
encrypting a single 4-element list is called output list.
encryptSegs.

The decryption has a similar specification.


Fig.2 shows the structure and the block
diagram for the IDEA. A single 64-bit block
from the plaintext segmented as a list of 4
elements each of 16-bit inputs to this
structure. The output has a similar type, but it
represents a block from the ciphertext.

We specify the encryption of one block as the


function encryptSegs. This function firstly
packs the encryption subkeys. Then, it folds
(using the high-order-function foldl) with an
initial list xs the function singleRound
distributing the packed subkeys to each round.
Note that the function singleRound is the
formal specification of a round. The folded
output is then passed to the function
outputTransformation along with the last pack
of subkeys, giving the final output. The
function outputTransformation specifies the Figure.3: IDEA round.
output transformation stage found as the final
stage in IDEA encryption (decryption).

1272
 
In IDEA, each plaintext bit influence every
cipher text bit. The spreading out of a single
plaintext bit over many cipher text bits hides
the statistical nature of the plaintext. This
diffusion is provided by the basic building
block of the algorithm known as the
multiplication/addition (MA) structure shown
in Fig.3. The function that specifies this
structure is called mA, and the Fig.4
multiplication/addition is done using the
functions mulMod/addMod.

The function secondSubRound employs the


function mA over two subkeys and the result
of XORing 4 elements from its own input.
A third subround is specified to complete the
scene of a whole round. This function, namely
thirdSubRound, is responsible for XORing its
inputs. Fig.5
ii. Output Transformation Specification
PLAIN TEXT INPUT:
This stage is designed to allow the decryption
India is my country. All Indians are my
to have the same structure as encryption. The
brothers and sisters. I love my country.
specification is the same as that for the
function firstSubRound.
128 bit KEY INPUT:
I LoVe India….
V.VHDL CODE
CIPHER TEXT OUTPUT:
The architecture has been implemented
SÂÅ6Û~~~¤"×ó.~~ÜôC~Á~~ï¯"~ç~x!ã_~~æ
employing VHDL hardware description
~~âåDà_I|s~p2[r~fKÿ~~~~°e~´×~~c\]˲Y~\~
language and Xilinx workstation for
?~xp½
computer-aided design (CAD). The following
Fig.6
few lines, show a sample VHDL for the
processor implementation.
CIPHER TEXT OUTPUT:
VI. SIMULATION RESULTS
SÂÅ6Û~~~¤"×ó.~~ÜôC~Á~~ï¯"~ç~x!ã_~~æ
~~âåDà_I|s~p2[r~fKÿ~~~~°e~´×~~c\]˲Y~\~
Fig. 4, shown below, illustrates the encryption
?~xp½
output for a given input bit sequence. Fig. 5,
128 bit KEY INPUT:
on the other hand, shows the output of
I LoVe India….
decryption. Fig. 6 demonstrates the output of
encryption of a text file. Fig.7 demonstrates
PLAIN TEXT INPUT:
the output of decryption of the cipher text
India is my country. All Indians are my
shown in Fig.6. All of the above Figs.4, 5 and
brothers and sisters. I love my country.
6 were obtained using Xilinx CAD
workstation. Fig.7

1273
 
VII. CONCLUSION We believe that the algorithm and its hardware
implementation offer a prominent degree of
Motivated by the need for a fast procedure LAN security against any type of cipher
suitable for packet-level encryption, we have attacks. Moreover, the simplicity of the
provided a implementation of IDEA approach provides a relatively minimal delay
algorithm. The distinctive features of this for packet-level encryption technique.
implementation are as follows:
References
• An encryption processor is designed using
only three low-level instructions XOR, [1] M. SAEB, A. BAITH, “An Encryption
Modulo-addition, Modulo-multiplication. Algorithm for Data Security,” Recent
These three instructions formed the basis of Advances in Information Science &
the algorithm and its hardware Technology, N.E. Mastorakis, (editor), World
implementation. Scientific Publishing Company, pp. 350-354,
1998.
• An subkey generator is designed using three [2] VICTOR FISCHER, “Realization of the
different operations for encryption and Round 2 AES Candidates using Altera
decryption. For encryption circular shift FPGA,” www.micronic.sk, 2000.
operation is used and 52 subkey’s each of 16 [3] Ronald Rivest, “The RC5 Encryption
bit is generated from an 128 bit key. For Algorithm,” Dr. Dobb’s Journal, #226,
decryption same 128bit key is used and two pp.146-148, January, 1995.
operations namely multiplicative inverse, [4] Kris Gaj and Pawel Chodowiec, George
additive inverse are used to produce 52 Mason University, “Comparison of the
subkey’s of 16 bit each. hardware performance of the AES candidates
using reconfigurable hardware,”
Comparing this architecture with other types http://ece.gmu.edu/crypto-text.htm, 2000.
of encryption algorithm implementations, we [5] Alfred J. Menezes et al., Handbook of
have demonstrated the superiority of our Applied Cryptography, CRC Press, 1997.
algorithm in time-critical applications. Packet- [6] A. E. Abdallah. Derivation of Parallel
level encryption is one of these applications. Algorithms from Functional Specifications to
As it is well known, this technique is applied CSP Processes. Mathematics of Program
when using public network links between two Construction, LNCS 947, (Springer Verlag,
private local area networks. This is known as 1995), pages 67–96, 1995.
Virtual Private Networks (VPN). The [7] J. Hawkins and A. E. Abdallah. Functional
implemented processor can be integrated in process modelling. Proceedings of the 7th
the system before the sender router and after IEEE International Conference on
the receiver router with slight modifications to Electronics, Circuits and Systems, December
the processor internal functions. 2000.
[8] I. Damaj, J. Hawkins, and A. Abdallah.
For higher degrees of data security, the Mapping high level algorithms onto massively
process can be repeated on the resulting parallel reconfigurable hardware. ACS/IEEE
pointer file. That is using more than one round International Conference on Computer
of encryption cycles. The number of rounds Systems and Applications, pages 14–22, July
should be agreed upon by sender and receiver 2003.
before transmission begins. [9] Celoxica. Handel-c documentation.
http://www.celoxica.com/, 2003.

1274
 
[10] National Bureau of Standards, U.S.
Department of Commerce. Data encryption
standard, January 1977.
[11] B. Schneier. Applied Cryptography. John
Wiley and Sons, New York, 1996.
[12] X. Lai and J. Massey. A proposal for a
new block encryption standard. In
Proceedings of the EUROCRYPT 90
Conference, pages 389–904, 1990.
[13] A. Tanenbaum. Computer Networks.
Prentice Hall, Upper Saddle River, NJ, third
edition, 1997.
[14] J. Daemen, R. Govaerts, and J.
Vandewalle. Weak keys for IDEA. Springer-
Verlag, pages 224–231, 1994.
[15] William Stallings. Network Security
Essentials. Prentice Hall, third edition,
November 2002.
[16] D. Runje and M. Kovac. Universal strong
encryption FPGA core implementation. In
Proceedings of Design, Automation and Test
in Europe, pages 923–924, 1998.
[17] O. Y. H. Cheung, K. H. Tsoi, P. H. W.
Leong, and M. P. Leong. Tradeoffs in parallel
and serial implementations of the international
data encryption algorithm IDEA. Lecture
Notes in Computer Science, 2162:333, 2001.
[18] Jean-Luc Beuchat and Jean-Michel
Muller. Modulo m multiplication-addition:
Algorithms and FPGA implementation.
Electronics Letters, 40(11):654–655, May
2004.
[19] O. Mencer, M. Morf, and M.J. Flynn.
Hardware software tri-design of encryption for
mobile communication units. In Proceedings
of the 1998 IEEE International Conference on
coustics, Speech and Signal Processing,
volume 5, pages 3045–3048, 1998.

1275

You might also like