Professional Documents
Culture Documents
on
DATA ENCRYPTION & SECURITY
USING IMAGE PROCESSING
(A Project Report submitted in partial fulfillment of the requirements of
Bachelor of Technology in Information Technology of the West Bengal
University of Technology, West Bengal)
Submitted by
SAPTAPARNA BHOWMICK-10200215039
TANMOY SAHA-10200215048
ABHINANDAN BHATTACHARYA-10200215002
ASHFAQUE ALI KHAN-10200215010
Assistant Professor
Certificate of Approval
………………………………………… ……………………………………………..
Head Supervisor
Department of Information Technology Department of Information Technology
Kalyani Government Engineering College Kalyani Government Engineering College
………………………………………… ………………………………………………
Project Coordinator Examiner
Department of Information Technology
Kalyani Government Engineering College
ACKNOWLEDGEMENTS
I respect and thank Mrs. Manisha Barman ma’am, our Project guide
and mentor, for providing me an opportunity to do the project work and
giving us all support and guidance which made me complete the project
duly. I am extremely thankful to him for providing such essential support,
guidance and above all, a great learning experience.
CHAPTER 1
1.1 Introduction
1.2 History
1.3 Motivation
1.4 Background Work
1.5 Software Used
1.6 Software Requirement
1.7 Hardware Requirement
CHAPTER 2
2.1 Method and Implementation
2.2 Basic Concept of AES Algorithm
2.3 Basic Concept of STEGANOGRAPHY
2.4 Steps Involving Image Encryption
2.5 Proposed Methodology
CHAPTER 3
3.1 Encrypting Phase
3.2 Steps involving Image Decryption
3.3 Decrypting Phase
CHAPTER 4
4.1 Development Process
4.2 Planning
4.3 Designing
4.4 Implementation and Testing
4.5 Proposed Work
CHAPTER 5
5.1 Result And Output
CHAPTER 6
6.1 Future Scope
CHAPTER 7
Conclusion
CHAPTER 8
References
Chapter 1
1. Introduction
Recently with the greater demand in digital signal transmission and big loss
of data illegally data security has become a critical and impressive issue in data
transmission applications In order to protect valuable information from undesirable
readers or other illegal modification or reading various types of cryptographic schemes
are used the two types of cryptographic schemes are:
1.symmetric cryptography
2.asymetric cryptography
In symmetric scheme uses the same key for encryption and decryption Two keys
are used in asymmetric cryptography one for encryption known as public key and other
for decryption known as private key Asymmetric cryptography is often in key distribution
and digital signature for its slow processing speed.
The symmetric cryptography is normally used to encrypt private data for its high
performance. Moreover, the most used symmetric ciphering systems like AES, DES,
IDEA algorithm make use of the most recent developments in information processing
technology. In our project we have used to encrypt our image and text with the help of
AES algorithm. The more popular and widely adopted symmetric encryption algorithm is
the Advanced Encryption Standard (AES). It is found at least six time faster than triple
DES algorithm. In present day cryptography, AES is widely adopted and supported in
both hardware and software. Till date, no practical cryptanalytic attacks against AES has
been discovered. Additionally, AES has built-in flexibility of key length, which allows a
degree of ‘future-proofing’ against progress in the ability to perform exhaustive key
searches. To hide the text inside the image we are using steganography employ LSB
substitution technique for hiding of the data into cover image. Cryptography technique
provides encryption to the original content thereby changing the representation of the
information, which becomes difficult to understand by the attacker or intruder. In our
paper, we make use of AES encryption standard to provide cryptography. Hence, the
paper involves a combination of Steganography and Cryptography which will certainly be
more robust for the information security of the data which is being transmitted. In today’s
world of growing technology security is of utmost concern. With the increase in
cybercrime, providing only network security is not sufficient. Security provided to images
like blue print of company projects, secret images of concern to the army or of company’s
interest, using image steganography and stitching is beneficial. As the text message is
encrypted using AES algorithm and embedded in a part of the image the text message is
difficult to find. More over since the secret image is broken down into parts and then sent
to the receiver. This makes it difficult for the trespassers to get access to all the parts of
the images at once. Thus, increasing the security to a much-needed higher level. This
makes it becomes highly difficult for the intruder to detect the and decode the document.
There is no limitation on the image format that can be used right from bmp to a gif image
can be used. It can be grey scale or colored images. The size of the message needs to be
of only 140 characters.
2.History
4. Background Work
Here’s a very simple example. Say you want to encrypt this sentence:
You can send that encrypted message to someone, separately share the key,
then they’re able to decrypt it and read the original sentence.
If you send an encrypted email, only the person with the encryption key can
read it. If you’re using an encrypted internet connection to shop online, your
information and credit card number are hidden from unauthorized users, like
hackers, illegal surveillance, or identity thieves. If you encrypt data before
syncing it with the cloud, the cloud—or anyone breaking into it—can’t read
that data. Even iPhones are encrypted to protect their data if they’re lost or
stolen—something that has made headlines when organizations like the FBI
or the NSA need access to them for investigations.
5. Software Used
A number of Software and Application are used to build the current program The
program are listed below.
● MATLAB (2009b)
● MICROSOFT WORD 2016
6. Software Requirement
7. Hardware Requirement
Chapter 2
1. Theory
With the increase in data communication over the network, security of the data is
of major concern and hence is the theme of our paper. Digital data can be transmitted over
the network with little error and least interference, however to ensure unauthorized access
of the data, we need to preserve confidentiality and data integrity of the message which is
being transmitted. Steganography techniques are used to protect information by
concealing secret data. We employ LSB substitution technique for hiding of the data into
cover image. Cryptography technique provides encryption to the original content thereby
changing the representation of the information, which becomes difficult to understand by
the attacker or intruder. In our paper, we make use of AES encryption standard to provide
cryptography. Hence, the paper involves a combination of Steganography and
Cryptography which will certainly be more robust for the information security of the data
which is being transmitted. In this paper, we present a combination of both these
techniques wherein the text is first hidden into some form of cover image using Least
significant bit (LSB) hiding method and then encryption using Advanced Encryption
Standard (AES) is performed on to the stego image. The combination of both these
algorithms will certainly ensure high degree of security, integrity, capacity and robustness
to the embedded data. Using GUI based MATLAB simulation, a comparative analysis is
being made by employing different formats of the images for learning variations in
performance evaluation parameters such as delay, Peak Signal to Noise Ratio (PSNR),
Mean Square Error (MSE), and Absolute Mean Square Error (AMSE). The objectives of
this paper are to provide security against visual as well as statistical attacks and to ensure
better quality of received information. Information security is the most common word
uttered by any man any device or any peripheral since past two centuries. Protection from
malicious sources has become a part of the invention or the discovery cycle. Myriad
methods of protection are used ranging from a simple authentication password to most
complex Cryptography or Steganography algorithms for hiding the extreme sensitive
data. The other useful information security scheme for proving the ownership is through
watermarking .One such exclusive method for the data security and protection is the
image encryption .The definition is quite simple from the terms, encryption meaning the
data or bits of any particular source are changed in a definite pattern which is known to
only sender and receiver.
The first stage of each round starts with Sub Bytes transformation. This stage is
depending on nonlinear S-box to substitute a byte in the state to another byte.
According to diffusion and confusion Shannon’s principles for cryptographic
algorithm design it has important roles to obtain much more security [12]. For
example, in AES if we have hexa 53 in the state, it has to replace to hexa ED. ED
created from the intersection of 5 and 3. For remaining bytes of the state have to
perform this operation.
Fig.1 Substitute byte transformation
B. Shift Rows Transformation
The next step after Sub Byte that perform on the state is Shift Row. The main idea
behind this step is to shift bytes of the state cyclically to the left in each row rather
than row number zero. In this process the bytes of row number zero remains and does
not carry out any permutation. In the first row only one byte is shifted circular to left.
The second row is shifted two bytes to the left. The last row is shifted three bytes to
the left. The size of new state is not changed that remains as the same original size 16
bytes but shifted the position of the bytes in state as illustrated in fig.2.
Fig.2 Shift Rows
Add Round Key is the most vital stage in AES algorithm. Both the key and the input
data (also referred to as the state) are structured in a 4x4 matrix of bytes. Fig. 4 shows
how the 128-bit key and input data are distributed into the byte matrices. Add Round Key
has the ability to provide much more security during encrypting data. This operation is
based on creating the relationship between the key and the cipher text. The cipher text is
coming from the previous stage. The Add Round Key output exactly relies on the key
that is indicated by users. Furthermore, in the stage the subkey is also used and combined
with state. The main key is used to derive the subkey in each round by using Rindael's
key schedule. The size of subkey and state is the same. The subkey is added by
combining each byte of the state with the corresponding byte of the subkey using bitwise
XOR.
● Invisibility: The secret data must be invisible with the naked eye view.
● Capacity: A cover image must hold more embedded secret data, consequently
image quality is degraded, and hence there is a trade-off between image quality
and capacity
● Robustness: The stego image must hold the secret data even after some noise gets
added to it.
The above 3 conditions are the qualitative measures which indicates how much is our
system model capable to handle the various attacks
● Spatial domain approach: In this method, the secret message is directly hidden by
modifying the pixels of the image. Advantage of this technique is high data
embedding capacity. Examples are LSB substitution technique, watermarking etc.
The important concepts such as LSB inserting, followed by the types of cryptosystem etc.
are discussed in the following sections.
LSB substitution method of Steganography: LSB substitution is the most adapted method
to increase the capacity of data hiding by making some compromise in the image quality.
The LSB in the 8bit grey level image contains very less significant information, while the
MSB of the image contains significant information. LSB bit substitution technique makes
the use of this bit position and smartly replaces LSB of image with the secret data. The
mathematical representation of LSB method can be given as:
Now, if desire choice is capacity then even the last second bit can be substituted but this
will result in degradation of the image quality. Hence, there is a trade-off between image
quality and capacity of data hiding.
AES allows for three different key length sizes such as 128 bits, 192 bits, 256 bits.
Depending upon the key length different numbers of processing rounds are required for
any AES algorithm.
The 128 bit data is divided into 16 Bytes. These bytes are mapped to a 4*4 array called as
the state and all operations of AES are performed on this state.
The following are the variations of the key size and their corresponding rounds:
AES parameters
If the key length is less than the required number of bits for a specific AES algorithm then
it must be expanded by zero padding method to bring it to desired length. However, if the
required key length is more than the data bits as in AES-192, AES-256 than the key
expansion algorithm is used to expand the key length.
5. PROPOSED METHODOLOGY
For embedding the n-bit secret message M into the k rightmost LSBs of the cover-image
C, the secret message M is rearranged to form a conceptually k-bit virtual image M’
which is represented as,
A subset of n’ pixels {xl1, xl2 ,………. xln} is chosen from the cover-image C in a
predefined sequence. The embedding process is completed by replacing the k LSBs of xli
by m’i. Mathematically, the pixel value xli of the chosen pixel for storing the k-bit
message m’i is modified to form the stego-pixel x’li as follows:
Also, Algorithm for LSB Based extracting process is given as: In the extraction process,
given the stego-image S, the embedded messages can be directly extracted. Using the
same sequence as in the embedding process, the set of pixels {xl1,xl2 ,……….xln}storing
the secret message bits are selected from the stego-image. The k LSBs of the selected
pixels are extracted and lined up to reconstruct the secret message bits.
2. Implementation of Encryption using AES method Designing Steps
State array
The input to the encryption algorithm is a single 128 bit block; now this block is
required to be copied into a state array. State Array is a square matrix of bytes. This state
array is modified at each stage of encryption.
Key Expansion
This stage is the most important stage for both encryption as well as decryption.
The AES key expansion algorithm takes as input a 4-word key and produces a linear
array of 44 words. Each round uses 4 of these words as shown in Fig. 4. Each word
contains 32 bytes which means each sub key is 128 bits long.
Key Expansion
S-Box Substitution
Row Shifting
For the second row, a 1-byte circular left shift is performed. For the third row, a 2-
byte circular left shift is performed. For the third row, a 3- byte circular left shift is
performed. For the first row, no shifting is performed.
Column Mixing
1 Encrypting Phase
The decryption is the process to obtain the original data that was encrypted. This
process is based on the key that was received from the sender of the data. The decryption
processes of an AES is similar to the encryption process in the reverse
order and both sender and receiver have the same key to encrypt and decrypt data. The
last round of a decryption stage consists of three stages such as Inv Shift Rows, Inv Sub
Bytes, and Add Round Key as illustrated below
Decryption Processes
3. Decrypting Phase
1. DEVELOPMENT PROCESS:
The whole process of building software does not involve writing and
expectation of codes. Any proper software development process is composed of certain
sequence of steps. These steps include:
I. Proper planning
II. Accurate designing
III. Correct Implementation
IV. Final testing
All these parameters should be checked before finally delivering the exact result
2. PLANNING:
This forms the initial stage of the development process. The foremost step has
been established of the idea behind the project. Then it was necessary to carry of the
feasibility study. The next task was to assign a plan of action for computing the idea.
Estimation of required resource is done.
3. DESIGNING:
Once the planning was done it was time for moving forward into technical
details. At this stage the total work was divided into various modules. Each module was
set with certain targets. They reflected the functional aspects of the system Designing
involved laying the technical modeled. The design of the
coding detailed was also adopted.
Following the design, implementation was the major work to be done. This
phase involved the building the code base for the product. The source code was written in
function, every time a fragment of the code was written, it was individually tested and
verified. Once it was done such fragments were with already such developed fragments to
form larger functions. Hence implementation and testing were carried out almost at the
same time.
5. PROPOSED WORK:
Convert text into binary. Computers store all characters as numbers stored as
binary data. Binary code uses the digits of 0 and 1 (binary numbers) to represent
computer instructions or text. Each instruction or symbol gets a bit string assignment. The
strings can correspond to instructions, letters, or symbols. In computing, these codes are
used for encoding data. This base-2 or binary numeral system is used in mathematics and
computer science. The system represents values using just the two symbols. The values in
the binary systems are typically called binary numbers. In digital electronics and more
specifically in digital electronic circuits that use logic gates (with values of 0 and 1),
computers use the binary system internally. Computer based devices use the binary
system as well with this including mobile phones. You can convert to and from binary
and the base-10 system typically used by humans. You can also convert to and from
binary and hexadecimal where you need four digits of binary to represent one digit of
hex. Converting to and from binary and octal is another possibility. It takes three binary
digits to represent an octal digit. Binary 000 is octal digit 0. With binary code you use the
binary numbering system to represent text or instructions.
Sender Window
Receiver Window
Chapter 6
6. FUTURE SCOPE:
During the past decade, data hiding technologies have advanced from limited
use to ubiquitous deployment. With the rapid advancement of smart mobile devices, the
need to protect valuable proprietary information has generated a plethora of new methods
and technologies for both good and evil. Most dangerous among these are those that
employ hiding methods along with cryptography, thus providing a way to both conceal
the existence of hidden information while strongly protecting the information even if the
channel is discovered.
7. CONCLUSION
The proposed scheme is developed to ensure the more image security during
transmission by facilitating the quick image transfers. Also, the processing image security
mechanism had to be effective in the terms of elapsed time. Elapsed time is the term used
for time taken for the image processing during various transform operations. The image
quality has been measured using various performance parameters like Peak signal to noise
ratio (PSNR) and mean squared error (MSE). The proposed scheme consisted of three
components: compression,
encryption and steganography. For the compression, the discrete wavelet transform is
modified for robust image compression, whereas the blowfish algorithm has been selected
for the image encryption. The image encryption hides the image details by performing
mathematical computation on image data. The steganography is the process of hiding one
image into another image to fool the hackers and to deliver the secret data without any
visual data transmission details. The proposed algorithm has been designed to ensure the
image security during the transmission over the image sharing enabled social media
applications. These applications usually do not have strong security mechanisms to
protect the user data. The proposed algorithm is designed to fill that certain gap of
stronger security mechanism for image sharing based social media applications. The
results of the proposed algorithm have shown that the proposed algorithm have performed
more strong and lossless compression on the images in comparison with the existing
compression system. The overall system performance has been evaluated with four
performance parameters: Peak signal to noise ratio (PSNR), mean squared error (MSE),
Elapsed time (ET) and Compression Ratio (CR). The overall system performance has
shown that the new system is robust, quick and effective for the image security. The
proposed system has been tested on a classified image dataset. The image dataset is
shortlisted to five six categories. The results on all of the six categories have proved the
proposed system better than the existing system.
8. References
1.” Automatic Panoramic Image Stitching using Invariant Features”, Matthew Brown
and David G. Lowe of Computer Science, University of British Columbia, Vancouver,
Canada.
2.” High payload using mixed codebooks of Vector Quantization”, H. B. Kekre,
Tanuja K. Sarode, Archana Athawale, Kalpana Sagvekar
3.” Steganography Using Dictionary Sort on Vector Quantized Codebook. H.B. Kekre,
Archana Athawale, Tanuja Sarode, Sudeep Thepade & Kalpana Sagvekar International
Journal of Computer Science and Security (IJCSS), Volume (4): Issue (4) 392
4. ”H.B. Kekre, Archana Athawale and Pallavi N.Halarnkar,”Polynomial
Transformation to improve Capacity of Cover Image For Information Hiding in Multiple
LSBs ”,International Journal of Engineering Research and Industrial
Applications(IJERIA),Ascent Publications ,Volume 2,March 2009,Pune