You are on page 1of 14

It is just a portion of my final year proj report containing AES detail.

CHAPTER 1

INTRODUCTION
1 INTRODUCTION
This project is about to secure the military communication. The radio phones that army use now a
days, are insecure. They work upon full-duplex communication and without any security. The
National Radio Telecommunication Company (NRTC) produces full-duplex radiophones. They
don’t use ciphering techniques for encryption. The communication can be secured if ciphering is
used. Today, with the fast growth of technology, the simple ciphering techniques are not so safe.

This project is about to use encryption technique and also make this communication, as 2-way
real-time communication. The encryption technique, used in this project is Advance Encryption
Standard (AES). Two Belgian cryptographers, Joan Daemen and Vincent Rijmen under the name
Rijndael, developed the Advanced Encryption Standard. AES is a block encryption of 128 bits
used to replace the outdated DES, which was vulnerable to brute force attacks. It operates on a
4×4 array of bytes and uses 128, 192 or 256 bit keys.

With the security of communication, this project also deals with 2-way real time communication
between two end. The frequency of sending and receiving ends is same. As it is duplex
communication so at one end there are one transmitter and one receiver, transmitter is use to
transmit voice of specific frequency, and the receiver has different frequency to avoid loop at the
same end. Similarly at other end.

1.1 Purpose
Secure communication is a very difficult task in any field. Every one wants to do secure
communication with each other without having any unauthorized use in between. So, the
main purpose of this project is to provide secure communication between two parties.
Such a communication, which can not be intercepted.

1.1 Major Goals


 The project is to make 2-way communication as secure as possible.
 To simulate AES on a voice signal using MATLAB.
 To implement real time voice encryption, working upon the same lines as AES
does, using “TMS320C6713 DSK”.
1.3 Block Diagram

The complete block diagram of the project in which Digital Signal Processor(DSP) with
Analog to Digital Converter(ADC) and Digital to Analog Converter(DAC) is used, such
that ADC receives an audio signal from transmitting end and gives it to the DSP for the
process of encryption which involves AES. DSP after encrypting that signal gives its
output to the DAC which sends this signal to the receiver end.
The basic goals to be achieved in this project were simulate the AES algorithm using
MATLAB and implementation of algorithm on TMS320C6713 DSK.This is done by
reading a recorded wave file in MATLAB & converting its samples into ‘n’ number of
4x4 arrays and then applying all the processes involving AES to this array, that are further
described in chapter 2. After getting the encrypted voice signal we will write this signal
again to a wave file.

Now, this encrypted wave file is given to the decrypter end to get the original version of
the sound back. Decrypter also involves its processes that are almost inverse of the
encrypter processes and are also discussed in detail in chapter 2.

The second major goal is to implement this encryption technique on a DSP. To do that,
we are using a TEXAS INSTRUMENTS DSP KIT model number “TMS320C6713” and
using its CODE COMPOSER STUDIO with SIMULINK. In this kit we can implement
the voice encryption algorithm and get the real time output by using its AIC23 codec.
Code Composer communicates with the DSK through an embedded JTAG emulator with
a USB host interface. The DSK can also be used with an external emulator through the
external JTAG connector to burn the projects in its flash memory, which can run from
there whenever needed. These projects are created and build in SIMULINK and using
LINK FOR CODE COMPOSER STUDIO, they are build and executed in CCS, which
creates an exe file, that is to be burned on the flash memory of the kit. After building the
project in MATLAB it automatically open the CCS and starts building and executing the
project in it.

Chapter 1 covers a brief introduction to the project, as it is being discussed above, the
purpose of the project.

Chapter 2 covers the complete literature of “AES” and the “TMS320C6713” i.e. the
processes involved in AES encryption and decryption and the complete study about the
TMS320C6713 DSK, how to use it and how can we implement the voice encryption
working upon the same lines as AES does.

Chapter 2 also introduces several tools available for digital signal processing (DSP).
These tools include the popular Code Composer Studio (CCS), which provides an
integrated development environment (IDE), and the DSP starter kit (DSK) with the
TMS320C6713 floating-point processor onboard and complete support for input and
output.

Chapter 3 covers the complete simulation and implementation of the project and the
challenges involved in it.
CHAPTER 2

LITERATURE REVIEW
2 LITERATURE REVIEW

2.1 AES for Voice Encryption


The main requirements of the project were to learn about and understand the working of
AES to develop an encryption algorithm. This algorithm would encrypt a voice signal so
that it could be transmitted without the worry of it being intercepted and translated by an
unwanted third party.

As for voice encryption in this project we selected AES (Advanced Encryption Standard).
This technique is also called Rijndael. According to that the input, the output and the
cipher key for AES are each bit sequences containing 128,192 or 256 bits with constraints
that the input and output sequences have the same length. Generally AES uses only the
length that is 128 bits. The input to the encryption and decryption algorithms is a single
128-bit block. This block is a square matrix of bytes. This block is copied into the state
array, which is modified at each stage of encryption or decryption. After the final stage,
the state is copied to an output matrix. Similarly the, 128-bit key is depicted in square
matrix of bytes. This key is then expanded into array of key schedule words.

The Encryption and Decryption in AES have 10, 12 or 14 rounds (we will use 10) and
each round has the following stages:

 Substitute bytes
 Shift rows
 Mix columns
 Add round key
 Key expansion
Following is a block diagram showing the whole process of AES Encryption and
Decryption.

Figure 2-1 Block Diagram of AES


Following is the description of the terms used in the Rijndael algorithm and the block
diagram above.

2.1.1 Substitute Bytes Transformation

Forward and Inverse Transformations


The forward substitute byte transformation uses an S-box to perform a
byte-by-byte substitution of the block. AES defines a 16x16 matrix of byte values,
called S-box that contains a permutation of all possible 256 8-bit values. Each
individual byte of state is mapped into a new byte in such a way that the leftmost 4
bits of the byte are used as a row value and the rightmost 4 bits are used as a column
value. These row and column serve as indexes into the S-box to select a unique 8-bit
output value. For example, the hexadecimal value {95} references row 9 and column
5 of the S-box, which contains the value {2A}. Accordingly, the value {95} is
mapped into the value {2A}.
For further understanding of the substitution using S-box,
figure 2-2(a&b)can be used:

Figure 2-2(a) SubBytes


S-box shown as follows in figure 2-2(a).

Figure 2-2(b) S-Box

The creation of S-box involved 2 major steps.


The first step in the S-box generating process is to search for the multiplicative inverses
of all elements of the finite field GF(28) In other words: For all possible 256 byte values
b, find the byte b−1 that satisfies:

b • b−1 = 1,
Where • denotes the polynomial multiplication.

After the inverses of all bytes have been found, the second step of the S-box creation
process is an affine transformation, consisting of a polynomial multiplication with a
specific constant (31d = 00011111b) modulo another constant
(257d = 100000001b) and the xor-addition of a third constant (99d = 01100011b):

bout = bin • 31d mod 257d + 99d,


Where bin represents the input byte to be transformed, + denotes the bit-wise xor
operation,and the output byte after the transformation is returned in bout.

The inverse substitute byte transformation called InvSubBytes, makes use of the
inverse S-box. For example, that the input {2A} produces the output {95} and the input
{95} produces {2A}.
2.1.2 Shift Rows Transformations

Forward and Inverse Transformation


The forward shift row transformation called shift rows is one of the
more simple commands. Basically, the top row of the state is left alone. The second
row down is shifted to the left by one byte, the third by two and the bottom row is
shifted to the left by three bytes. This ensures that each new column is made up of
all four previous columns.

Figure 2-3 ShiftRows

The inverse shift row transformation performs the circular shifts in opposite direction
for each of the last rows, with a one byte circular right shift for rest row and so on.
2.1.3 Mix Columns Transformation

Forward and Inverse Transformations


The forward mix column transformation operates on each column
individually. A substitution that makes use of arithmetic, by using a lookup table. The
Mix Column process is one of the more complicated routines that make up AES. It is
done by treating each column as a four-term polynomial with coefficients that are finite
field elements. The columns are considered as polynomials over GF (2 8) and multiplied
modulo x4 + 1 with a fixed polynomial a(x) = {03}x3 + {01}x2 + {01}x + {02}. This can
be written as a matrix multiplication as shown below in figure 2-4(a).

Figure 2-4(a) Polynomial Matrix for Mix Columns

Figure 2-4(b) Mix Columns


The inverse mix columns works exactly the same way as it did in the forward process
but in inverse process we need to do a matrix multiplication again but the matrix with
which it has to be multiplied is different this time and is shown in figure 2-4(c) below:
Figure 2-4(c) Polynomial Matrix for Inv MixColumns

2.1.4 Add Round Key Transformation

Forward and Inverse Transformations


In the forward add round key transformation, the 128 bits of state are
bitwise XORed with the 128 bits of the round key. Add Round Key is a very easy process
to understand. The next state is simply the present state xor’ed with the present key.

Figure 2-5 AddRoundKey

The inverse add round key transformation is identical to the forward add round key
transformation, because the XOR operation is its own inverse
2.1.5 Key Expansion

The AES key expansion takes as input a 4-word (16-bytes) key and produces a linear
array of 44-words (176-bytes). This is sufficient to provide a 4-word round key for the
initial Add Round Key stage and each of the 10 rounds of the cipher.

It involves 3 major processes.


1. Rot Word performs a one-byte circular left shift on a word.
2. Sub Word performs a byte substitution on each byte of its input word,
using the S-box.
3. The results of steps 1 and 2 are XORed with a round constant, Rcon[j].

The round constant is a word in which the


three rightmost bytes are always 0. Thus
the effect of an XOR of a word with Rcon
is to only perform an XOR on the leftmost
byte of the word. The round constant is
different for each round and is defined as
Rcon[j]=(RC[j],0,0,0), with
RC[1]=1, RC[j]=2.RC[j-1] and with
multiplication defined over the field GF (28).
The figure 2-6 shows the process of Key
Expansion.

Figure 2-6 KeyExpansion

You might also like