Smart Agriculture Using Iot
Smart Agriculture Using Iot
on
MRIET i ECE
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
CERTIFICATE
This is to certify that the major project phase II entitled “ADVANCED ENCRYPTION
STANDARD ALGORITHM WITH OPTIMAL S-BOX AND AUTOMATED KEY GENERATION”
that is being submitted by “A.KALYAN(21W91A0402),A.ANIL NAYAK(21W91A0401),
G.AKHIL CHARY(21W91A0435),B.HARIKA(21W91A0440)” under the guidance of
Mr.OWK.SRINIVASULU M.Tech,(Ph.D) for the award of B.Tech Degree in ELECTRONICS
AND COMMUNICATION ENGINEERING from the MALLA REDDY INSTITUTE OF
ENGINEERING & TECHNOLOGY, Maisammaguda (Affiliated to JNTU Hyderabad) is a
record of Bonafide work carried out by them under our guidance and supervision. The
results embodied in this major project have not been submitted to any other university or
institute for the award of any degree.
Dr. P SRINIVAS
DECLARATION
We, A. KALYAN (21W91A0402), A.ANIL NAYAK (21W91A0401), G.AKHIL
CHARY (21W91A0435), B. HARIKA (21W91A0440) hereby declare that the major
project phase II entitled “ADVANCED ENCRYPTION STANDARD ALGORITHM
WITH OPTIMAL S-BOX AND AUTOMATED KEY GENERATION” is Bonafide work
done and submitted under the guidance of Mr. OWK. SRINIVASULU in partial
fulfillment of the requirement for the award of the degree of BACHELOR OF
TECHNOLOGY in ELECTRONICS AND COMMUNICATION ENGINEERING.
DEPARTMENT OF ECE
A KALYAN 21W91A0402
A ANIL NAYAK 21W91A0401
G AKHIL CHARY 21W91A0435
B HARIKA 21W91A0440
ACKNOWLEDGEMENT
We are very much thankful to Director, Shri. P.PRAVEEN REDDY for giving us
this opportunity to do this major project. We express our deep sense of gratitude to him for
his constant guidance and inspiring words.
We express our profound thanks to our Principal, Dr. P. SRINIVAS, for extending
all the college facilities for the completion of the major project.
We would like to thank Mr. OWK. SRINIVASULU M.Tech,(Ph.D), Associate
Professor and Head of the Department of Electronics and Communication Engineering for
having provided the freedom to use all the facilities available in the department, especially
the laboratories and the library, at anytime.
We feel highly obliged to our Major Project coordinator Mr. S. RAMESH BABU,
Associate Professor and Project guide Mr. OWK. SRINIVASULU(Ph.D), Associate
Professor, Department of Electronics and Communication Engineering for their constant
encouragement and moral support. They have been a source of valuable guidance,
suggestions and kindness during the course of the project work. We find no words to
express our gratitude and thanks to them.
We sincerely thank all the staff of the Department of Electronics and
Communication Engineering, for their timely suggestions, healthy criticism and motivation
during the course of our study. We would also like to thank our friends for always being
there to provide required help or support. With great respect and affection, we thank our
parents who were the backbone behind our deeds.
Finally, we express our immense gratitude with pleasure to one and all who have
either directly or indirectly contributed to our need at right time for the development and
execution of project work.
DEPARTMENT OF ECE
A KALYAN 21W91A0402
A ANIL NAYAK 21W91A0401
G AKHIL CHARY 21W91A0435
B HARIKA 21W91A0440
List of Contents
ABSTRACT 1
CHAPTER 1 – INTRODUCTION 2
CHAPTER 2 - ADVANCED ENCRYPTION STANDARD 4
2.1 Introduction 4
2.1.1 AES: Scope and Significance 4
2.1.2 Evaluation Criteria 5
2.2 Block Ciphers 6
2.2.1 Iterative Block Ciphers 7
2.2.2 Key-Alternating Block Ciphers 8
CHAPTER 3 - LITERATURE SURVEY 10
CHAPTER 4 - EXISTING SYSTEM 12
4.1 DES (Data Encryption Standard) 12
4.1.1. Processing the plaintext 13
4.1.2. Function 2- Round-Key generation 14
CHAPTER 5 - PROPOSED SYSTEM 15
5.1 AES Algorithm 15
5.2 AES Encryption 15
5.2.1 SubBytes Transformation 15
5.2.2 ShiftRows Transformation 17
5.2.3. MixColumns Transformation 19
5.2.4. Add Round Key Transformation 19
5.3 AES Decryption 20
5.3.1 AddRoundKey 20
5.3.2 InvShiftRows Transformation 20
5.3.3 InvSubBytes Transformation 20
5.3.4 InvMixColumns Transformation 21
CHAPTER 6 – VHDL( VHSIC Hardware Description Language) 23
6.1 VHDL 23
6.1.1 History of VHDL 23
MRIET i ECE
6.1.2 Levels of Abstraction (Styles) 25
6.1.3 Need for VHDL 26
6.1.4 Advantages of VHDL 27
6.1.5 Design Methodology using VHDL 28
6.1.6 Elements of VHDL 28
6.1.7 VHDL language features 29
6.1.8 Data Types 35
6.1.9 Packages and Package Bodies 36
CHAPTER 7 - SOFTWARE REQUIREMENTS 37
7.1 XILINX 37
7.1.1 Introduction to XILINX ISE: 37
7.1.2 Implementation: 37
7.1.3 XILINX Design Process: 38
7.1.4 Creating a New Project 39
7.1.5 Opening a project 39
7.1.6 Simulating and Viewing the Output Waveforms: 44
7.1.7. Synthesis and Implementation of the Design: 46
7.1.8 View RTL Schematic: 47
CHAPTER 8 - SIMULATION RESULTS 48
8.1 Simulation Result 48
8.2 Block Diagram 49
8.3 RTL 49
8.4 Technology 50
CHAPTER 9 – FUTURE SCOPE AND CONCLUSION 51
Future Scope 51
Conclusion 51
REFERENCES 52
MRIET ii ECE
List of Figures
Fig. No. Content Page No.
MRIET iv ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
ABSTRACT
The Advanced Encryption Standard (AES) algorithm plays a pivotal role in
ensuring data confidentiality in modern cryptographic and security applications. Among
its core components, the SubBytes transformation, implemented through the S-box
(Substitution box) module, is crucial for achieving high levels of confusion and diffusion,
which are fundamental principles in secure cipher design. However, this transformation
also introduces significant path delay overhead, especially in hardware implementations.
Typically, Look-Up Tables (LUTs) or embedded memory blocks are used to realize the S-
box, but these are often vulnerable to side-channel and fault injection attacks, thereby
posing serious threats to the security of practical cryptosystems.
To overcome these limitations, this paper presents the design and implementation
of SubBytes and Inverse SubBytes operations using composite field arithmetic, which not
only reduces the overall computational complexity but also strengthens the resistance of
the S-box against known cryptographic attacks. The proposed approach further
incorporates a multiple-round AES cryptosystem architecture, utilizing higher-order
transformations and composite field-based S-box formulations. In addition, various inner-
stage pipelining strategies are explored to enhance the throughput rate of the
encryption/decryption process while simultaneously optimizing critical path delay.
The entire design will be developed using VHDL (VHSIC Hardware Description
Language), enabling precise hardware-level modeling and simulation. For functional
verification and synthesis, the Xilinx ISE Design Suite will be employed, ensuring accurate
timing analysis, resource utilization reporting, and performance evaluation. This work aims
to contribute an efficient and secure AES architecture suitable for high-speed, real-time,
and resource-constrained cryptographic applications.
MRIET 1 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
CHAPTER 1 – INTRODUCTION
The Data Encryption Standard (DES) was considered as a standard for the
symmetric key encryption. DES has a key length of 56 bits. However, this key length is
currently considered small and can easily be broken. For this reason, the National Institute
of Standards and Technology (NIST) opened a formal call for algorithms in September
1997. A group of fifteen AES candidate algorithms were announced in August 1998. Next,
all algorithms were subject to assessment process performed by various groups of
cryptographic researchers all over the world. In August 2000, NIST selected five
algorithms: Mars, RC6, Rijndael, Serpent and Two fish as the final competitors. These
algorithms were subject to further analysis prior to the selection of the best algorithm for
the AES. Finally, on October 2, 2000, NIST announced that the Rijndael algorithm was the
winner. Rijndael can be specified with key and block sizes in any multiple of 32 bits, with
a minimum of 128 bits and a maximum of 256 bits. Therefore, the problem of breaking the
key becomes more difficult. In cryptography, the AES is also known as Rijndael. AES has
a fixed block size of 128 bits and a key size of 128, 192 or 256 bits.
The AES algorithm can be efficiently implemented by hardware and software.
Software implementations cost the smallest resources, but they offer a limited physical
security and the slowest process. Besides, growing requirements for high speed, high
volume secure communications combined with physical security, hardware
implementation of cryptography takes place. An FPGA implementation is an intermediate
solution between general purpose processors (GPPs) and application specific integrated
circuits (ASICs). It has advantages over both GPPs and ASICs. It provides a faster
hardware solution than a GPP. Also, it has a wider applicability than ASICs since its
configuring software makes use of the broad range of functionality supported by the
reconfigurable device.
Since its announcement in 2001, the Advanced Encryption Standard (AES) has
become a widely known and relied upon block cipher. It has been used for countless
different applications ranging in size and scale from internet banking operations performed
on large web servers to private communications between a wireless smart card and its
reader Every application has different requirements such as the speed at which security
MRIET 2 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
operations must be performed, the physical area for embedded hardware, or its power
budget Given this large range of applications and requirements, it isn’t surprising that AES
designs have been implemented using all sorts of platforms, ranging from software running
on general purpose computer hardware to fully customized hardware platforms which are
able to run much faster, or have a much smaller chip area and power consumption.
Given the diverse implementation platforms and performance requirements, AES
must be tailored to meet specific constraints in each use case. In resource-constrained
environments such as embedded systems, IoT devices, and smart cards, the focus is often
on minimizing power consumption, chip area, and latency, without compromising security.
Conversely, in high-performance systems like data centers or secure cloud infrastructures,
the priority shifts toward achieving maximum throughput, parallelism, and low latency
through techniques such as hardware acceleration, pipelining, and parallel AES cores. This
flexibility in implementation has led to extensive research in optimizing AES architectures,
where various trade-offs between area, speed, and energy efficiency are carefully evaluated
to meet application-specific demands. As a result, AES continues to be a central component
in modern cryptographic systems, with its adaptability ensuring relevance across a wide
spectrum of technologies and use cases.
MRIET 3 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 4 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 5 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
between there is the whole range of processors that are used in servers, workstations, PCs,
palmtops etc. , which are all devices ii1 need of cryptographic support A prominent place
in this range is taken by the Pentium family of processors due to its presence in most
personal computers.
A second feature is key agility. In most block ciphers, key set up takes some
processing. In applications where the same key is used to encrypt large amounts of data,
this processing is relatively unimportant. In applications where the key often changes, such
as the encryption of Internet Protocol (IP) packets in Internet Protocol Security (IPSEC) ,
the overhead due to key setup may become quite relevant . Obviously, in those applications
it is an advantage to have a fast key setup.
MRIET 6 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
In this expression, p(i) is called the ith round of the block cipher and k(i) is called
the ith round key. The round keys are computed from the cipher key. Usually, this is
specified with an algorithm. The algorithm that describes how to derive the round keys
from the cipher key is called the key schedule. The concatenation of all round keys is called
the expanded key, denoted by K.
The length of the expanded key is denoted by nK. The iterative block cipher model
is illustrated in Figure 1. Almost all block ciphers known can be modeled this way. There
is however a large variety in round transformations and key schedules. An iterative block
cipher in which all rounds (with the exception of the initial or final round) use the same
round transformation is called an iterated block cipher.
𝐾 = 𝑘 (0) |𝑘 (1) |𝑘 (2) | … |𝑘 (𝑟)
MRIET 7 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
In this case, p is called the round transformation of the block cipher. The relations
between the different classes of block ciphers. Key-iterated block ciphers lend themselves
to efficient implementations. In dedicated hardware implementations, one can hard-wire
MRIET 8 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
the round transformation and the key addition. The block cipher can be executed by simply
iterating the round transformation alternated with the right round keys.
In software implementations, the program needs to code only the one round
transformation in a loop and the cipher can be executed by executing this loop the required
number of times. In practice, for performance reasons, block ciphers will often be
implemented by implementing every round separately (so-called loop unrolling). In these
implementations, it is less important to have identical rounds. Nevertheless, the most-used
block ciphers all consist of a number of identical rounds.
This design approach of using identical round structures simplifies both the
implementation and analysis of block ciphers like AES, especially when considering
security proofs and cryptographic strength. The uniformity of rounds enhances modularity,
allowing for easier optimization, testing, and debugging across various platforms.
Moreover, techniques such as loop unrolling in software and parallel processing in
hardware can significantly improve performance, particularly in throughput-critical
applications. However, this comes at the cost of increased code size in software or hardware
resource usage in FPGA/ASIC implementations. Despite these trade-offs, the use of
identical rounds remains a preferred architectural choice as it supports scalable and
efficient implementations while preserving the algorithm’s inherent security properties.
MRIET 9 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Computer has become an essential device now a day. The main use of computer is
to store data and send the data from one location to other. The information that is shared
must be transported in a secure manner. So to avoid such situations data may be encrypted
to some formats that is unreadable by an unauthorized person. Cryptography is the science
of information security which has become a very critical aspect of modern computing
systems to secure the data transmission and storage.
The algorithm was implemented in FPGA using Spartan 3E starter kit and Xilinx
ISE development suite. The purpose of this attempt was to test the correctness of the
MRIET 10 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 11 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
A DES key consists of 64 binary digits ("0"s or "1"s) of which 56 bits are randomly
generated and used directly by the algorithm. The other 8 bits, which are not used by the
algorithm, may be used for error detection. The 8 error detecting bits are set to make the
parity of each 8-bit byte of the key odd, i.e., there is an odd number of "1"s in each 8-bit
byte. A TDEA key consists of three DES keys, which is also referred to as a key bundle.
Authorized users of encrypted computer data must have the key that was used to encipher
the data in order to decrypt it. The encryption algorithms specified in this standard are
commonly known among those using the standard. The cryptographic security of the data
depends on the security provided for the key used to encipher and decipher the data.
MRIET 12 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Data can be recovered from cipher only by using exactly the same key used to
encipher it. Unauthorized recipients of the cipher who know the algorithm but do not have
the correct key cannot derive the original data algorithmically. However, it may be feasible
to determine the key by a brute force “exhaustion attack.” Also, anyone who does have the
key and the algorithm can easily decipher the cipher and obtain the original data. A standard
algorithm based on a secure key thus provides a basis for exchanging encrypted computer
data by issuing the key used to encipher it to those authorized to have the data.
DES Encryption process has two functions
A. Processing the plaintext
B. Round-Key generation
MRIET 13 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
significance in DES. The initial and final permutations are straight P-boxes that are
inverses of each other.
DES takes 64-bit key as input. Among 64-bit key only 56 bitsare effective and used
directly by the algorithm. The other 8 bits, which are not used by the algorithm, may be
used for error detection or set arbitrarily or can be ignored [13]. The 8 error detecting bits
are set to make the parity of each 8-bit byte of the key odd, i.e., there is an odd number of
"1"s in each byte. The round-key generator creates sixteen 48-bit round/sub keys out of a
56-bit cipher key. The round key generation block is shown in Figure 4
MRIET 14 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
The AES (Advanced Encryption Standard) algorithm uses the same key for both
encryption and decryption, ensuring fast and efficient data processing. It operates on fixed
block sizes, typically 128 bits, and supports key lengths of 128, 192, or 256 bits. Widely
adopted across the globe, AES provides a high level of security and is used in applications
ranging from secure communications to file encryption.
MRIET 15 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 16 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 17 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
than 128 bits. Selection of the offsets. The simplicity criterion dictates that one offset is
taken equal to O. In fact, for a block length of 1 28 bits, the offsets have to be 0, 1, 2 and
3. The assignment of offsets to rows is arbitrary. For block lengths larger than 128 bit, there
are more possibilities. Detailed studies of truncated differential attacks and saturation
attacks on reduced versions of Rijndael show that not all choices are equivalent. For certain
choices, the attacks can be extended with one round. Among the choices that are best with
respect to saturation and truncated differential attacks, we picked the simplest ones.
Different values are specified in table 2. Fig 6 illiterate the effect of the ShiftRows step on
the state. Figure 7 shows the pictograms for ShiftRows and its inverse.
MRIET 18 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 19 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
5.3.1 AddRoundKey
The AddRoundKey step in AES is its own inverse because the XOR operation is
self-inverting. This means applying the same key again will restore the original data. For
decryption, the round keys are used in reverse order. The other transformations—
SubBytes, ShiftRows, and MixColumns—contribute to the cipher’s security and will be
described next.
MRIET 20 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
In this project, we have used S-box using composite field algorithm, which contains
sub-bytes and inverse sub-bytes operation. Both these modules can use encryption and
decryption in a shared way which requires less hardware. These blocks used successive
XOR operations and transformed the value into some other values . It consists of various
sub-modules like affine transformation, multiplication inverse, and multiplication with
constant. Composite S-box implementation is the fastest and safer method to implement.
It requires the text_in, text_out and key which have a 128 bits length. And the
control signals using to control the proper operations of the core are clk, reset_n, write,
direction, done and enable pins. The Key block loads keys and combines with Key Round
block to perform Key Expansion transformation, and generates proper Roundkeys under
the control signals from the Controller block. Controller block takes write signal, direction
signal, and enable signal from outside and generates all the control signals for the whole
system. The plain text (text_in) and key is loaded only when the write signal makes a low-
high-low transition (basically a pulse). The process is going to complete when the done
signal is pulsed after some clock cycles from the write signal goes low. The “done” signal
actives only in one clock cycle.
Each round key as well as round is completed in one clock cycle. However, the
round key is finished before the round is calculated by one clock cycle. Hence, combining
with one clock cycle for registering the input, a total clock cycle need for processing 128-
bit data is 13 clocks in encryption mode. In decryption, eleven round keys must be
completed before the first round is calculated. Because the last round key is used in the
firstround process, it takes 25 clock cycles to complete. With using the above iterative
looping approach, a minimal number of clock cycles required performing
encryption/decryption for each data block of 128-bit.
MRIET 22 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
not address the simple problem of characterizing different signal strengths or commonly
used simulation conditions such as unknowns and high impedances. Soon after IEEE 1076-
1987 was adopted, simulator companies began enhancing VHDL with new non-standard
types to allow their customers to accurately simulate complex electronic circuits. This
caused problems because design descriptions entered into one simulator were often
incompatible with another with other environments. VHDL was quickly becoming a non-
standard.
To get around the problem of non-standard data types, an IEEE committee adopted
another standard. This standard numbered 1164, defines a standard package (a VHDL
feature that allows commonly used declaration to be collected into an external library)
containing definition for a standard nine-value data type. This standard data type is called
standard logic, and the IELL 1164 package is often referred to as the standard logic
package. The IEEN 1076-1987 and IEEE 1164 standards together form the complete
VHDL standard in widest use today (IEEE 1076-1993 is slowly working its way into the
VHDL mainstream, but it does not add significant number of features for synthesis users).
In the search for a standard design and documentation tool for the Very High Speed
Integrated Circuits (VHSIC) program the United States Department of Defense (DOD) in
the summer of 1981 sponsored a workshop on HDLs at Woods Hole, Massachusetts. The
conclusion of the workshop was the need for a standard language, and the features that
might be required by such a standard in 1983.DoD established requirements for a standard
VHSIC hardware description language(VHDL), based on the recommendation of the
“Woods Hole” workshop. A contract for the development of the VHDL language, its
environment, and its software was awarded to IBM, Texas instruments and Intermetrics.
VHDL 2.0 was released only six months after the project began. The language was
significantly improved hereafter and other shortcomings were corrected leading to the
release of VHDL 6.0. In 1985 this significant developments led to the release of VHDL
6.0. In 1985 these significant development led to the release of VHDL 7.2 language
reference manual. This was later on developed as IEEE 1076/A VHDL language reference
manual. Efforts for defining the new version of VHDL stated in 1990 by a dream of
volunteers working under the IEEE DASC (Design Automation Standards committee). In
October of 1992, a new VHDL’93 was completed and was released for review. After minor
MRIET 24 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
modifications, this new version was approved by the VHDL balloting group members and
became the new VHDL language standard. The present VHDL standard is formally
referred as VHDL 1076-1993.
MRIET 25 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
more small programs that operate sequentially and communicate with one another through
their interfaces. The only difference between behavior-level VHDL and a software
programming language such as Visual Basic is the underlying execution platform: in the
case of Visual Basic, it is the Windows operating system in the case of VHDL, it is a
simulator. An alternate design method, in which a circuit design problem is segmented into
registers and combinational input logic, is what is often called the dataflow level of
abstraction.
Dataflow is an intermediate level of abstraction that allows the drudgery of
combinational logic to be hidden while the more important parts of the circuit, the registers,
are more completely specified. There are some drawbacks to using a purely dataflow
method of design in VHDL. First, there are no built-in registers in VHDL the language was
designed to be general-purpose, and VHDL’s designers on its behavioral aspects placed
the emphasis. If you are going to write VHDL at the dataflow level of abstraction, then you
must first create behavioral descriptions of the register elements that you will be using in
your design. These elements must be provided in the form of components or in the form of
subprograms.
But for hardware designers, for whom it can be difficult to relate the sequential
descriptions and operation of behavioral VHDL with the hardware that is being described,
using the dataflow level of abstraction can make quite a lot of sense. Using dataflow, it can
be easier to relate a design description to actual hardware devices. The dataflow and
behavior levels of abstraction are used to describe circuits in terms of their logical function.
There is a third style of VHDL that is used to combine such descriptions together into a
larger, hierarchical circuit description. Structural VHDL allows you to encapsulate one part
of a design description as a re-usable component. Structural VHDL can be thought of as
being analogous to a textual schematic, or as a textual block diagram for higher-level
design.
MRIET 26 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
various boards, or gate array using the synthesis tools of Hardware Description language
us such a language. VHDL was designed as a solution to provide an integrated design and
documentation to communicate design data between various levels of abstractions.
MRIET 27 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
7. It is an IEEE and ANSI standard, and therefore, models described using these
languages are portable.
8. There are no limitations that are imposed by the language on the size of the design.
9. The language has elements that make large-scale design modeling easier, for e.g.
Components, functions, procedures and packages.
10. Test benches can be written using the same language to test other VHDL models.
11. Nominal propagation delays, min-max delays, setup and holding timing, timing
constraints, and spike detection can all be described very naturally in this language.
12. Behavioral models that conform to a certain synthesis description style are capable of
being synthesized to gate-level description.
13. The capability of defining new data types provides the power to describe and simulate
a new design technique at a very high level of abstraction without any concern about
implementation details.
1. The bottom-up approach involves the defining and designing the individual
components, then bringing the individual components together to form the overall
design.
2. In a flat design the functional components are defined at the same level as the
interconnection of those functional components.
3. A top-down design process involves a divide-and-conquer approach to implement the
design a large system. Top-down design is referred to as recursive partitioning of a
system into its sub-components until all sub-components become manageable design
parts.
MRIET 28 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
begins with Entity keyword and contains the input-output ports of the component. An
architectural specification begins with the Architectural keyword, which describes the
functionality of a component.
This functionality depends on input-output signals and other parameters that are
specified in the interface description. Several architectural specifications with different
identifiers can exist for one component with a given interface description. VHDL allows
architecture to be configured for a specific technology environment.
In a hardware design environment it becomes necessary to group components or
utilities used for description of components. Components and such utilities can be grouped
by use of packages. A package declaration contains components and utilities to become
visible by Entities and Architectures. VHDL allows the use of Libraries and binding of
sub-components of a design to elements of various libraries. Constructs for such
applications include a library statement and configurations.
MRIET 29 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
• Description : All designs are expressed in terms of entities. Entity is the most basic
building block in a design. The uppermost level of the design is the top-level entity. If
the design is hierarchical, then the top-level description will have lower-level
descriptions contained in it. These lower-level descriptions will be lower-level entities
contained in the top-level entity description.
2. Architecture
Every entity in a VHDL design description must be bound with a corresponding
architecture. The architecture describes the actual function of the entity to which it is
bound. Using the schematic as a metaphor, you can think of the architecture as being
roughly analogous to a lower-level schematic pointed to by the higher-level functional
block symbol. The second part of a minimal VHDL source file is the architecture
declaration. Every entity declaration you write must be accompanied by at least one
corresponding architecture. The architecture declaration begins with a unique name,
followed by the name of the entity to which the architecture is bound. Within the
architecture declaration is found the actual functional description of our comparator. There
are many ways to describe combinational logic functions in VHDL.
• Formal Definition : A body associated with an entity declaration to describe the
internal organization or operation of a design entity. An architecture body is used to
describe the behavior, data flow or structure of a design entity:
• Simplified syntax
Architecture architecture-name of entity-name is
Architecture-declarations
Begin
Concurrent-statements
End [architecture] [architecture-name];
MRIET 30 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
3. Component Declaration
• Formal Definition : A component declaration declares a virtual design entity interface
that may be used in component instantiation statement.
• Simplified syntax:
Component component-name
[generic(generic-list)];
port(port-list);
end component [component-name];
4. Component Instantiation
• Formal Definition : A component instantiation statement defines a subcomponent of
the design entity in which it appears, associate signals or values with the ports of that
subcomponent, and associates values with generics of that subcomponent.
• Simplified syntax
Label: [component] component-name
Generic map (generic-association-list);
Port map (port-association-list);
MRIET 31 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
5. Configuration Declaration
• Formal Definition : A configuration is a construct that defines how component
instances in a given block are bound to design entities in order to describe how design
entities are put together to form a complete design.
• Simplified syntax
Configuration configuration-name of entity-name is
Configuration declarations.
For architecture-name
For instance-label: component-name
Use entity library-name. Entity-name (arch-name);
End for;
end for;
end configuration-name;
6. Configuration Instantiation
• Formal Definition : A component instantiation statement defines a subcomponent of
the design entity in which it appears, associates signals or value with the ports of that
subcomponent
• Simplified syntax
Label: Configuration configuration-name
Generic map (generic-association-list);
Port map (port-association-List);
7. Package
• Formal Definition : A package declaration defines the interface to a package.
• Simplified syntax
Package package-name is
Package –declarations
End [package] package-name;
MRIET 32 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
8. Package body
• Formal Definition : A package body defines the bodies of subprograms and the values
of deferred constants declared in the interface to the package.
• Simplified syntax:
Package body package-name is
Package-body-declarations
Subprogram bodies declarations
End [package body] package-name;
9. Attributes
Attributes are of two types: user defined and predefined.
a. User defined
• Formal Definition : A value, function, type, range, signals, or constant that may be
associated with one or more named entities in a description.
• Simplified syntax
Attribute attribute-name: type;
Attribute attribute-name of item: item-class is expression
• Description : Attributes allow retrieving information about named entities: types,
objects, subprograms etc. Users can define mew attributes and then assign them to named
entities by specifying the entity and the attribute values for it.
b. Predefined
• Formal Definition : A value, function, type, range, signals, or constant that may be
associated with one or more named entities in a description.
• Simplified syntax:
object’s attribute-name
MRIET 33 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
• Simplified syntax:
[process-label:] process [(sensitivity-list)];
Process-declarations
begin
Sequential-statements
end process [process-label];
11. Function
• Formal Definition : A function call is a subprogram of the form of an expression that
returns a value.
• Simplified syntax
Function functionname(parameters) return type
Function function-name(parameters) return type is
Begin
Sequential statements
End [function] function-name;
12. Port
• Formal Definition : A channel for dynamic communication between a block and its
environment.
• Simplified Syntax:
Port (port-declaration, port-declaration,);
port declarations:
Port-signal-name: in port-signal-type: =initial-value
Port-signal-name: out port-signal-type: =initial-value
Port-signal-name: in out port-signal-type: =initial-value
Port-signal-name: buffer port-signal-type: =initial-value
Port-signal-name: linkage port-signal-type: =initial-value
13. Sensitivity List
• Formel Définition : A list of signals a process is sensitive to.
• Simplified syntax:
(Signal-name, signal-name, ---)
Formal Definition
MRIET 34 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Bit: a 1-bit value representing a wire. (Note: IEEE standard 1164 defines a 9-valued
replacement for bit called std_logic.)
MRIET 35 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
file: used to read and write disk files. Useful for simulation.
Physical: used to represent values such as time, voltage, etc. using symbolic units of
measure (such as 'ns' or 'ma').
A package can consist of two basic parts: a package declaration and an optional
package body. Package declarations can contain the following types of statements:
2. Constant declarations
5. Attribute specifications
6. File declarations
7. Component declarations
8. Alias declarations
9. Disconnect specifications
MRIET 36 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 37 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
– Converts all input design netlists and then writes the results into a single merged
file, that describes logic and constraints.
➢ Mapping (MAP)
– Maps the logic on device components.
– Takes a netlist and groups the logical elements into CLBs and IOBs (components of
FPGA).
➢ Place And Route (PAR)
– Place FPGA cells and connects cells.
➢ Bit stream generation
MRIET 38 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
VHDL or a combination of both. In this thesis we will only use the design flow that
involves the use of Verilog HDL.
MRIET 39 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Project Location: The directory where you want to store the new project (Note: DO NOT
specify the project location as a folder on Desktop or a folder in the Xilinx\bin directory.
Your H: drive is the best place to put it. The project location path is NOT to have any
spaces in it eg: H:\Full Adder\F A is NOT to be used).Leave the top level module type as
HDL.
Clicking on NEXT should bring up the following window:
For each of the properties given below, click on the ‘value’ area and select from the list of
values that appear.
Device Family: Family of the FPGA/CPLD used. In this thesis we will be using the
Spartan3E FPGA’s.
Device: The number of the actual device. For this lab you may enter XC3S100E (this can
be found on the attached prototyping board)
Package: The type of package with the number of pins. The Spartan FPGA used in this lab
is packaged in VQ100 package.
Speed Grade: The Speed grade is “-5”.
Synthesis Tool: XST [VHDL/Verilog]
MRIET 40 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Simulator: The tool used to simulate and verify the functionality of the design. Modelsim
simulator is integrated in the Xilinx ISE. Hence choose “Modelsim-XE Verilog” as the
simulator or even Xilinx ISE Simulator can be used.
Then click on NEXT to save the entries.
MRIET 41 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Select Verilog Module and in the “File Name:” Enter the name of the Project. Then click
on Next to accept the entries. This pops up the following window.
MRIET 42 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
In the Port Name column, enter the names of all input and output pins and specify the
Direction accordingly. A Vector/Bus can be defined by entering appropriate bit numbers
in the MSB/LSB columns. Then click on Next>to get a window showing all the new source
information.
The source file window can be used as a text editor to make any necessary changes to the
source file. All the input/output pins will be displayed. Save your Verilog program
periodically by selecting the File->Save from the menu. You can also edit Verilog
programs in any text editor and add them to the project directory using “Add Copy Source”.
MRIET 43 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
MRIET 44 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
If there are no errors click on simulate behavioral model. A window pop up is opened.
Here we can give the inputs. Right click on the selected input click on force constant and
enter the input value click on Ok.
Click on Run option in the tool bar to check input and output waveforms.
MRIET 45 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Open the Synthesis Report in the Detailed Reports to see the Device utilization Summary
and Timing Report of the current project.
MRIET 46 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
The window with Top module is opened to view the internal modules click on the top
module.
MRIET 47 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
In fig 8.1 shows the output of encryption. Here the input is given as plain text of
128 bits and key length as 256 bits it generates output chiper text as 128 bits
In fig 8.2 shows the output of encryption. Here the input is given as chiper text of
128 bits and key length as 256 bits it generates output plain text as 128 bits
MRIET 48 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
8.3 RTL
MRIET 49 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
8.4 Technology
MRIET 50 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
Conclusion
In this project, the most popular encryption algorithm, which is advanced
encryption standard algorithm, has been discussed and successfully designed and simulated
using VHDL. In the proposed architecture, we are providing key as a digital biometric
form, whereas in the conventional design, the key was provided manually so that key
management and key leakage was the major issue. Hence, the proposed design gives a
higher degree of security than the conventional design. Further, in the proposed
architecture, we have optimised the s-box, which requires less hardware, instead of using
hardcore block RAM. The implementation of the Field-Programmable Gate Array (FPGA)
could be the future scope of this work.
MRIET 51 ECE
ADVANCED ENCRYPTION STANDARD ALGORITHM WITH OPTIMAL S BOX AND AUTOMATED KEY GENERATION
REFERENCES
[1] Daemen J., and Rijmen V, "The Design of Rijndael: AES-the Advanced Encryption
Standard", Springer-Verlag, 2002
[2] FIPS 197, “Advanced Encryption Standard (AES)”, November 26, 2001.
[3] Tessier, R., and Burleson, W., “Reconfigurable computing for digital signal processing:
a survey”, J.VLSI Signal Process., 2001, 28, (1-2), pp.7-27.
[4] Ahmad, N.; Hasan, R.; Jubadi, W.M; “Design of AES S-Box using combinational logic
optimization”, IEEE Symposium on Industrial Electronics & Applications (ISIEA), pp.
696-699, 2010.
[5] Alex Panato, Marcelo Barcelos, Ricardo Reis, “An IP of an Advanced Encryption
Standard for Altera Devices”, SBCCI 2002, pp. 197-202, Porto Alegre, Brazil, 9 and 14
September 2002.
[6] Mr. Atul M. Borkar, Dr. R. V. Kshirsagar and Mrs. M. V. Vyawahare, “FPGA
Implementation of AES Algorithm”, International Conference on Electronics Computer
Technology (ICECT), pp. 401-405, 2011 3rd.
MRIET 52 ECE