Vous êtes sur la page 1sur 23

170001 : Project I

A Project Report on

Steganography

As partial fulfillment of award of


Bachelor of Engineering in
Information Technology
Submitted by

Utsav Patel : 120010116017


Harshil Darji : 120010116045

GTU Group ID

29254

Guided by

Prof. Jitiksha Patel

A. D. Patel Institute of Technology


Gujarat Technological University
(Oct - 2015)

Steganography

Department of Information Technology

A. D. Patel Institute of Technology


Gujarat Technological University

CERTIFICATE
This is to certify that Patel Utsav Prakashchandra (120010116017) and Darji
Harshil Jagadishbhai (120010116045) of final year Information Technology
have satisfactorily completed their partial/full project work entitled
Steganography for the subject 170001-Project-I in the first semester of
academic year 2015-16 for the partial fulfillment of the award of the Bachelor
of Engineering in Information Technology at Gujarat Technological University.
Date: 13 Oct 15
Project Guide (Internal)

Prof. Jitiksha Patel

Head of Department
Dr. N. C. Chauhan

Principal of Institute
Dr. R. K. Jain

Steganography

Index
Sr. Title
List of figures
Acknowledgement
1 Introduction
2 Objective
3 Image Steganography
3.1 Literature survey
3.2 LSB (Least Significant Bit)
4 Requirements
4.1 Functional Requirements
4.2 Non Functional Requirements
5 Implementation
5.1 Hiding text inside the image
5.2 Extracting text from the image
5.3 Steps for working with tool
6 Diagrams
6.1 Activity Diagram
6.2 Class Diagram
6.3 Sequence Diagram
6.4 Use Case Diagram
7 Future work
8 References

Page
4
5
6
7
8
9
10
12
13
14
16
17
19
20
20
21
22
23

Steganography

List of Figures
Fig No.
3.1
5.2
5.3
6.1
6.2
6.3
6.4

Title
Example of LSB Algorithm
Hiding process of Image Steganography
Extraction process of Image Steganography
Activity Diagram
Class Diagram
Sequence Diagram
Use Case Diagram

Page No.
10
17
18
19
20
20
21

Steganography

ACKNOWLEDGEMENT
Sometimes words fall short to show gratitude, the same is happing with us during this project.
The immense help and support receive from faculties and friends overwhelmed us during the
project. The project work has been the most exciting part of our learning experience, which
would be assert us for our future carrier.
We are earnestly express my sincere thanks and sense of gratitude to Dr. R. K. Jain principal of
A D Patel Institute of Technology, who has given me an opportunity to work on such project
development by providing all facilities that are required. I am grateful to Dr. N. C. Chauhan
(Head of the Information Technology department, ADIT) who has helped me in the successful
completion of this project.
We are highly indebted to Prof. Jitiksha Patel (project internal guide) who has provided us with
the necessary information and his valuable suggestion and comment on bringing out this project
in the best possible way.
We are also thankful to everyone who have always been guiding, encouraging and motivating us
throughout the project.

Steganography

Introduction

One of the reasons that intruders can be successful is the most of the information they acquire
from a system is in a form that they can read and comprehend. Intruders may reveal the
information to others, modify it to misrepresent an individual or organization, or use it to launch
an attack. One solution to this problem is, through the use of steganography.

Steganography is a technique of hiding information in digital media. In contrast to


cryptography, it is not to keep others from knowing the hidden information but it is to keep
others from thinking that the information even exists.
Mainly four types of steganography are available:
1.
2.
3.
4.

Image Steganography
Audio Steganography
Video Steganography
Text Steganography

Steganography become more important as more people join the cyberspace revolution.
Steganography is the art of concealing information in ways that prevents the detection of hidden
messages. Steganography include an array of secret communication methods that hide the
message from being seen or discovered.

Steganography

Objective

Among all four types of steganography, we will implement only three steganography techniques.
We have divided our project in three modules:
1. Image Steganography
Image steganography is a technique in which user hides private data file within an image
file using various algorithms as mentioned in chapter 3.
In our project, Image Steganography application takes any type of images as input which
acts as media file and text file which acts as data file.
Output image will be in Bitmap (.bmp) format.
2. Audio Steganography
In this type of steganography, user hides private data file within an audio file which is
mainly in wave format and output will be also in wave format.
3. Video Steganography
In video steganography, user hides his/her data file within a video file which is in AVI
format.
We will implement Image and Audio steganography using existing algorithms, but we will
propose a new technique/algorithm for video steganography.

Steganography

Image Steganography

In Image Steganography, User hides his/her private data file into an image file using some
encryption algorithms mentioned below:
There are lots of algorithms available for Image Steganography. Most popular among them are
LSB (Least Significant Bit) and Spread Spectrum.

LSB (Least Significant Bit) Algorithm in Bitmap:


The LSB (least significant bit is the 8th bit that can be flipped from 0 to 1 or from 1 to 0
without any significant change in the total value. This means that the value will be only
affected by only 1.
This means that the image will not be significantly affected when we reserve this bit for our
purpose. If we change the most significant bit (MSB), then the value will be affected by 228.
User can load any type of image as input, but output will be in bitmap (.bmp) format, so any
other user will not be able to manipulate that image.

Spread Spectrum:
The Spread Spectrum Image Steganography (SSIS) method is a data concealing or data
hiding secret communication steganography system in which digital imagery can be used as a
cover or carrier signal.
Spread spectrum enables us to hide a notable amount of information bits inside a digital
image securely so that it cannot be detected by an observer. The data/message can be
extracted with lowest error probability because of error control coding.
Furthermore, the original image is not required to recover the concealed/hidden text. The
proposed receiver possesses a key in order to extract the secret message. The presence of the
concealed message is practically undetectable by human or computer.

Steganography

3.1 Literature survey


Following table shows the comparison between both the two algorithms:
Table [3.1] Comparison of LSB and Spread Spectrum

Invisibility
Payload Capacity
Robustness against image manipulation

LSB
In Bitmap

Spread
Spectrum

High

High

High

Low

Medium

Medium

By looking at the above table, we can get the idea about which algorithms to use for our project.
Invisibility of hidden data in both the algorithms is equal, that means if we hide our data using
any of the above algorithms than it will not be visible through naked eye, until and unless any
one has idea about steganalysis.
When we compare both algorithms on the basis of payload capacity then there is a huge different
between both of them. User can hide large amount of data using LSB but user can only hide
limited amount of data if he/she decides to use spread spectrum algorithm.
We can conclude that use of LSB algorithm for Image Steganography is secure way to save or
transmit our private data/message compare to spread spectrum algorithm. So we will use LSB
algorithm for our project purpose.

Steganography

3.2 LSB (Least Significant Bit)


The LSB (least significant bit is the 8th bit that can be flipped from 0 to 1 or from 1 to 0 without
any significant change in the total value. This means that the value will be only affected by only
1.

Fig [3.1] Example of LSB (Least Significant Bit)


Consider the above example, when we flip the LSB, the value will be affected by only 1. That
means 100 becomes 101. This means that the image will not be significantly affected when we
reserve this bit for our purpose.
Where the most significant bit MSB is bit on the leftmost, that when flipped, the value will be
affected by 128 to be 229 instead of 101.
Least significant bit (LSB) Replacement is a commonoly used method for cancealing
confidential data in a carrier image. The LSB of cover images bytes is replaced with a bit of the
hidden message.
When using a 24-bit image for steganography, a bit of each of the R, G, B color can be used,
since each of them can be represented by a byte.

10

Steganography

That is one can store 3 bits in each pixel. The image of 800 X 600 pixels, so it can store a total
amount of 1,440,000 bits or 180,000 bytes of embedded data [10].
For example, 3 pixels grid of a 24-bit image can be represented as follows:
(00101101 00011100 11011101)
(10100111 11000101 00001101)
(11010010 10101101 01100011)
When a number 500, which is decimal representation of 11110100, is planted into the LSB then
it will look like:
The resulting grid is as follows:
(00101101 00011101 11011101)
(10100111 11000100 00001101)
(11010010 10101100 01100011)
In our project, first we will convert media file and data file uploaded by the user/sender into
binary representation.
Then we will apply LSB algorithm, in which each least bit (right most bit/8th bit) of binary media
file is replaced by the single bit of binary data file and then from modified binary representation
of media file, a new encrypted media file is generated.
In extraction process, Encrypted media file is converted into binary representation then all least
bit of binary encrypted media file will be copied and using these bits, the original data file is
generated[4].

11

Steganography

Requirements

4.1 Functional Requirements:


Functional requirements of our project are as follows:

Media/Carrier File:
This file acts as a carrier file for our data. We can share this file after encrypting or hiding
our data within it.

Data File:
This is the file or data which we want to hide in our carrier file. We can securely send this
file by hiding or embedding it into other media file.

Encryption Algorithm:
This is the algorithm or lines of codes which we can apply to encrypt or to hide our data
within a selected media file.
After encryption, we will get an encrypted media file as an output. We can save or share this
output.
When the intended user receives the encrypted media file, then he/she requires following in
order to retrieve the original message:

Decryption Algorithm:
This is required to decrypt or to extract the original data file from received or saved
encrypted media file.
User then can save this original message or data to particular location on his/her computer.

System Requirements:
Operating System: Microsoft Windows XP or Above
RAM: 512 MB
Tool: Microsoft Visual Studio 2010 Professional

12

Steganography

4.2 Non-functional Requirements


Nonfunctional requirements of our system are as follow:
Performance:
The output media should not contain any distortion and application should be secure to statistical
and comparison steganalysis.
Reliability:
The product should not crash under any circumstances such as user trying to enter invalid values
or unsupported files. It should provide appropriate message for the same.
Portability:
Product should be able to run on any windows based operating system. User only needs to
install/extract necessary files that are required to run the application.

13

Steganography

Implementation

As mentioned in topic [3.2], Steganography can be performed by substituting bits of unused data
of commonly used computer files with bits of our important data. In our case, our data will be the
plain text that we need to hide, and the unused data is the least significant bits LSBs in the
image pixels.

5.1 Hiding text inside the image:

Get the Red, Green and Blue values separated each in a separate integer through the
entire image.
For each of Red, Green, and Blue values, make the 8th (least significant bit) equals to 0,
so that it be used to hide the characters of our data.
Convert the current to integer. Then hide its first 8 bits in R1, G1, B1, R2, G2, B2, R3,
G3, where the numbers refer to the numbers of the pixels. In each LSB of these elements
from R1 to G3, hide the bits of the character consecutively.
When all the 8 bits of the character are hidden, go to the next character, and reiterate the
same process until the whole data or text is hidden.
The text can be hidden in a tiny part of the image according to the length of that text. So,
there must be some indicator to indicate the end of the text. The indicator can be 8
successive zeros. This will be helpful when recovering or extracting the private data or
text from the stego image.
for (int i = 0; i < bmp.Height; i++)
{
for (int j = 0; j < bmp.Width; j++)
{
Color pixel = bmp.GetPixel(j, i);
R = pixel.R - pixel.R % 2;
G = pixel.G - pixel.G % 2;
B = pixel.B - pixel.B % 2;
for (int n = 0; n < 3; n++)
{
if (pixelElementIndex % 8 == 0)
{
if (state == State.Filling_With_Zeros && zeros == 8)
{
if ((pixelElementIndex - 1) % 3 < 2)
{
bmp.SetPixel(j, i, Color.FromArgb(R, G, B));
}
return bmp;
}
if (charIndex >= text.Length)
{
state = State.Filling_With_Zeros;

14

Steganography
}
else
{
charValue = text[charIndex++];
}
}
switch (pixelElementIndex % 3)
{
case 0:
{
if (state == State.Hiding)
{
R += charValue % 2;
charValue /= 2;
}
} break;
case 1:
{
if (state == State.Hiding)
{
G += charValue % 2;
charValue /= 2;
}
} break;
case 2:
{
if (state == State.Hiding)
{
B += charValue % 2;
charValue /= 2;
}
bmp.SetPixel(j, i, Color.FromArgb(R, G, B));
} break;
}
pixelElementIndex++;
if (state == State.Filling_With_Zeros)
{
zeros++;
}
}
}
}

15

Steganography

5.2 Extracting the text from the image:


It's very simple process than hiding. We just have to pass through the pixels of the image until
you reach to 8 successive zeros. As you are passing, collect the data from the 8th position (LSB)
from each R, G, B pixel element and tie it into an vacant or empty value. When all the 8 bits of
this value are tied, convert it to character, then attach that character to your desired result text.
for (int i = 0; i < bmp.Height; i++)
{
for (int j = 0; j < bmp.Width; j++)
{
Color pixel = bmp.GetPixel(j, i);
for (int n = 0; n < 3; n++)
{
switch (colorUnitIndex % 3)
{
case 0:
{
charValue = charValue * 2 + pixel.R % 2;
} break;
case 1:
{
charValue = charValue * 2 + pixel.G % 2;
} break;
case 2:
{
charValue = charValue * 2 + pixel.B % 2;
} break;
}
colorUnitIndex++;
if (colorUnitIndex % 8 == 0)
{
charValue = reverseBits(charValue);
if (charValue == 0)
{
return extractedText;
}
char c = (char)charValue;
extractedText += c.ToString();
}
}
}
}

16

Steganography

5.3 Steps for hiding and extraction:


Following are the steps that you can apply to work with developed tool.

Steps for Hiding:

Fig [5.2] Hiding process of Image Steganography


1. Open image: File Open Image.
2. Open text: File Open Text.
3. Rather than opening a text file, you can directly copy-paste or just write the data into
textbox as shown in above picture.
4. If you want to encrypt your data, then just tick the checkbox and provide a password of
minimum 6 digit length.
5. Now, when you click on Hide, your output will be generated. You have to manualy
save the image as: File Save Image. (shown in below picture)
Note: Remember the password, otherwise you will not be able to retrieve your data.

17

Steganography

Steps for Extraction:

Fig [5.3] Extraction process of Image Steganography


1. If you want to extract the data from the stego image then open the stego file as:
2. File Open Image.
3. Now if you have encrypted your data while hiding, then this time also you need to tick
that check box.
4. Provide the same password which you have entered while hiding process in the password
field.
5. Then click on Extract.
6. When you click, data will be shown in the text box. You can save your data as:
7. File Save Text.

18

Steganography

Diagrams

6.1 Activity Diagram:

Fig [6.1] Activity Diagram

19

Steganography

6.2 Class Diagram:

Fig [6.2] Class Diagram

6.3 Sequence Diagram:

Fig [6.3] Sequence Diagram

20

Steganography

6.4 Use Case Diagram:

Fig [6.4] Use Case Diagram

21

Steganography

Future Work

Till now, we have completed image steganography with encryption and decryption of data. We
also completed patent search and canvas development for this semester.
We are remaining with following two modules:
1. Audio Steganography
2. Video Steganography
In future, we will search for different algorithms and research papers related to audio
steganography and video steganography.
We will study that algorithms and research papers and we will use it to implement both the
remaining steganography techniques (audio steganography, video steganography) in C#.NET
using visual studio 2010.

22

Steganography

References:

[1] www.creately.com
[2] www.wikipedia.org/wiki/Steganography
[3] www.github.com/Digiex/MCLauncher.NET/blob/master/MCLauncher.net/Crypto.cs
[4] Comparison of different techniques for Steganography in images volume 3 Issue 2 February
2014 by Mr. Falesh M. Shelke, Miss. Ashwini A. Dongre and Mr. Pravin D. Soni, International Journal of
Application or Innovation in Engineering & Management (IJAIEM)( ISSN 2319 - 4847)

23