SUBMITTED BY
ABINASH AGRAWAL
Regd.No.1205209042
MCA
Silicon institute of Technology
Bhubaneswar
FEBUARY 2014
ACKNOWLEDGEMENT
Any achievement, be it scholastic or otherwise does not depend solely on the individual efforts but
on the guidance, encouragement and cooperation of intellectuals, elders and friends. A number of
personalities, in their own capabilities have helped me in carrying my seminar. I would like to take
this opportunity to thank them all.
First and foremost I would like to thank to my Seminar faculties Prof. Kasturi Dhal, Prof.
Niranjan Kumar Ray, Prof. Manoj Kumar Samantara and Prof. Sk. Kamaruddin without their
help this seminar would not have been a success. I would like to thank you all for giving me your
support & cooperation that was required and also, for being tremendous source of inspiration &
motivation.
I would also like to thank our H.O.D Prof. Aurabinda Misra for his co-operation and
support in making this seminar.
I will be failing in my duty, if I do not express my gratitude towards other staff members and
friends who have helped me to complete my seminar work successfully and in time.
ABINASH AGRAWAL
REGD. No: 1205209042
MCA 4th SEMESTER
ABSTRACT
Data Security is plays a vital role every communication system. There are many ways to provide
security data that is being communicated. In order to protect data from malicious attacks we use
Cryptography. With increase in usage of wireless media for communication and increased
number of attacks on the same, there is a need to develop a viable cryptographic scheme. The
earlier encryption algorithm such as Data Encryption Standard (DES), triple DES which has
several loopholes such as small key size and sensible to brute force attack etc. and it cant
provide high level, efficient and exportable security. These loopholes overcome by a new
algorithm called as Advanced Encryption Standard (AES). Here implementation of AES
algorithm for encryption is described.
The Advanced Encryption Standard (AES) is a specification for the encryption of
electronic data established by the U.S. National Institute of Standards and Technology
(NIST) in 2001. It is based on the Rijndael cipher developed by two Belgian cryptographers, Joan
Daemen and Vincent Rijmen, who submitted a proposal to NIST during the AES selection process.
Rijndael is a family of ciphers with different key and block sizes. For AES, NIST selected three
members of the Rijndael family, each with a block size of 128 bits, but three different key lengths:
128, 192 and 256 bits.
Contents:
Topic
Page No.
Introduction
Motivation
1-2
Methods of Encryption
AES Algorithm
2-4
4-8
10-11
Conclusion
12
References
13
Introduction
In todays world most of the communication is done using electronic media. Data Security plays a
vital role in such communication. Hence, there is a need to protect data from malicious attacks. This
can be achieved by Cryptography. The earlier encryption algorithm such as Data Encryption
Standard (DES), triple DES which has several loopholes such as small key size and sensible to brute
force attack etc. and it cant provide high level, efficient and exportable security. These loopholes
overcome by a new algorithm called as Advanced Encryption Standard (AES).
Advanced Encryption Standard (AES), also known as Rijndael, is an encryption standard
used for securing information. AES was published by NIST (National Institute of Standards and
Technology). AES is a block cipher algorithm that has been analysed extensively and is now used
widely. Rijndael is very secure and has no known weakness. Rijndael is conventional (symmetric
key) system and is relatively simple cipher in many respects. It takes an input block of a certain size,
usually 128, and produces a corresponding output block of the same size. The transformation
requires a second input, which is the secret key.
In this seminar work, the plain text of 128 bits is given as input to encryption block in which
encryption of data is made and the cipher text of 128 bits is throughout as output. The key length of
128bits, 192bits or 256bits is used in process of encryption. The AES algorithm is a block cipher that
uses the same binary key for both encryption and decryption of data blocks.
Motivation
The Advanced Encryption Standard, in the following referenced as AES, is the winner of the
contest, held in 1997 by the US Government, after the Data Encryption Standard (DES) was found
too weak. Fifteen candidates were accepted in 1998 and based on public comments the pool was
reduced to five finalists in 1999. In October 2000, one of these five algorithms was selected as the
forthcoming standard: a slightly modified version of the Rijndael.
The Rijndael, whose name is based on the names of its two Belgian inventors, Joan Daemen
and Vincent Rijmen, is a Block cipher, which means that it works on fixed-length group of bits,
which are called Blocks. It takes an input block of a certain size, usually 128, and produces a
corresponding output block of the same size. The transformation requires a second input, which is
the secret key. It is important to know that the secret key can be of any size (depending on the cipher
used) and that AES uses three different key sizes: 128, 192 and 256 bits.
1
Methods of Encryption
Although there can be several pieces to an encryption method, the two main pieces are the
algorithms and the keys. As stated earlier, algorithms are usually complex mathematical formulas
that dictate the rules of how the plaintext will be turned into cipher text. A key is a string of random
bits that will be inserted into the algorithm. In some encryption methods, the receiver and the sender
use the same key and in other encryption methods, they must use different keys for encryption and
decryption purposes. The following sections explain the difference between these two types of
encryption methods.
AES Algorithm
The AES is an iterated symmetric block cipher, which means that,
AES as well as most encryption algorithms is reversible. This means that almost the same steps
are performed to complete both encryption and decryption in reverse order. The AES algorithm
operates on bytes, which makes it simpler to implement.
Specification
For the AES algorithm, the length of the input block, the output block and the State is 128 bits. This
is represented by Nb = 4, which reflects the number of 32-bit words (number of columns) in the
State. The length of the Cipher Key, K, is 128 bits. The key length is represented by Nk = 4, which
reflects the number of 32-bit words (number of columns) in the Cipher Key.
For the AES algorithm, the number of rounds to be performed during the execution of the
algorithm is dependent on the key size. The number of rounds is represented by Nr, where Nr = 10
when Nk = 4.
Description
The AES is an iterated block cipher with a fixed block size of 128 and a variable key length. The
different transformations operate on the intermediate results, called state. The state is a rectangular
array of bytes and since the block size is 128 bits, which is 16 bytes, the rectangular array is of
dimensions 4x4. The basic unit for processing in the AES algorithm is a byte, a sequence of eight
bits treated as a single entity. The input, output and Cipher Key bit sequences which are processed as
arrays of bytes that are formed by dividing these sequences into groups of eight contiguous bits to
form arrays of bytes.
Rijndaels round
At a basic level the Rijndael algorithm uses a number of rounds to transform the data for each block.
The number of rounds used is 6 + the maximum of Nb and Nk. Following from the previous example
of AES-128, the number of rounds is 10. This is calculated from 6 plus the maximum of (4,4). Since
Nb and Nk are both 4, the number of rounds is 6 + 4 = 10
The figure 1 shows the top level blocks available in the AES algorithm. Also the basic inputs to
the system and the outputs from the system were clearly represented. As per the standard, 10 rounds
for 128 bits key length were carried out in which the last round will be performed separately. For
both its Cipher and Inverse Cipher, the AES algorithm uses a round function that is composed of four
different byte-oriented transformations:
Byte substitution using a substitution table (S-box)
Shifting rows of the State array by different offsets
Mixing the data within each column of the State array
Adding a Round Key to the State
Above mentioned functions were carried out for every individual round and in the last round
the third function, that is, Mixing the data within each column of the State array will not be
performed. Hence the last round is carried out separately. Based on the key provided, the new set of
keys will be generated in the Key Expansion block and is given to the each round as input.
Cipher key
Round key 0
Round key 1
Round 1
Round key 2
Round 2
..
Round key 10
Key Expansion
Round 10
Cipher text block
Key Expansion
Prior to encryption or decryption the key must be expanded. The expanded key is used in the Add
Round Key function defined above. Each time the Add Round Key function is called a different part
of the expanded key is XORed against the state. In order for this to work the Expanded Key must be
large enough so that it can provide key material for every time the Add Round Key function is
executed. The Add Round Key function gets called for each round as well as one extra time at
beginning of the algorithm.
SubBytes Transformation
The SubBytes operation is a non-linear byte substitution, operating on each byte of the state
independently. Since the S-Box is independent of any input, pre-calculated forms are used, if enough
memory (256 bytes for one S-Box) is available. Each byte of the state is then substituted by the value
in the S-Box whose index corresponds to the value in the state. Figure 2 illustrates the effect of the
SubBytes transformation on the State clearly.
ShiftRows Transformation
Arranges the state in a matrix and then performs a circular shift for each row. This is not a bit wise
shift. The circular shift just moves each byte one space over. A byte that was in the second position
may end up in the third position after the shift.
Figure 3 illustrates the ShiftRows transformation. The shifting operation will be carried out
horizontally as follows.
The 1st row is shifted 0 positions to the left.
The 2nd row is shifted 1 positions to the left.
The 3rd row is shifted 2 positions to the left.
The 4th row is shifted 3 positions to the left.
MixColumns Transformation
In MixColumns operation, parts of the state are multiplied against which parts of the matrix. The
transformation operates on the State column-by-column. The State is arranged into a 4 row table (as
described in the Shift Row function). The multiplication is performed one column at a time (4 bytes).
Each value in the column is eventually multiplied against every value of the matrix (16 total
multiplications). The results of these multiplications are XORed together to produce only 4 result
6
bytes for the next state. Therefore 4 bytes input, 16 multiplications 12 XORs and 4 bytes output. The
multiplication is performed one matrix row at a time against each value of a state column.
The pre-defined 4X4 matrix value and the first column of the ShiftRows state are represented as
follows, for the multiplication.
The first result byte is calculated by multiplying 4 values of the state column against 4 values
of the first row of the matrix. The result of each multiplication is then XORed to produce 1 Byte.
Key addition
S Table Substitution
Encode Row Shift
True
Round counter = 1?
Key addition
Round counter - 1
False
Round counter= 0?
End
System Design
At Mega
16Atmel AVR
PC
RF
MODEM
TX-RX
Prolific
USB to
USART
PC Ps2
KEYBOARD
LCD
10
PC HARD DRIVE
USB INTERFACE
CRYPTOGRAPHY
ALGORITHM
ALPHANUMERIC LCD
DISPLAY
PC/PS2 KEYBOARD
INTERFACE
433 Mhz RF
MODEM/TRANSCIVER
The input data is given through the PC. For that Visual Basic Graphical interface is used. When
data is given through the PC USB to UART converter IC pl2303 is used. Then data is loaded in
At Mega16.For the security of data cryptography algorithm is used. After that encrypted data is
displayed on LCD. When data is given through the keyboard scan code is used. For the data
communication 433Mhz frequency is used. The figure 8 shows the details implementations of AES
in the system.
AES is successfully implemented in the above discussed system and data is transmitted up to
a maximum distance of 100m at 4.6 Kbps, which is quite enough for wireless communication. But
on increasing the distance data transmission rate decreases.
11
Conclusion
With increase in usage of wireless media for communication and increased number of attacks on the
same, there is a need to develop a viable cryptographic scheme.
Earlier schemes such as DES and Triple DES couldnt suffice the needs of wireless
communication, a stronger encryption technique was needed.
Rijndael appears to be consistently a very good performer in both hardware and software
across a wide range of computing environments regardless of its use in feedback or non feedback
modes. Its key setup time is excellent, and its key agility is good. Rijndaels very low memory
requirements make it very well suited for restricted-space environments, in which it also
demonstrates excellent performance.
There are many unknowns regarding future computing platforms and the wide range of
environments in which the AES will be implemented. However, when considered together,
Rijndaels combination of security, performance, efficiency, implementability, and flexibility make it
an appropriate selection for the AES for use in the technology of today and in the future.
12
References:
1. G.H.Karsanbhai and M.G.Shajan, Published in: Emerging Trends in Networks and Computer
Communications (ETNCC), 2011 International Conference, Page(s):497 501.
2. Tsang-Yean Lee, Huey-Ming Lee, Homer Wu, Jin-Shieh Su, DataTransmission Encryption
and Decryption Algorithm in Network Security.
3. Pekka Riikonen .RSA algorithm. Nov. 2002
4. Bruce Schneier. Applied Cryptogrphy Second adition (Chapter 12)
5. Diaa Salama Abdul. Elminaam, Hatem M. Abdul Kader and Mohie M.
6. Hadhoud, Performance Evaluation of Symmetric Encryption Algorithms on Power
Consumption for Wireless Devices, oct. 2009
7. William Stallings, Cryptography and Network Security: Principles and Practices,
International Edition, Third Edition 2003 by Pearson Education, Inc. Upper Saddle River, NJ
07458.
8. National Institute of Standards and Technology (NIST). NIST FIPS PUB 185, Escrowed
Encryption Standard, February 1994.
13