Professional Documents
Culture Documents
CERTIFICATE
This is to certify that the project report titled “A Secure method for Image Signaturing
using SHA256, RSA, and Advanced Encryption Standard(AES)”, being submitted by
Names bearing Roll numbers
K. KUSUSMA 19731A0420
CH. SAI SREEJA 19731A0408
CH. MOUNIKA 19731A0411
K. SRI HARSHINI 19731A0423
Y. MUKESH CHOWDARY 19731A0444
in partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in Electronics and Communication Engineering, to the Jawaharlal
Nehru
Technological University Anantapur, Anantapuramu is a record of bonafide work carried
out by them under my guidance and supervision.
Mr. G.
Mrs. R.Manga Rao, Associate Professor, Department of ECE PBR VITS,
Sravanthi,
KAVALI
Assistant Prof,
Department of ECE
PBR VITS,
External Viva KAVALI
Voce conducted on External Examiner
1
DECLARATION
We hereby declare that the project entitled, “Title of the Project’ completed and
written by us, has not been previously submitted elsewhere for the award of any degree or
diploma.
Place:
Date:
K. KUSUMA 19731A0420
2
ACKNOWLEDGEMENTS
We consider it as our duty to express our gratitude to all those who guided, inspired
and helped us in completion of this project work.
We acknowledge, with profound sense of gratitude, the guidance and support of our
guide Mr. G. Manga Rao, Designation, Department of Electronics and Communication
Engineering, PBR VITS, Kavali. His/Her timely suggestions and co-operation, both
professionally and personally, have greatly contributed in bringing out the project
successfully.
We also express our gratitude to the principal Dr.B.Dattatraya Sarma, for providing
necessary infrastructure & an ambient atmosphere to complete our project work.
We are indeed indebted to all our teachers who have guided us throughout our
B.Tech course for the past four years and have imparted a sufficient knowledge and
inspiration to take us forward in our career.
Finally, we thank each and everyone who has helped us directly and indirectly in
completion of project work.
K. KUSUMA 19731A0420
3
Abstract
Hardware Security plays a major role in most of the applications which include net banking, e-
commerce, military, satellite, wireless communications, electronic gadgets, digital image
processing, etc. Cryptography is associated with the process of converting ordinary plain text
into unintelligible text and vice versa. There are three types of cryptographic techniques;
Symmetric key cryptography, Hash functions and Public key cryptography. The signature of the
image is done through 3 steps. The three steps include SHA256 (Secure Hash Algorithm 256),
RSA (Rivest-Shamir-Adleman), and AES (Advanced Encryption Standard). The signature of the
image is stored in a binary file which is sent to the person who needs to verify the image that is
already present near the viewer. The method has been tested y artificially applying attacks such
as blurring the image greyscale the image and changing one pixel in the image.
Keywords— Advanced Encryption Standard (AES), Rivest Shamir Adleman (RSA),
Cryptography, Digital Signature, SHA256
4
CONTENTS
Main Page
Certificate 1
Declaration 2
3
Acknowledgements
4
Abstract
5
Contents
9
List of
12
figures List
of tables
1. 1. Introduction 13
14
1.1. Cryptography
1.1.1. Symmetric and Asymmetric
key 15
1.2. Cipher types
1.2.1. Block ciphers
16
1.2.2. Stream ciphers
1.3. S – BOX(substituition)
5
16
2. 17
2. Literature Review
3. Existing method 18
3.
3.1. AES algorithm 20
21
3.4. Mix column
4. 4. Proposed System 36
5. 5.1. Advantages 39
5.2. Applications
6.2. Introduction
6.5. Module
6.5.1. Instances
6.5.2. Ports
6.5.3. Identifiers
6.5.4. Keywords
7
6.6.1.2. Register – Transfer Level
6.7. Operators
7. Simulation Results
8. Conclusion
9. References
8
LIST OF FIGURES
1.
Figure 1.1.1.1: Symmetric Encryption 3
9
4. Fig. 4.1: One round in SHA256
19
Fig. 4.3.1: Combined structure of S-Box and Inverse S-box
12
LIST OF TABLES
13
CHAPTER-I
INTRODUCTION
As the Internet has grown in popularity, so has the number of people who use it. Security
issues have become more complicated as well. One of these safeguards is the concern is data
theft and forgeries. Data transport on the internet, unauthorized access to the internet can be
intercepted and altered. A person creating a one-of-a-kind sign is one approach to avoid this.
This guarantees that the information is genuine. Cryptography has been around for a long
time. Data encryption is a means of securing data. Because it can be used in a variety of
ways.
Digital signatures are a type of network security technology. A digital signature can be used
to identify whether or not a document is authentic. data from the sender is correct. then it is
required to verify. Digital signatures must serve the same purposes as traditional signatures.
traditional signatures, which can guarantee authentication, non-repudiation, and integrity In
their digital signatures. Two algorithms are combined in one implementation, namely public
key algorithms and hashing algorithms are two types of algorithms. The problem that is
addressed is that images being very sensitive and easily editable data available online can be
edited and convey wrong information sometimes could be very dangerous. So, the image will
be signed and even a onepixel change will be detected in the original image. Thus, saving
many people from viewing edited images and interpreting wrong and misleading images. The
filename is also misleading in some situations so the filename is included along with the
image data so that even changes in the filename can also be detected by one character in the
filename.
This method secures images digitally by signing the images and enhancing their security by
the current cryptographic techniques such as SHA256 Hash, Rivest Shamir Adleman(RSA),
Advanced Encryption Standard (Advanced Encryption Standard (AES)), etc. They all have
their unique algorithm design to perform encryption and decryption. Although some of them
including MD5 and Vigenere Cipher have to become quite old and easily decrypted.
Therefore, nowadays to secure the authenticity and to perform the secure transfer of sensitive
data Advanced Encryption Standard (AES) (Advanced Encryption Standard), SHA256 hash,
and RSA algorithms are being used.
These encryption algorithms are very hard to break, moreover, these algorithms are open-
source and are present for a long time. Due to this, the algorithms are prone to brute force.
14
This method uses three encryption layers and performs the sensitive data transfer and verifies
the image authenticity very securely.
1.1 CRYPTOGRAPHY
Cryptography is associated with the process of converting ordinary plain text into
unintelligible text and vice versa. Cryptography prior to the modern age was effectively
synonymous with encryption. Converting readable information to unintelligible text. Which
can only be ready by reversing the process. There are three types of cryptographic technique
namely - Symmetric key cryptography, Hash functions and Public key cryptography.
Symmetric key algorithms namely Advanced Encryption Standard (AES), Data Encryption
Standard use the same key for encryption and decryption. It is much faster, easy to implement
and requires less processing power.
Cryptography is the science of secret, or hidden writing.
It has two main Components:
Encryption
Practice of hiding messages so that they cannot be read by anyone other than the
intended recipient
Authentication & Integrity
Ensuring that users of data/resources are the persons they claim to be and that a
message has not been surreptitiously altered
15
Fig:1.1.1.1 Symmetric Encryption
Asymmetric Key: Asymmetric keys are the public key infrastructure a cryptographic scheme
requiring two different keys, one to lock or encrypt the plaintext, and one to unlock or
decrypt the cyphertext.one key is published (public key) and the other is kept private (private
key).
16
Encryption algorithms are standardized & published
The key which is an input to the algorithm is secret
– Key is a string of numbers or characters
– If same key is used for encryption & decryption the algorithm called symmetric
– If different keys are used for encryption & decryption the algorithm called asymmetric.
Messages encoded using public key can only be decoded by the private key
– Secret transmission of key for decryption is not required
– Every entity can generate a key pair and release its public key
Symmetric algorithms:
Algorithms in which the key for encryption and decryption are the same are Symmetric
Example: Caesar Cipher
Types:
1.2.1.Block Ciphers:
o Encrypt data one block at a time (typically 64 bits, or 128 bits)
17
1.2.2 Stream Ciphers:
o Encrypt data one bit or one byte at a time2530
1.3 S-BOX(Substitution):
18
prior to its transmission, data demand its protection and needs methods for its transformation
into a meaningless form for the invaders. Cryptographic algorithms are the mathematical
methods and techniques that assist in the protection of data. Stream ciphers transform the data
in a bit-by-bit or byte-by-byte manner. Whereas, the block ciphers transform data in chunks
which comprise large number of bits or bytes at a time. In modern symmetric encryption,
block ciphers are considered as one of the most effective tools for data protection. Data
Encryption Standard (DES), Blowfish, Advanced Encryption Standard (AES), RC5, etc. are
examples of contemporary block ciphers. Precise implementations of block ciphers are easy
and are more general in nature than the stream ciphers. One category of prevalent block
ciphers is known as the SP network-based block ciphers. These block ciphers use two major
operations of substitution and permutation for the transformation of data into a perplexing
form.
19
supports the enhancement of data protection. Generally, a block cipher uses either a static S-
box or one or more dynamic S-boxes. A static S-box is fixed for every incoming data and
secret key which is used repeatedly in the block cipher. A block cipher based on a static S-
box employs that S-box in all its rounds. A static S-box allows an attacker to inspect its
characteristics, discover its fragilities, and eventually find the chance of getting plaintext
from the respective cipher-text. As an example, static S-boxes employed in Data Encryption
Standard (DES) were an easy target for the attackers. Consequently, to overcome the
weaknesses due to static S-boxes, many cryptographers have explored innovative techniques
to design dynamic S-boxes. Dynamic S-boxes are generated using cipher key and provide a
way to augment the cryptographic power of a block cipher. Construction and usage of the
key-dependent and dynamic S-boxes in a cipher enhance its cryptographic power. Blowfish
cipher employs such dynamic S-boxes in its working.
CHAPTER-II
LITERATURE REVIEW
M. Rajeswara Rao, Dr.R.K.Sharma, SVE Department, NIT Kurushetra “FPGA
Implementation of combined S box and Inv S box of AES” 2017 4th International
conference on signal processing and integrated networks (SPIN).
An implementation of a combinational memory-less S-Box and inv S-Box (combinely) for
ByteSub and InvByteSub transformations of AES on a same hardware. This is a part of the
combined architecture of AES in which both encryption and decryption can be performed
with an enable pin. Previously LUTs are used to implement the S-Box and Inv S-Box of AES
separately, which causes large amount of memory and area. In this paper, the proposed
architecture is implementing using composite field arithmetic in finite fields GF (28) which is
advantageous than LUT approach on the basis of hardware complexity. As both S-Box and
Inv S-Box are implementing on a same hardware, there is large reduction in gate count as
well as in area. The power consumption is also reduced because of the resource sharing of
multiplicative inverse module in both S-Box and Inv S-Box. The AES is suitable in wide
range of applications, such as banking, digital video recorders, web servers, ATMs and
cellular phones. Hardware implementation of AES offers more physical security and higher
speed too when compared to software implementation of AES. The main advantage of AES
over most of the cryptographic algorithms is that it doesn’t include Feistel structure.
Summary: By comparing with the LUT based in this hardware complexity is reduced.
Nalini C. Iyer ; Deepa ; P.V. Anandmohan ; D.V. Poornaiah “Mix/InvMixColumn
20
decomposition and resource sharing in AES”.
In this paper, compact architectures for AES Mix Column and its inverse is presented to
reduce the area cost in resulting AES implementation. In the hardware implementation of
AES with direct mapping substitute byte optimization, MixColumn/Inverse MixColumn
transformation demands the utilization of logic resources and then effects the critical path
delay and resulting throughput. The proposed MixColumn/Inverse MixColumn design based
on byte and bit-level decomposition leads to two types of architecture which demonstrates
deeper resource sharing within byte and between bytes and rearrangement of output terms
with respect to FPGA architecture in bit level resply. The proposed architectures have been
investigated on a FPGA based implementation platform. Application of the proposed
architectures resulted in reduction of reconfigurable logic area by 40% as compared to
separate implementation of MixColumn and Inverse MixColumn reduction and also path
delay by 9% resply. Experimental results show that our proposed architecture can reduce the
area cost significantly and compared with other previous implementations reported so far.
There exist many presentations of hardware implementations (ASIC and FPGA) of Rijndael
AES algorithms in literature. Static implementations based on ASICs are inherently
impossible to update or upgrade in response to new security threats. On the other hand, Field-
programmable gate array (FPGA) technology has much greater potential for providing higher
security level in response to new threats because of its capability for dynamic reconfiguration
and also time to market as compared to ASIC implementation.
Summary: The proposed Mix/Inv mix architecture can reduce the area cost significantly.
Yulin Zhang ; Xinggang Wang; “Pipelined implementation of AES encryption based on
FPGA” 2010 IEEE International Conference on Information Theory and Information
Security.
This paper presents the outer-round only pipelined architecture for a FPGA implementation
of the AES-128 encryption processor. The proposed design uses the Block RAM storing the
S-box values and exploits two kinds of Block RAM. By combining the operations in a single
round, we can reduce the critical delay. As the network transmission speed upgrades to the
gigabits per second (Gbps), the software-based implementations of cryptographic algorithms
cannot meet its needs. The hardware-based implementations using some special optimization
techniques (such as pipeline and lookup tables, etc.), can greatly improve throughput and
reduce the key generation time. Besides, the processes of cryptographic algorithms and the
key generation packaged in chip, which cannot easily be read or changed by external attacker,
so hardware-based implementations can get the higher physical security .In recent years ,
21
many hardware based implementations had been proposed in literature[3- 5,7-15].Some
implementations use the field programmable gate arrays (FPGA) and the others use the
application specific integrated circuit(ASIC).ASIC lacks of flexibility and has high
development costs and long development cycle.
Summary: By combining the operations in a single round, we can reduce the critical delay.
C. Sivakumar ; A. Velmurugan ; “High Speed VLSI Design CCMP AES Cipher for
WLAN (IEEE 802.11i)” 2007 International Conference on Signal Processing,
Communications and Networking.
The Advanced Encryption Standard (AES) algorithm has become the default choice for
various security services in numerous applications. In this paper, we propose a high speed,
non-pipelined FPGA implementation of the AES-CCMP (Counter-mode/CBCMAC Protocol)
cipher for wireless LAN using Xilinx development tools and Virtex-It Pro FPGA circuits.
IEEE 802.11i defines the AES-based cipher system, which is operated on CCMP Mode. All
the modules in this core are described by using Verilog 2001 language. The developed AES
CCMP core is aimed at providing high speed with sufficient security. The
encryption/decryption data path operates at 194/148MHz resulting in a throughput of 2.257
Gbits/sec for the encryption and 1.722 Gbits/sec for decryption. Compared to software
implementation, migrating to hardware provides higher level of security and faster encryption
speed. A comparison is provided between our design and similar existing implementations.
Each input byte of the State matrix is independently replaced by another byte from a look-up
table called S-Box. The AES S-box is a 256-entry table composed of two transformations:
First each input byte is replaced with its multiplicative inverse in GF (2 8) with the element
{00} being mapped onto itself, followed by an affine transformation over GF (2 8). For
decryption, inverse S-box is obtained by applying inverse affine transformation followed by
multiplicative inversion in G(28).
Summary: In the current wireless LAN environment, WEP-the current algorithm for
security-is not safe against attacks. We consider AES CCMP algorithms for wireless LAN
security.
P. S. Abhijith ; Mallika Srivastava ; Aparna Mishra ; Manish Goswami ; B. R. Singh ;
“High performance hardware implementation of AES using minimal resources” 2013
International Conference on Intelligent Systems and Signal Processing (ISSP).
Increasing need of data protection in computer networks led to the development of several
cryptographic algorithms hence sending data securely over a transmission link is critically
important in many applications. Hardware implementation of cryptographic algorithms are
22
physically secure than software implementations since outside attackers cannot modify them.
In order to achieve higher performance in today’s heavily loaded communication networks,
hardware implementation is a wise choice in terms of better speed and reliability. This paper
presents the hardware implementation of Advanced Encryption Standard (AES) algorithm
using Xilinx– virtex5 Field Programmable Gate Array (FPGA). In order to achieve higher
speed and lesser area, Sub Byte operation, Inverse Sub Byte operation, Mix Column
operation and Inverse Mix Column operations are designed as Look Up Tables (LUTs) and
Read Only Memories (ROMs).
Encryption is usually done just before sending data. To utilize the channel resources
completely encryption algorithm must have a speed at least equivalent to data transmission
speed. Achieving high throughput for encryption algorithm for a communication channel of
high data rate is a challenging task.
Summary: With the designing of all the operations as LUTs and ROMs, the proposed
architecture achieves a throughput and thereby utilizing only slices in the targeted FPGA.
N. S. Sai Srinivas ; Md. Akramuddin; “FPGA based hardware implementation of AES
Rijndael algorithm for Encryption and Decryption” 2016 International Conference on
Electrical, Electronics, and Optimization Techniques (ICEEOT).
AES algorithm or Rijndael algorithm is a network security algorithm which is most
commonly used in all types of wired and wireless digital communication networks for secure
transmission of data between two end users, especially over a public network. This paper
presents the hardware implementation of AES Rijndael Encryption and Decryption
Algorithm by using Xilinx Virtex-7 FPGA. The hardware design approach is entirely based
on pre-calculated look-up tables (LUTs) which results in less complex architecture, thereby
providing high throughput and low latency. There are basically three different formats in
AES. They are AES-128, AES-192 and AES-256. The encryption and decryption blocks of
all the three formats are efficiently designed by using Verilog-HDL and are synthesized on
Virtex-7 XC7VX690T chip (Target Device) with the help of Xilinx ISE Design Suite-14.7
Tool. The synthesis tool was set to optimize speed, area and power. The power analysis is
made by using Xilinx XPower Analyzer. Pre-calculated LUTs are used for the
implementation of algorithmic functions, namely S-Box and Inverse S-Box transformations
and also for GF (28) i.e. Galois Field Multiplications involved in Mix-Columns and Inverse
Mix-Columns transformations. The proposed architecture is found to be having good
efficiency in terms of latency, throughput, speed/delay, area and power.
Summary: The LUT based design approach gives less complex architecture and saves the
23
processing time to a great extent by retrieving the necessary values from memory locations.
Ashwini M. Deshpande ; Mangesh S. Deshpande ; Devendra N. Kayatanavar; “FPGA
implementation of AES encryption and decryption” 2009 International Conference on
Control, Automation, Communication and Energy Conservation
Advanced Encryption Standard (AES), a Federal Information Processing Standard (FIPS), is
an approved cryptographic algorithm that can be used to protect electronic data. The AES can
be programmed in software or built with pure hardware. However Field Programmable Gate
Arrays (FPGAs) offer a quicker and more customizable solution. This paper presents the AES
algorithm with regard to FPGA and the Very High Speed Integrated Circuit Hardware
Description language (VHDL). ModelSim SE PLUS 5.7g software is used for simulation and
optimization of the synthesizable VHDL code. Synthesizing and implementation (i.e.
Translate, Map and Place and Route) of the code is carried out on Xilinx - Project Navigator,
ISE 8.2i suite. All the transformations of both Encryption and Decryption are simulated using
an iterative design approach in order to minimize the hardware consumption. Xilinx
XC3S400 device of Spartan Family is used for hardware evaluation. This paper proposes a
method to integrate the AES encrypter and the AES decrypter. This method can make it a
very low-complexity architecture, especially in saving the hardware resource in
implementing the AES (Inv) Sub Bytes module and (Inv) Mix columns module etc. Most
designed modules can be used for both AES encryption and decryption. Besides, the
architecture can still deliver a high data rate in both encryption/decryption operations. The
proposed architecture is suited for hardware-critical applications, such as smart card, PDA,
and mobile phone, etc.
Finally, the normalized Hamming distance algorithm is used for matching retrieval. In order
to protect the speech security in the cloud, a speech encryption algorithm based on a 4D
hyper chaotic system is proposed. The experimental results show that the proposed method
has good discrimination, robustness, recall and precision compared with the existing
methods, and it has good retrieval efficiency and retrieval accuracy for longer speech.
Summary: This method can make it a very low-complexity architecture and low hardware
utilization.
24
CHAPTER-III
EXISTING METHOD
In the existing method, we are implementing the AES 256-bits key for 128 bit data with the
same s-box. 256-bit AES encryption block is implemented in 14 rounds. Each round consists
of Add Round Key, Sub Bytes, Shift Rows, Mix column. Round 0 consists of only Add
round Key operation.
3.1.AES Algorithm:
In this alogorithm,Round 14 consists of Sub Bytes, Shift Rows and Add Round Key
operations, which need 3 clock cycles. Rounds 1 to 13 consists of all the four operations. We
do a distinct operation in each clock cycle. Hence once the hardware has been implemented
for Add Round Key, Sub Bytes, Shift Rows, Mix column, the same hardware can be used for
all the 14 rounds. None of the four operations shares the same clock cycle.
The sequence of round operation with specific sequence of 4 operations to complete the AES
encryption. AES algorithm is serial process, i.e. output of first round is the input to the
second round. Hence, we can use the same hardware for each round. The data structure of
128-bit matrix. Each column consists of 4 elements of 8 bits each, so in total we have 32 bits
per word. The number of S-box required and Mix Column required to implement
conventional AES algorithm.
25
Fig:3.1.1 One round of AES 256
AES algorithm implementation is done using four operations namely Sub Bytes, Shift Rows,
Mix Columns and Add Round Key.The above figure shows the architecture of 256-bit AES
algorithm. In total there are 14 rounds of operation for encryption and 14 rounds for
decryption. The cipher text after encryption will be transmitted across the channel. The
receiver side will decrypt the message using same key which is used in encryption. In 256-bit
AES algorithm, the key size is 256 bits, but all the data size is 128 bits. Data include message
to be encrypted, cipher text and the decrypted message.
The internal data structure of 128-bit data. The 128-bit data is used as 4x4 matrix, where each
elements of the matrix is of 8 bits. Since all the four operations are performed on columns
basis, we convert the 128-bit data in 4x4 matrix with each element being 8 bits.
256-bit AES encryption block is implemented in 14 rounds. Each round consists of Add
Round Key, Sub Bytes, Shift Rows, Mix column. Round 0 consists of only Add round Key
operation as shown in Fig. 3. Round 14 consists of Sub Bytes, Shift Rows and Add Round
Key operations, which need 3 clock cycles as shown in Fig. 3. Rounds 1 to 13 consists of all
the four operations as shown in Fig. 13. We do a distinct operation in each clock cycle. Hence
once the hardware has been implemented for Add Round Key, Sub Bytes, Shift Rows, Mix
column, the same hardware can be used for all the 14 rounds. None of the four operations
shares the same clock cycle. Fig. 3 shows the sequence of round operation with specific
sequence of 4 operations to complete the AES encryption. AES algorithm is serial process,
26
i.e. output of first round is the input to the second round. Hence, we can use the same
hardware for each round.
27
3.1.3.Mix Column: The MixColumns transformation operates at the column level. It
transforms each column of the state to a new column. The transformation is actually the
matrix multiplication of a state column by a constant square matrix. All the arithmetic
operations are conducted in the Galois Field (Finite Field). The bytes are treated as
polynomials rather than numbers.
3.1.4.Add Round Key: AddRoundKey proceeds one column at a time. It is similar to
MixColumns in this respect. AddRoundKey adds a round keyword to each column matrix.
Matrix addition operation is performed in the AddRoundKey stage. Figure 5 shows the
AddRoundKey operation.
In encryption, SubBytes, ShiftRows, MixColumns, and AddRoundKey are performed in all
rounds except the last round. MixColumns transformation operation is not performed in the
last round of encryption. The decryption process essentially follows the same structure as the
encryption, in addition to the nine rounds of Inverse ShiftRows, Inverse SubBytes, Inverse
AddRoundKey and Inverse MixColumns Transformation.
Rijndael S-Box Generation Method The Rijndael S-Box is a square matrix which is used in
the Rijndael cipher. The S-Box serves as a lookup table. It is generated by determining the
multiplicative inverse for a given number in GF(28 ) and then transforming the multiplicative
inverse using affine transformation.
1) Multiplicative Inverse Phase: In multiplicative inverse phase, the input byte is
inversed by substituting value from multiplicative inverse table.
2) Affine Transformation: Selection of the irreducible polynomial and the designated
byte are the two most important factors of affine transformation phase. In Rijndael
AES, x 8 + x 4 + x 3 + x + 1 is used as the irreducible polynomial and as the constant
column matrix 0x63 specially designated byte is chosen. Basically, the affine
transformation consists of two operations. Firstly, 8x8 square matrix’s multiplication
and secondly, 8x1 constant column matrix addition.
28
CHAPTER-IV
PROPOSED METHOD
4.1.SHA (Secure Hashing Algorithm):
Hash function calculations are utilized during information transmission to produce the
message digest. Along these lines, it turns into a fundamental instrument for implanted
security in email, banking, and different applications. A has work takes a self-assertive length
message contribution to deliver a fixed-length yield. A hash method is a single direction
method; it is hard to reverse deliver the same hash. These properties become a significant
viewpoint to guarantee hash capacity can work approximately
SHA-256 is a cryptographic hash function that is most widely used in the field of
cryptocurrency and has undergone many changes to gain the security and Collision
Resistance it offers in the present day, Collision Resistance means the hashes will be
completely different and it is difficult to produce the same hash with two different samples of
data.
In SHA-256 the basic following operations are applied.
• Initial Preparation
• Initialization of Hash Values (h)
• Initializing the Round Constants
• Main Loop
• Compressing
• Modifying the Resulting Values
The size of the hash value produced by SHA-256 is given by 256 bits as mentioned in Table
1 this is done by taking a binary message and padding the image with a required number of
zeros if not divisible by 512 exactly and divided into blocks(b). This is the preparation in
29
initial preparation. The values mentioned in Table 2 are initial hash. These values remain the
same for any message.
30
4.3.1 Combined structure of S box and Inverse S box
In proposed 32-bit operation method, we are reusing S-box and Mix Column blocks. In
proposed design “Mix Column” and “Add Round Key” together we called Mix block.
Fig:4.3.2 Combined structure of Mix Column and Add Round Key – Mix
The use of reasons to obfuscate and decipher messages in a cryptographic framework is
known as cryptographic assessment. Secret Key Cryptography (SKC): Encryption and
unscrambling, or encryption and deciphering or decryption, are all done with the same key. In
a stream figure, the plaintext digits are blended one by one, and the distinction in reformist
digits consists during the encryption. Square code is a symmetric key code
The Add Round Key Operation
The Add-Round-Key function is the only part of the AES encryption process that works
directly with the round key. The input to the round and the round key is passed through an
exclusive or operator in this operation.
The Shift Row Operation
In this activity, each line of the state is consistently moved to one side, contingent upon the
line file.
• The primary column is moved 0 spots to the left.
• The subsequent line is moved 1 spot to the left.
• The third line is moved 2 spots to the left.
• The fourth line is moved 3 spots to the left.
SUB-BYTES Operation
The sub-byte operation is an unpredictable byte substitution, dealing with each byte of the
31
state freely. The substitution table (S-Box) is autonomous of any info and is outlined by the
mix of the two methods. • Take the multiplicative inverse in Rijndael's limited field.
• Apply a relative change
Since the S-box is independent of any, still up in the air structures are used. Each byte of the
state is then subbed by the value in the S-box whose record identifies with the value in the
state:
a(i, j) = S-Box[a(i, j)]
The opposite of Sub Bytes is something the same movement, using the changed the S-Box as
mentioned in Eq(10), Mathematically, an S-box is a vectorial Boolean function. S-Box uses
the characteristic 2 finite fields with 256 elements, which can also be called the Galois field
GF(2^8).
DECRYPTION ENCRYPTION
32
CHAPTER 5
ADVANTAGES & APPLICATIONS
5.1 Advantages:
Low complexity.
High security.
5.2 Applications:
Wireless security,
Processor security,
File encryption.
33
CHAPTER 6
VIVADO XILINX AND VERILOG HDL
6.1.HISTORY OF VERILOG:
Verilog was started initially as a proprietary hardware modeling language by Gateway Design
Automation Inc. around 1984. It is rumored that the original language was designed by taking
features from the most popular HDL language of the time, called HiLo, as well as from
traditional computer languages such as C. At that time, Verilog was not standardized and the
language modified itself in almost all the revisions that came out within 1984 to 1990.
Verilog simulator was first used beginning in 1985 and was extended substantially through
1987. The implementation was the Verilog simulator sold by Gateway. The first major
extension was Verilog-XL, which added a few features and implemented the infamous "XL
algorithm" which was a very efficient method for doing gate-level simulation.
The time was late 1990. Cadence Design System, whose primary product at that time
included thin film process simulator, decided to acquire Gateway Automation System. Along
with other Gateway products, Cadence now became the owner of the Verilog language, and
continued to market Verilog as both a language and a simulator.
At the same time, Synopsys was marketing the top-down design methodology, using
Verilog. This was a powerful combination. In 1990, Cadence recognized that if Verilog
remained a closed language, the pressures of standardization would eventually cause the
industry to shift to VHDL. Consequently, Cadence organized the Open Verilog International
(OVI), and in 1991 gave it the documentation for the Verilog Hardware Description
Language. This was the event which "opened" the language.
34
6.2.INTRODUCTION :
HDL is an abbreviation of Hardware Description Language. Any digital system can
be represented in a REGISTER TRANSFER LEVEL (RTL) and HDLs are used to
describe this RTL.
Verilog is one such HDL and it is a general-purpose language –easy to learn and use.
Its syntax is similar to C.
The idea is to specify how the data flows between registers and how the design
processes the data.
To define RTL, hierarchical design concepts play a very significant role. Hierarchical
design methodology facilitates the digital design flow with several levels of
abstraction.
Verilog HDL can utilize these levels of abstraction to produce a simplified and
efficient representation of the RTL description of any digital design.
For example, an HDL might describe the layout of the wires, resistors and transistors
on an Integrated Circuit (IC) chip, i.e., the switch level or, it may describe the design
at a more micro level in terms of logical gates and flip flops in a digital system, i.e.,
the gate level. Verilog supports all of these levels.
6.2.1.DESIGN STYLES:
Any hardware description language like Verilog can be design in two ways one is bottom-up
design and other one is top-down design.
6.2.1.1 Bottom-Up Design:
The traditional method of electronic design is bottom-up (designing from transistors and
moving to a higher level of gates and, finally, the system). But with the increase in design
complexity traditional bottom-up designs have to give way to new structural, hierarchical
design methods.
6.2.1.2 Top-Down Design:
For HDL representation it is convenient and efficient to adapt this design-style. A real top-
down design allows early testing, fabrication technology independence, a structured system
design and offers many other advantages. But it is very difficult to follow a pure top-down
design. Due to this fact most designs are mix of both the methods, implementing some key
elements of both design styles.
6.3.Features of Verilog HDL:
35
Verilog is case sensitive.
Ability to mix different levels of abstract freely.
One language for all aspects of design, testing, and verification.
In Verilog, Keywords are defined in lower case.
In Verilog, Most of the syntax is adopted from "C" language.
Verilog can be used to model a digital circuit at Algorithm, RTL, Gate and Switch
level.
There is no concept of package in Verilog.
It also supports advanced simulation features like TEXTIO, PLI, and UDPs.
36
The basic architecture of the system is designed in this step. This includes, such decisions as
RISC (Reduced Instruction Set Computer) versus CISC (Complex Instruction Set Computer),
number of ALUs, Floating Point units, number and structure of pipelines, and size of caches
among others. The outcome of architectural design is a Micro-Architectural Specification
(MAS).
6.4.3 Behavioral or Functional Design:
In this step, main functional units of the system are identified. This also identifies the
interconnect requirements between the units. The area, power, and other parameters of each
unit are estimated.
Modules. The key idea is to specify behavior, in terms of input, output and timing of each
unit, without specifying its internal structure.
The outcome of functional design is usually a timing diagram or other relationships between
units.
6.4.4 Logic Design:
In this step the control flow, word widths, register allocation, arithmetic operations, and logic
operations of the design that represent the functional design are derived and tested.
This description is called Register Transfer Level (RTL) description. RTL is expressed in a
Hardware Description Language (HDL), such as VHDL or Verilog. This description can be
used in simulation and verification
37
by converting each logic component (cells, macros, gates, transistors) into a geometric
representation (specific shapes in multiple layers), which perform the intended logic function
of the corresponding component. Connections between different components are also
expressed as geometric patterns typically lines in multiple layers.
6.4.7 Layout verification:
Physical design can be completely or partially automated and layout can be generated directly
from netlist by Layout Synthesis tools. Layout synthesis tools, while fast, do have an area and
performance penalty, which limit their use to some designs. These are verified.
Syntax:
module<module name> (<module_port_list>);
…..
<module internals> //contents of the module
….
Endmodule
6.5.1 Instances:
A module provides a template from where one can create objects. When a module is invoked
Verilog creates a unique object from the template, each having its own name, variables,
parameters and I/O interfaces. These are known as instances.
6.5.2 Ports:
Ports allow communication between a module and its environment.
All but the top-level modules in a hierarchy have ports.
38
Ports can be associated by order or by name.
You declare ports to be input, output or inout. The port declaration syntax is:
Input [range_val:range_var] list_of_identifiers;
output[range_val:range_var] list_of_identifiers;
inout[range_val:range_var] list_of_identifiers;
6.5.3 Identifiers:
Identifiers are user-defined words for variables, function names, module names, and
instance names. Identifiers can be composed of letters, digits, and the underscore
character.
The first character of an identifier cannot be a number. Identifiers can be any length.
Identifiers are case-sensitive, and all characters are significant.
An identifier that contains special characters, begins with numbers, or has the same name as a
keyword can be specified as an escaped identifier. An escaped identifier starts with the
backslash character(\) followed by a sequence of characters, followed by white space.
6.5.4 Keywords:
Verilog uses keywords to interpret an input file.
You cannot use these words as user variable names unless you use an escaped
identifier.
Keywords are reserved identifiers, which are used to define language constructs.
Some of the keywords are always, case, assign, begin, case, end and end case etc.
6.5.5 Data Types:
Verilog Language has two primary data types:
Nets - represents structural connections between components.
Registers - represent variables used to store data.
Every signal has a data type associated with it. Data types are:
Explicitly declared with a declaration in the Verilog code.
Implicitly declared with no declaration but used to connect structural building blocks
in the code. Implicit declarations are always net type "wire" and only one bit wide.
39
Registers represent data storage constructs.
Register arrays are called memories.
Register data types are used as variables in procedural blocks.
A register data type is required if a signal is assigned a value within a procedural
block
Procedural blocks begin with keyword initial and always.
The data types that are used in register are register, integer, time and real.
40
Within the logic level the characteristics of a system are described by logical links and
their timing properties.
All signals are discrete signals. They can only have definite logical values (`0', `1',
`X', `Z`). The usable operations are predefined logic primitives (AND, OR, NOT etc
gates).
It must be indicated here that using the gate level modeling may not be a good idea in
logic design.
Gate level code is generated by tools like synthesis tools in the form of netlists which
are used for gate level simulation and for backend.
6.7.OPERATORS:
Verilog provided many different operators types. Operators can be,
Arithmetic Operators
Relational Operators
Bit-wise Operators
Logical Operators
Reduction Operators
Shift Operators
Concatenation Operator
Conditional Operator
41
Binary: +, -, *, /, % (the modulus operator)
Unary: +, - (This is used to specify the sign)
Integer division truncates any fractional part
The result of a modulus operation takes the sign of the first operand
If any operand bit value is the unknown value x, then the entire result value is x
Register data types are used as unsigned values (Negative numbers are stored in two's
complement form).
Note: If any operand is x or z, then the result of that test is treated as false (0)
42
Table:6.7.3.1 Bit-wise Operator
Computations include unknown bits, in the following way:
-> ~x = x
-> 0&x = 0
-> 1&x = x&x = x
-> 1|x = 1
-> 0|x = x|x = x
-> 0^x = 1^x = x^x = x
-> 0^~x = 1^~x = x^~x = x
When operands are of unequal bit length, the shorter operand is zero-filled in the most
significant bit positions.
6.7.4 Logical Operators
Logical operators return a single bit 1 or 0. They are the same as bit-wise operators only for
single bit operands. They can work on expressions, integers or groups of bits, and treat all
values that are nonzero as “1”. Logical operators are typically used in conditional (if ... else)
statements since they work with expressions.
43
6.7.5 Reduction Operators
Reduction operators operate on all the bits of an operand vector and return a single-bit value.
These are the unary (one argument) form of the bit-wise operators.
44
6.7.8 Operator Precedence
45
End: endmodule
All your designs for this lab must be specified in the above Verilog input format. Note that
the state diagram segment does not exist for combinational logic designs.
Creating a New Project
Vivado Xilinx Tools can be started by clicking on the Project Navigator Icon on the
Windows desktop. This should open up the Project Navigator window on your screen. This
window below window shows the last accessed project.
46
Fig: 6.8.2 Set the project Name and Location
Project Name: Write the name of your new project which is user defined.
Project Location: The directory where you want to store the new project in the specified
location in one of your drive. In above window they are stored in location c drive which is
not correct , the location of software and code should not be same location.
47
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 laboratory we will be using
the Spartan3E FPGA’s.
Device: The number of the actual device. For this lab you may enter XC3S250E (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 CP132 package.
Speed Grade: The Speed grade is “-4”.
Synthesis Tool: XST [VHDL/Verilog]
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.
All project files such as schematics, netlists, Verilog files, VHDL files, etc., will be stored in
a subdirectory with the project name.
In order to open an existing project in Xilinx Tools, select File->Open Project to show the
list of projects on the machine. Choose the project you want and click OK.
48
6.9 Synthesis and Implementation of the Design:
The design has to be synthesized and implemented before it can be checked for correctness,
by running functional simulation or downloaded onto the prototyping board. With the top-
level Verilog file opened (can be done by double-clicking that file) in the HDL editor
window in the right half of the Project Navigator, and the view of the project being in the
Module view , the implement design option can be seen in the process view. Design entry
utilities and Generate Programming File options can also be seen in the process view.
To synthesize the design, double click on the Synthesize Design option in the Processes
window.
To implement the design, double click the Implement design option in the Processes
window. It will go through steps like Translate, Map and Place & Route. If any of these
steps could not be done or done with errors, it will place a X mark in front of that, otherwise a
tick mark will be placed after each of them to indicate the successful completion
After synthesis right click on synthesis and click view text report in order to generate the
report of our design.
Synthesis report completed will be like:
49
The below diagram shows how much time it takes by using vivado xilinx software
The below diagram shows that how much area it consumes by using vivado xilinx software
50
CHAPTER 7
SIMULATION RESULTS
51
Fig:7.1.1 Add All Signals to Waveform
RTL schematic:
52
Technology Schematic
53
7.3 Final Output Results:
54
Area:
Delay:
55
Evaluation table for Area, Delay:
CHAPTER 8
CONCLUSION
56
This method is very useful for protecting an image's authenticity by making use of efficient
encryption algorithms which means digitally signing the highly sensitive photographs or even
text images which when manipulated may lead to huge chaos like that happened in the
Lebanon war caused by miscommunication and misinterpretation of images these
miscommunications and misinterpretations can be prevented by using digital signatures with
three levels of protection to ensure that the images that are seen are authentic information that
is intended is conveyed in those images Hence this method can be used for the secure
transportation of their sensitive data files.
REFERENCES
[1] Z. Yong-Xia and Z. Ge, “Md5 research,” in2010 SecondInternational Conference on
57
Multimedia and InformationTechnology, vol. 2, 2010, pp. 271–273.
[2] Sahib Khan , A novel image forgery detection technique using digital signatures Vol 9 No
1 (2021): Journal of Engineering Research.
[3] Ben O'Loughlin Images as weapons of war: Representation, mediation and interpretation
January 2011 Review of International Studies 37(01):71 – 91
DOI:10.1017/S0260210510000811
[4] D. Ardy, Rizky, O. R. Indriani and, Sari, C. Atika, D. R.I. M. Setiadi, Rachmawanto, and
E. Hari, “Digital im-age signature using triple protection cryptosystem (rsa,vigenere, and
md5),” in2017 international Conference onSmart Cities, Automation Intelligent Computing
Systems(ICON-SONICS), 2017, pp. 87–92.
[5] K. Pavani and P. Sriramya, "Enhancing Public Key Cryptography using RSA, RSA-CRT
and N-Prime RSA with Multiple Keys," 2021 Third International Conference on Intelligent
Communication Technologies and Virtual Mobile Networks (ICICV), 2021, pp. 1-6, doi:
10.1109/ICICV50876.2021.9388621.
[6] Alam, Shahzad, A. Jamil, Saldhi, Ankur, and M. Ahmad,“Digital image authentication
and encryption using digitalsignature,” in2015 International Conference on Advancesin
Computer Engineering and Applications, 2015, pp. 332–336.
[7] F.Dufaux,“Grand challenges in image processing,” Frontiers in Signal Processing,
vol.1,2021.[Online].Available:https://www.frontiersin.org/article/10.3 389/frsip.2021.675547
[8] G. Feng, C. Zhang, Y. Si and L. Lang, "An Encryption and Decryption Algorithm Based
on Random Dynamic Hash and Bits Scrambling," 2020 International Conference on
Communications, Information System and Computer Engineering (CISCE), 2020, pp. 317-
320, doi: 10.1109/CISCE50729.2020.00070.
[9] R. Biswas and P. Blanco-Medina, “State of the art: Imagehashing,” 2021
[10] Miles E. Smid Development of the Advanced EncryptionStandard Volume 126, Article
No. 126024 (2021) https://doi.org/10.6028/jres.126.024 Journal of Research of the National
Institute of Standards and Technology
[11] Jiangfan Feng, Wenzheng Sun, "Improved Deep Hashing with Scalable Interblock for
Tourist Image Retrieval", Scientific Programming, vol. 2021, Article ID 9937061, 14 pages,
2021. https://doi.org/10.1155/2021/9937061
[12] hash algorithms - F. E. De Guzman, B. D. Gerardo and R. P. Medina, "Implementation
of Enhanced Secure Hash Algorithm Towards a Secured Web Portal," 2019 IEEE 4th
International Conference on Computer and Communication Systems (ICCCS), 2019, pp. 189-
192, doi: 10.1109/CCOMS.2019.8821763.
58
[13] Zeeshan Haider, Kiramat Ullah and T. Jamal, "DoS Attacks at Cooperative MAC", in
Proc. of ArXiv, arXiv:1812.04935 [cs.NI], Dec. 2018.
[14] T. Jamal and Z. Haider, "Denial of Service Attack in Cooperative Networks", in Proc. of
ArXiv, arXiv: CoRR Vol. arXiv:1810.11070 [cs.NI], Oct. 2018..
[15] Abikoye, O.C., Haruna, A.D., Abubakar, A., Akande, N.O. and Asani, E.O., 2019.
Modified advanced encryption standard algorithm for information security. Symmetry,
11(12), p.1484
59