Anda di halaman 1dari 17

A SEMINAR REPORT ON

AES Implementation for Secure Wireless


Communication

SUBMITTED BY

ABINASH AGRAWAL
Regd.No.1205209042

In partial fulfilment for the award of the degree


Of

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

Encryption Procedure in AES

4-8

Encryption Flow Chart

System Design and Flow Chart

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

Rijndael was designed to have the following characteristics:


Resistance against all known attacks.
Speed and code compactness on a wide range of platforms.
Design Simplicity.

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.

Symmetric key Cryptography


Symmetric cryptography uses the same secret (private) key to encrypt and decrypt its data. It requires
that the secret key be known by the party encrypting the data and the party decrypting the data.

Asymmetric key Cryptography


Asymmetric uses both a public and private key. This allows for distribution of your public key to
anyone with which they can encrypt the data they want to send securely and then it can only be
decoded by the person having the private key.

AES Algorithm
The AES is an iterated symmetric block cipher, which means that,

AES works by repeating the same defined steps multiple times.

AES is a secret key encryption algorithm.

AES operates on a fixed number of bytes

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

Plain text block

Round key 0
Round key 1

Round 1

Round key 2

Round 2

..

Round key 10
Key Expansion

Round 10
Cipher text block

Fig. 1: Block diagram of AES Algorithm

Encryption Procedure in AES


At the start of the Encryption or Cipher, the input data and the input key were copied to the State
array using the conventions. Initially the XOR operation should be performed between each byte of
the input data and the input key and the output will be given as the input of the Round-1. After an
initial Round Key addition, the State array is transformed by implementing a round function 10
times, with the final round differing slightly from the first Nr1 rounds. The final State is then
copied to the output. The round function is parameterized using a key schedule that consists of a onedimensional array of four-byte words derived using the Key Expansion routine.
The individual transformations that carried out are listed below.
SubBytes
ShiftRows
MixColumns
AddRoundKey
4

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.

Fig. 2: SubBytes Operation of the State


The S-Box will be of a 16X16 matrix in which the row is represented as x and the column
is represented by y. The S-box used in the SubBytes transformation is presented in hexadecimal
form and hence the substitution value would be determined by the intersection of the row and the
column.
For example, if S1,1 = {53}, then the substitution value would be determined by the
intersection of the row with index 5 and the column with index 3. This would result in S1,1 having
a value of {ED}.

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.

Fig.3: ShiftRows Operation of the State

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.

S0,c = ({02} S0,c) ({03} S1,c) S2,c S3,c


The second result byte is calculated by multiplying the same 4 values of the state column
against 4 values of the second row of the matrix. The result of each multiplication is then XORed to
produce 1 Byte.

S1,c = S0,c ({02} S1,c) ({03} S2,c) S3,c


The third result byte is calculated by multiplying the same 4 values of the state column
against 4 values of the third row of the matrix. The result of each multiplication is then XORed to
produce 1 Byte.

S2,c = S0,c S1,c ({02} S2,c ) ({03} S3,c)


The fourth result byte is calculated by multiplying the same 4 values of the state column
against 4 values of the fourth row of the matrix. The result of each multiplication is then XORed to
produce 1 Byte.

S3,c = ({03} S0,c) S1,c S2,c ({02} S3,c )


This procedure is repeated again with the next column of the state, until there are no more
state columns. Hence putting it all together, the first column will include state bytes 1-4 .

Fig.4: MixColumns operates on the State column-by-column


Figure 4 illustrates the MixColumns transformation. Hence the pictorial representation of the
MixColumns operation represented above gives the clear view on this transformation.

Add Round key


In the AddRoundKey transformation, a Round Key is added to the State by a simple bitwise XOR
operation. Each of the 16 bytes of the state is XORed against each of the 16 bytes of a portion of the
expanded key for the current round. The Expanded Key bytes are never reused. So once the first 16
bytes are XORed against the first 16 bytes of the expanded key then the expanded key bytes 1-16 are
never used again. The next time the Add Round Key function is called bytes 17-32 are XORed
against the state. This process will be continued until the operation ends. The graphical
representation of this operation can be seen below.

Fig.5: AddRoundKey Operation


The above figure 5 represents the clear view on the AddRoundKey transformation which takes place
between the results of MixColumns and KeyExpansion and gives the resultant matrix that is used as
the input to the next round.
8

Encryption Flow Chart


start
Round Counter = 10
Round_con = 1

Key addition
S Table Substitution
Encode Row Shift
True
Round counter = 1?

Encode mix column


Encode key schedule

Key addition
Round counter - 1
False
Round counter= 0?

End

Fig.6: Encryption Flow chart


In the flow chart of AES encryption algorithm round counter for 128 bit is 10. Then all other
operation like key addition, S-Table Substitution, Row Shift, MixColumn is performed. The figure 6
illustrates the whole encryption procedure that is conversion of plain text into the cipher text.

System Design
At Mega
16Atmel AVR

PC

RF
MODEM
TX-RX

Prolific
USB to
USART

PC Ps2
KEYBOARD

LCD

Fig.7: Block diagram of system


Data is transmitted from transmitter to receiver and vice versa when data is given through the
keyboard scan code of keyboard is used. If data is given through the PC then prolific USB to
UART IC pl2303 is used.
Given data is load in At Mega 16 using emulator. Then data is transmitted from transmitter to
receiver through the wire antenna. Prolific pl2303 is used for Communication interface between
USART based serial port of microcontroller and USB port of computer. Visual basic based GUI
makes it easy to pre-store the response of transmitter user.
The PL-2303 operates as a bridge between one USB port and one standard RS232 Serial port.
This device is also compliant with USB power management and remote wakeup scheme. Only
minimum power is consumed from the host during suspend. By integrating all the functions into the
SSOP- 28 package, this chip is suitable for cable embedding. Users just simply hook the cable into
PC or hubs USB port, and then they can connect to any RS-232 devices. The figure 7 illustrates
the block diagram of the system to be used.

10

System Flow chart

VB 6.0 GRAPHICAL USER


INTERFACE

PC HARD DRIVE

USB INTERFACE

PROFOLIC USB TO USART


CONVERTER

AVR 8 BIT RISC PROCESSOR

CRYPTOGRAPHY
ALGORITHM

WIRELESS DATA ERROR


CHECK

POWER SUPPLY UNIT

ALPHANUMERIC LCD
DISPLAY

PC/PS2 KEYBOARD
INTERFACE

433 Mhz RF
MODEM/TRANSCIVER

Fig.8: Flow chart of system

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

Anda mungkin juga menyukai