Professional Documents
Culture Documents
Image and Audio Steganography: Submitted by
Image and Audio Steganography: Submitted by
SUBMITTED BY
[Student Name]
[Seat No.]
DATE OF SUBMISSION
98
INSTITUTE OF DISTANCE AND OPEN LEARNING
PROJECT CERTIFICATE
Signature Signature
Signature
Faculty in Charge External Examiner Coordinator – M.C.A
(IDOL)
Guided By Examined By Certified By
Acknowledgement
It has indeed been a great privilege for me to have Mr. Lionel Faleiro, Department of
Computer Science, I.D.O.L., University of Mumbai, as my mentor for this project.
His guidance and constant encouragement are the motive force behind this project work. I
take this opportunity to express my utmost gratitude to him. I am also indebted to him for
his timely and valuable advice.
Synopsis
on
Steganography is the practice of hiding private or sensitive information within something that
appears to be nothing out to the usual. Steganography is often
confused with cryptology because the two are similar in the way that they both are used to
protect important information. The difference between two is that steganography involves
hiding information so it appears that no information is hidden at all. If a person or persons
views the object that the information is hidden inside of he or she will have no idea that there
is any hidden information, therefore the person will not attempt to decrypt the information.
What steganography essentially does is exploit human perception, human senses are not
trained to look for files that have information inside of them, although this software is
available that can do what is called Steganography. The most common use of steganography is
to hide a file inside another file.
Through out history Steganography has been used to secretly communicate information
between people.
1. During World War 2 invisible ink was used to write information on pieces of paper
so that the paper appeared to the average person as just being blank pieces of
paper. Liquids such as milk, vinegar and fruit juices were used, because when each
one of these substances are heated they darken and become visible to the human
eye.
2. In Ancient Greece they used to select messengers and shave their head, they would
then write a message on their head. Once the message had been written the hair was
allowed to grow back. After the hair grew back the messenger was sent to deliver the
message, the recipient would shave off the messengers hair to see the secrete message.
Now in today’s electronic world the message is sent over E media. So there should be
a necessity of new steganography technique which will defend against interception
attack.
This technique is chosen, because this system includes not only imperceptibility but also un-
delectability by any steganolysis tool.
Objective:-
• Requirement of this steganography system is that the hider message carried by stego-
media should not be sensible to human beings.
This approach of information hiding technique has recently become important in a number of
application areas
Project Scope:
• The scope of the project is to limit unauthorized access and provide better security
during message transmission. To meet the requirements, I use the simple and
basic approach of steganography.
• In this project, the proposed approach finds the suitable algorithm for embedding the
data in an image / audio using steganography which provides the better security
pattern for sending messages through a network.
Methodology:
User needs to run the application. The user has two tab options – encrypt and decrypt. If user
select encrypt, application give the screen to select image file, information file and option to
save the image file. If user select decrypt, application gives the screen to select only image file
and ask path where user want to save the secrete file.
In encryption the secrete information is hiding in with any type of image file.Decryption is
getting the secrete information from image file. We will make use of LSB algorithm for this
process.
LSB Algorithm:
• LSB (Least Significant Bit) substitution is the process of adjusting the least
significant bit pixels of the carrier image.
• For an 8 bit image, the least significant bit i.e., the 8th bit of each byte of the image
is changed to the bit of secret message.
• For 24 bit image, the colors of each component like RGB (red, green and blue) are
changed.
a. LSB Coding
b. Phase Coding
c. Parity Coding
d. Spread Sprectrum
Encryption Process
BMP FILE
Decryption Process
BMP FILE
This project has an assumption that is both the sender and receiver must have shared some
secret information before imprisonment. Pure steganography means that there is none prior
information shared by two communication parties.
• Security is an important issue while transferring the data using internet because any
unauthorized individual can hack the data and make it useless or obtain information un-
intended to him.
Software Environment
Operating System : Window XP
Development Environment : MS Visual Studio .Net Framework 4.5
Languages : C#.Net
Hardware Environment
Processor : Intel® Core™ i3-4005U CPU
@ 1.70 GHz
RAM : 8 GB
Hard Disk : 250 GB
Mother Board : Intel chipset board
Mouse : Logitech optical mouse
Conclusion:-
Steganography is a really interesting subject and outside of the mainstream cryptography and
system administration that most of us deal with day after day.
Steganography can be used for hidden communication. We have explored the limits of
steganography theory and practice. We printed out the enhancement of the image
steganography system using LSB approach to provide a means of secure communication. A
stego-key has been applied to the system during embedment of the message into the cover
image.
This steganography application software provided for the purpose to how to use any type of
image formats to hiding any type of files inside their. The master work of this application is in
supporting any type of pictures without need to convert to bitmap, and lower limitation on file
size to hide, because of using maximum memory space in pictures to hide the file.
Bibliography
Websites
Following websites are referring to create this project reports.
http://www.asp.net
http://www.asp123.com
http://www.wikipedia.org
Books
Following books and ebook are used to complete this project reports.
Mastering C# (Paperback)
.NET Black Book (Paperback)
Professional C#, 2nd Edition (Paperback)
Professional ASP.NET (Paperback)
MCAD/MCSD Self-Paced Training Kit: Developing Web Applications with
Microsoft® Visual Basic® .NET and Microsoft Visual C#® .NET, Second Edition
Index
6. System Implementation
7. System Maintenance
Annexure
1. References
Bibliography
Websites
2. Keywords
Objective and Scope of the Project
Objective
The objective of steganography is covert communication. So, a fundamental requirement of this
steganography system is that the hider message carried by stego-media should not be sensible to
human beings.
The other objective of steganography is to avoid drawing suspicion to the existence of a hidden
message. This approach of information hiding technique has recently became important in a number of
application area
Steganography sometimes is used when encryption is not permitted. Or, more commonly,
steganography is used to supplement encryption. An encrypted file may still hide information using
steganography, so even if the encrypted file is deciphered, the hidden message is not seen
Scope of Steganography
Steganography is a very interesting and advantageous science these days and has following
uses:
Digital Watermarking
To protect a copyright on information. Photo collections, sold on CD, often have hidden
messages in the photos which allow detection of unauthorized use. The same technique
applied to DVDs is even more effective, since the industry builds DVD recorders to detect and
disallow copying of protected DVDs.
The simplest and oldest are used in map making, where cartographers sometimes add
a tiny fictional street to their maps, allowing them to prosecute copycats.
A similar trick is to add fictional names to mailing lists as a check against
unauthorized resellers.
Steganography doesn't just apply to written forms of communication. Radio and TV
messages, from World War II to today, can be used to hide coded or hidden messages.
Some government sources suspect that Osama bin Laden's pre- recorded videos that are
re-played on TV stations around the world contain hidden messages.
Even biological data, stored on DNA, may be a candidate for hidden messages, as
biotech companies seek to prevent unauthorized use of their genetically engineered
material. The technology is already in place for this: three New York researchers
successfully hid a secret message in a DNA sequence and sent it across the country.
The word steganography comes from the Greek “Seganos”, which mean covered or secret and –
“graphy” mean writing or drawing. Therefore, steganography mean, literally, covered writing. It
is the art and science of hiding information such its presence cannot be detected and a
communication is happening. A secrete information is encoding in a manner such that the very
existence of the information is concealed. Paired with existing communication methods,
steganography can be used to carry out hidden exchanges.
The main goal of this projects it to communicate securely in a completely undetectable manner
and to avoid drawing suspicion to the transmission of a hider data. There has been a rapid growth
of interest in steganography for two reasons:
The publishing and broadcasting industries have become interested in techniques for hiding
encrypted copyright marks and serial numbers in digital films, audio recordings, books and
multimedia products
Moves by various governments to restrict the availability of encryption services have motivated
people to study methods by which private messages can be embedded in seemingly innocuous
cover messages.
The basic model of steganography consists of Carrier, Message and password. Carrier is also
known as cover-object, which the message is embedded and serves to hide the presence of the
message.
Basically, the model for steganography is shown on following figure:
Cover-object, C
F(X,M,K)
Stego-key, K
Message is the data that the sender wishes to remain it confidential. It can be plain text,
ciphertext, other image, or anything that can be embedded in a bit stream such as a copyright
mark, a covert communication, or a serial number. Password is known as stego-key, which
ensures that only recipient who know the corresponding decoding key will be able to extract the
message from a cover-object. The cover-object with the secretly embedded message is then
called the Stego-object.
Recovering message from a stego-object requires the cover-object itselt and a corresponding
decoding key if a stego-key was used during the encoding process. The original image may or
may not be required in most applications to extract the message.
Audio that using digital audio formats such as wav, midi, avi, mpeg, mpi and
voc
File and Disk that can hides and append files by using the slack space
Text such as null characters, just alike morse code including html and java
Images file such as bmp, gif and jpg, where they can be both color and gray-scale.
In general, the information hiding process extracts redundant bits from cover-object. The
process consists of two steps:
Embedding process then selects the subset of the redundant bits to be replaced
with data from a secret message. The stego-object is created by replacing the
selected redundant bits with message bits.
Steganography vs Cryptography:
It is possible to combine the techniques by encrypting message using cryptography and then
hiding the encrypted message using steganography. The resulting stego-image can be
transmitted without revealing that secret information is being exchanged.
.S
Functions
( built in C
THEORETICAL BACKGROUND
When using 8-bit color, there is a definition of up to 256 colors forming a palette for this
image, each color denoted by an 8-bit value.
A 24-bit color scheme, as the term suggests, uses 24 bits per pixel and provides a much
better set of colors. In this case, each pixel is represented by three bytes, each byte representing
the intensity of the three primary colors red, green, and blue (RGB), respectively. The color
orange, for example, would be displayed with red set to 100% , green set to 50% and no blue .
The size of an image file, then, is directly related to the number of pixels
and the granularity of the color definition. A typical 640x480 pix image using a palette of
256 colors would require a file about 307 KB in size (640 • 480 bytes), whereas a 1024x768 pix
high-resolution 24-bit color image would result in a 2.36 MB file (1024 • 768 • 3 bytes).
To avoid sending files of this enormous size, a number of compression schemes have been
developed over time, notably Bitmap (BMP), Graphic Interchange Format (GIF), and
Joint Photographic Experts Group (JPEG) file types. Not all are equally suited to
steganography, however.
GIF and 8-bit BMP files employ what is known as lossless compression, a scheme that allows
the software to exactly reconstruct the original image. JPEG, on the other hand, uses lossy
compression, which means that the expanded image is very nearly the same as the original but not
an exact duplicate. Lossless compression is much better suited to applications where the integrity of
the original information must be maintained, such as steganography. While JPEG can be used for
stego applications, it is more common to embed data in GIF or BMP files.
The simplest approach to hiding data within an image file is called Least Significant
Bit (LSB) insertion. In this method, we can take the binary representation of the hidden_data
and overwrite the LSB of each byte within the cover_image. If we are using 24-bit color, the
amount of change will be minimal and indiscernible to the human eye. As an example, suppose
that we have three adjacent pixels (nine bytes) with the following RGB encoding:
Now suppose we want to "hide" the following 9 bits of data (the hidden data is usually
compressed prior to being hidden): 101101101. If we overlay these 9 bits over the LSB of the 9
bytes above, we get the following (where bits in bold have been changed):
Note that we have successfully hidden 9 bits but at a cost of only changing 4, or roughly
50%, of the LSBs.
A 640x480 pixel image, the size of a small computer monitor, can hold over 400,000
characters. That's a whole novel hidden in one modest photo! This poject involves following
formats of images:
File Header
Data Size(Bytes)
File Type(BM in case of BMP files) 2
File Size 4
Reserved Byte(Always 0) 1
Reserved Byte(Always 0) 1
Bf of Bits
Size of Info Header 4
Width of Bitmap 2
Height of Bitmap 2
No of planes(1 for BMP) 1
Bit Count(Bits/Pixel, Must be 1, 4, 8, 24) 1
Type of Compression used(none) 2
Size of Image Data in Bytes 2
Horizontal Resolution in Pixels/Meter 2
Vertical Resolution in Pixels/Meter 2
No of Color’s Indexes Used 2
Important Color Indexes 2
Data Size(Bytes)
R(Red) 1
B(Blue) 1
G(Green) 1
Reserved Word for RGB 1
ANALYSIS OF DIGITAL AUDIO
Digital audio differs from traditional analog sound in that it is a discrete rather than continuous
signal. A discrete signal is created by sampling a continuous analog signal at a specified rate. For
example, the standard sampling rate for CD digital audio is about 44kHz. The following figure
illustrates a continuous analog sound wave being sampled to produce digital audio. Note the
sinusoidal nature of a sound wave.
We emphasize the discrete nature of a digital signal in the diagram. However, standard sampling rates
are usually set at a level where the resultant digital signal is visually indistinguishable from the original
analog signal.
Digital audio is stored on a computer as a sequence of 0's and 1's. With the right
tools, it is possible to change the individual bits that make up a digital audio file. Such precise
control allows changes to be made to the binary sequence that are not discernible to the human
ear. The secret message is embedded by slightly altering the binary sequence of a sound file.
The key innovation in recent years was to choose an innocent looking cover that contains plenty
of random information, called white noise. You can hear white noise as a the nearly silent hiss of
a blank tape playing. The secret message replaces the white noise, and if done properly it will
appear to be as random as the noise was. Thus the basic design principle of steganographic
systems is “replacing high entropy noise with a high entropy secret transmission” .
Wave File Format
Wave Header
Data Size(Bytes)
Header Name(RIFF) 4
File Size 4
Format Name(wave) 4
Key Word(fmt) 4
Channels(Mono = 1, Stereo = 2) 1
Frequency 4
Blank(Less Important Data) 6
Bit Resolution 1
Blank(Less Important Data) 12
Wave Data
Data Size(Bytes)
Sound Length 1
Frequency 1
Sample Data Rest Of Wave File
Definition of the Problem
The former consists of linguistic or language forms of hidden writing. The later, such as invisible
ink, try of hide messages physically. One disadvantage of linguistic steganography is that users
must equip themselves to have a good knowledge of linguistry. In recent years, everything is
trending toward digitization. And with the development of the internet technology, digital media
can be transmitted conveniently over the network. Therefore, messages can be secretly carried by
digital media by using the steganography techniques, and then be transmitted through the internet
rapidly
Steganography is the art of hiding the fact that communication is taking place, by hiding
information in other information. Many different carrier file formats can be used, but digital
images are the most popular because of their frequency on the internet. For hiding secret
information in images, there exists a large variety of steganography techniques some are more
complex than others and all of them have respective strong and weak points.
So we prepare this application, to make the information hiding more simple and user
friendly.
System Analysis and Design
System Analysis
Existing System:
Now a days, several methods are used for communicating confidential messages for
defense purposes or in order to ensure the privacy of communication between two parties. So we
go for hiding information in ways that prevent its detection.
Some of the methods used for privacy communication are the use of invisible links; covert
channels are some of existing systems that are used to convey the messages.
Since at present everything is done manually, it is having a lot of drawbacks. The major
Drawback of the present system is the bulk amount of physical volume of the data making
information search and retrieval is tedious Process. There are chances for damage of papers
containing information. So this process is time consuming process.
Drawbacks:
• Increased time
• Low accuracy
• Increased uncertainty
Proposed System:
The proposed system uses Image file as a carrier medium which add another step in
security. The objective of the newly proposed system is to create a system that makes it very
difficult for an opponent to detect the existence of a secret message by encoding carrier medium as
a function of some secret key and that remains as the advantage of this system.
This system have several advantages over the existing system. They are
The feasibility of the project is analyzed in this phase and business proposal is set forth
with a very general plan for the project and some cost estimates. During system analysis the
feasibility study of the proposed system is to be carried out. This is to ensure that the proposed
system is not a burden to the company. For feasibility analysis, some understanding of the major
requirements for the system is essential.
1. Economical feasibility
2. Technical feasibility
3. Social feasibility
1. Economical feasibility:
This study is carried out to check the economic impact for the system will have on the
organization. The amount of fund that the company can pour into the research and development
of the system is limited. The expenditures must be justified. Thus the developed system as well
within the budget and this was achieved ,because most of the technologies used are freely
available. Only the customized products had to be purchased.
2. Technical feasibility:
If study is carried out to check about the technical requirements of the system. Any system
developed must not have a high demand on the available technical resources. This will lead to
high demands on the available technical resources. This will lead to high demands being placed on
the client. The developed system must have a modern requirement, as only minimal or null
changes are required for implementing this system.
3. Social feasibility:
The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not feel
threatened by the system, instead must accept as a necessity. The level of acceptance by the users
solely depends on the methods that are employed to educate the user about the system and to make
him familiar with it. His level of confidence must be raised ,so that also able to make some
constructive criticism, as he is the final user of the system.
CONTEXT DIAGRAM
PLAIN TEXT OR
COVER MEDIUM TEXT FILE STEGNO
KEY
(Image or Audio File) (Text to be Hidden)
STEGNO-ENCODING
TOOL
STEGNO
MEDIUM
STEGNO-DECODING
TOOL
HIDDEN TEXT
DATA FLOW
DIAGRAM ENCODING
STEGNO
PLAIN
TEXT KEY
Vigenere
Cipher
Arithmetic
Encripted coding
Text
Conversion
into ASCII
form Key
Conversion Information
into 8-bit
form
Bit
Stream
STEGNO
MEDIUM
DECODING
Arithmetic
STEGNO Key
KEY coding
Information
Bit Stream of
Hidden Text
Conversion into
8-bit
form Conversion
into ASCII
Form
Vigenere Encripted
Cipher Text
ORIGINAL
TEXT
ALGORITHMS
ENCODING
Least significant bit (LSB) coding is the simplest way to embed information in a digital Image or
Audio file. By substituting the least significant bit of each sampling point in Audio and each pixel in
Image with a binary message, LSB coding allows for a large amount of data to be encoded.
The following diagram illustrates how the message 'HEY' is encoded in a 16-bit CD quality sample
using the LSB method:
In LSB coding, the ideal data transmission rate is 1 kbps per 1 kHZ.
ALGORITHM FOR ENCODING
int h=1;
for(int i=0;i<8n;i++)
If (m%3==1) C=R;
If (m%3==1) C=G;
If (m%3==1) C=B
Least significant digit of C value of (g+x)x(h+y) th pixel =
Bit_stream[i];
g = g+x; h = h+y;
for(int i=0;i<8n;i++)
If (Bit_stream[i]==1) audio_stream[i]=audio_stream[i] OR
“00000001”;
}
ALGORITHM FOR DECODING
int h=0;
g=g+x;
h=h+y;
string Bit_stream;
char C;
If (i%3==1) C=R;
If (i%3==1) C=G;
If (i%3==1) C=B;
}
// from Audio file
STEP 2. //read stegno audio
string ciphertext ;
Key: LEMONLEMONLE
The person sending the message chooses a keyword and repeats it until
it matches the length of the plaintext, for example, the keyword
"LEMON" makes: Key: LEMONLEMON
Software & Hardware Environment
Software Environment
Operating System : Window XP
Development Environment : MS Visual
Studio .Net Framework 4.5
Languages : C#.Net
Hardware Environment
Processor : Intel®
Core™ i3-4005U CPU @ 1.70 GHz
RAM : 8 GB
Hard Disk : 250 GB
Mother Board : Intel
chipset board
Mouse : Logitech
optical mouse
Key Board : 104 keys
keyboard
What is .Net?
• Cross-language debugging
• XCOPY deployment
You might expect all those features, but this has never been possible
using Microsoft development tools. Figure shows where the common
language runtime fits into the .NET Framework.
Note
Code written using a .NET language is known as managed code. Code that
uses anything but the common language runtime is
known as unmanaged code. The common language runtime provides a
managed execution environment for .NET code, whereas the individual
runtimes of non-.NET languages provide an unmanaged execution
environment.
Note
Each assembly has one and only one assembly manifest, and it
contains all the description information for the assembly. However, the
assembly manifest can be contained in its own file or within one of the
assembly’s modules.
The .NET Framework base class library contains the base classes
that provide many of the services and objects you need when writing
your applications. The class library is organized into namespaces. A
namespace is a logical grouping of types that
perform related functions. Namespaces are logical groupings of related
classes. The namespaces in the .NET base class library are organized
hierarchically. The root of the .NET Framework is the system
namespace. Other namespaces can be accessed with the period operator.
A typical namespace construction appears as follows:
System
System.Data
System.Data.SQLClient
.Net Namespaces
Table 1-1. Representative .NET Namespaces
Namespace Description
System
This namespace is the root for many of
the low-level types required by
the .NET Framework. It is the root for
primitive data types as well, and it is the
root for all the other namespaces in the
.NET base class library.
Namespace Description
Namespace Description
' Instantiates a new Widget object and assigns it to the myWidget '
variable
Object Models
Simple objects might consist of only a few properties, methods,
and perhaps an event or two. More complex objects might require
numerous properties and methods and possibly even secondary
objects. Objects can contain and expose other objects as members.
Encapsulation
Encapsulation is the concept that implementation of an object
is independent of its interface. Put another way, an application
interacts with an object through its interface, which consists of its
public properties and methods. As long as this interface remains
constant, the application can continue to interact with the component,
even if implementation of the interface was completely rewritten
between versions.
Polymorphism
Polymorphism is the ability of different classes to provide
different implementations of the same public interfaces. In other words,
polymorphism allows methods and properties of an object to be called
without regard for the particular implementation of those members.
There are two principal ways through which polymorphism can be
provided: interface polymorphism and inheritance polymorphism.
Interface Polymorphism
An interface is a contract for behavior, it defines the members a
class should implement, but states nothing at all about the details of that
implementation. An object can implement many different interfaces,
and many diverse classes can implement the same interface. All objects
implementing the same interface are capable of interacting with other
objects through that interface.
Inheritance Polymorphism
Inheritance allows you to incorporate the functionality of a
previously defined class into a new class and implement different
members as needed. A class that inherits another class is said to derive
from that class, or to inherit from that class. A class can directly inherit
from only one class, which is called the base class. The new class has
the same members as the base class, and additional members can be
added as needed.
Additionally, the implementation of base members can be changed in
the new class by overriding the base class implementation. Inherited
classes retain all the characteristics of the base class and can interact
with other objects as though they were instances of the base class.
FUNCTIONS
private void generate_bincodes()
It is used to convert the string into binary codes or bit stream.This function
uses the class stack to perform this task.
It is used to decrypt the text which is generated from the stegno medium.
Implementation Procedures
Implementation means converting older system to a new design in
operation. This involves creating computer capable files and basic software
needed to run this system. The basic concept for implementation needed is
software installation and system requirements. So in order to implement
them, suitable hardware and software must be available. Then the database
must be created in the
computer without changing the database names which are used in the table
design.
Now the computer is ready for implementing the proposed system.
There are three types of implementation.
Implementation of a new computer system to replace a
manual one.
Implementation of a new computer system to replace an
existing one.
Implementation a modified application to replace an
existing one.
User Training
Planning for user acceptance testing calls for the analyst and the user to
agree on the condition for the test. Many of these conditions may be
derived from the test plan. Others are an agreement on the test schedule,
the test duration and the test should be specified in advance.
The training plan is followed by preparation of the user training manual and
other text materials. Facility requirements and the necessary hardware are
specified and documented. A common procedure is to train supervisors and
heads who, in turn train their staff as they fit.
Operational Documentation
In operational document, the general idea is about explaining different
module of this project. The detail explanation of this operational document is
to know the form infrastructure. There are different forms that have different
features, when it is selected then this displays the particular detail about the
particular contents. The content will display all the details about the fields. In
the particular form we can add, edit, delete and update can be made. Each
form displays the particular module to perform this operation.
System Maintenance
System Testing
Testing is the process of executing the program with the intent of
finding errors. During testing, the program to be tested and executed
with a set of test cases and the output of the program for the test cases is
evaluated to determine the program is performing as it is expected.
Error is the testing fundamental and is defined as the difference between
the actual output of a software and a correct output i.e., difference
between the actual and ideal testing is usually relied upon to detect these
faults in the coding phase for this, different levels of testing are used
which performs different tasks and aim to the test different aspects of
the system.
Goals of Testing:
The famous statement by Dijkstra (in Dahl et al. 1972) is a
perfect synthesis of the goals of the testing. If the results delivered by
the system are different from the expected ones in just one case, in this
unequally shows that the system is incorrect: by contrast, a correct
behavior of the system on a finite number of cases does not guarantee
correctness in the general case. For instance, we could have built a
program that behaves properly for even integer numbers but not odd
numbers. Clearly, any number of tests with even input values will face
to show the error.
Testing Methodologies:
Unit Testing
Integration Testing
The goal here is to see if the modules can be integrated properly,
the emphasis being on testing interfaces between modules. After
structural testing and functional testing we get error free modules these
modules are to be integrated to get the required results of the system.
After checking the module another module is tested and is integrated
with the previous module.
After the integration the test phases are generated and the results are
tested.
System Testing
The system was tested for various test cases with various inputs.
Validation Testing
In this testing the software is tested to determine whether it
suits to that particular environment. Validation testing provides the final
assurance that the software meets all functional, behavioral and
performance requirements. Validation refers to the process of using the
software in a live environment to find errors. During the course of
validation the system failure may occur and software will be changed.
Tested all the fields whether accepting the valid input or not.
Acceptance Testing
It is sometimes performed with realistic data of the client to
demonstrate that the software is working satisfactorily. Testing here
focus on the external behavior of the system, the internal logic of the
program is not emphasized.
Source Code
Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Steganography
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Steganography ());
}
}
}
Steganography.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace Steganography
{
public partial class Steganography : Form
{
private Bitmap bmp = null;
private string extractedText = string.Empty;
public Steganography()
{
InitializeComponent();
}
if (text.Equals(""))
{
MessageBox.Show("The text you want to hide can't be empty",
"Warning");
return;
}
if (encryptCheckBox.Checked)
{
if (passwordTextBox.Text.Length < 6)
{
MessageBox.Show("Please enter a password with at least 6
characters", "Warning");
return;
}
else
{
text = Crypto.EncryptStringAES(text, passwordTextBox.Text);
}
}
if (encryptCheckBox.Checked)
{
try
{
extractedText = Crypto.DecryptStringAES(extractedText,
passwordTextBox.Text);
}
catch
{
MessageBox.Show("Wrong password", "Error");
return;
}
}
dataTextBox.Text = extractedText;
}
if (open_dialog.ShowDialog() == DialogResult.OK)
{
imagePictureBox.Image =
Image.FromFile(open_dialog.FileName);
}
}
private void imageToolStripMenuItem_Click(object sender,
EventArgs e)
{
SaveFileDialog save_dialog = new SaveFileDialog();
save_dialog.Filter = "Png Image|*.png|Bitmap Image|*.bmp";
if (save_dialog.ShowDialog() == DialogResult.OK)
{
switch (save_dialog.FilterIndex)
{
case 0:
{
bmp.Save(save_dialog.FileName, ImageFormat.Png);
}break;
case 1:
{
bmp.Save(save_dialog.FileName, ImageFormat.Bmp);
} break;
}
notesLabel.Text = "Notes:";
notesLabel.ForeColor = Color.Black;
}
}
if (save_dialog.ShowDialog() == DialogResult.OK)
{
File.WriteAllText(save_dialog.FileName, dataTextBox.Text);
}
}
if (open_dialog.ShowDialog() == DialogResult.OK)
{
dataTextBox.Text = File.ReadAllText(open_dialog.FileName);
}
}
}
private void groupBox2_Enter(object sender, EventArgs e)
{
}
}
}
Steganography.Designer.cs
namespace Steganography
{
partial class Steganography
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be
disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.hideButton = new System.Windows.Forms.Button();
this.dataTextBox = new System.Windows.Forms.TextBox();
this.extractButton = new System.Windows.Forms.Button();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem1 = new
System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem1 = new
System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.textToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new
System.Windows.Forms.ToolStripMenuItem();
this.encryptCheckBox = new System.Windows.Forms.CheckBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.notesLabel = new System.Windows.Forms.Label();
this.imagePictureBox = new System.Windows.Forms.PictureBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.menuStrip1.SuspendLayout();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)
(this.imagePictureBox)).BeginInit();
this.SuspendLayout();
//
// hideButton
//
this.hideButton.Font = new System.Drawing.Font("Microsoft Sans
Serif", 15F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.hideButton.Image =
global::Steganography.Properties.Resources.lock_icon 1_;
this.hideButton.Location = new System.Drawing.Point(720, 474);
this.hideButton.Margin = new
System.Windows.Forms.Padding(4);
this.hideButton.Name =
"hideButton";
this.hideButton.Size = new System.Drawing.Size(241, 53);
this.hideButton.TabIndex = 0;
this.hideButton.Text = "Hide";
this.hideButton.UseVisualStyleBackColor = true;
this.hideButton.Click += new
System.EventHandler(this.hideButton_Click);
//
// dataTextBox
//
this.dataTextBox.Font = new System.Drawing.Font("Tahoma",
12F);
this.dataTextBox.Location = new System.Drawing.Point(562,
107);
this.dataTextBox.Margin = new
System.Windows.Forms.Padding(4);
this.dataTextBox.Multiline = true;
this.dataTextBox.Name = "dataTextBox";
this.dataTextBox.ScrollBars =
System.Windows.Forms.ScrollBars.Vertical;
this.dataTextBox.Size = new System.Drawing.Size(528, 320);
this.dataTextBox.TabIndex = 2;
//
// extractButton
//
this.extractButton.Font = new System.Drawing.Font("Microsoft
Sans Serif", 15F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.extractButton.Image =
global::Steganography.Properties.Resources.unlock_icon 1_;
this.extractButton.Location = new System.Drawing.Point(720,
594);
this.extractButton.Margin = new
System.Windows.Forms.Padding(4);
this.extractButton.Name = "extractButton";
this.extractButton.Size = new System.Drawing.Size(241, 53);
this.extractButton.TabIndex = 3;
this.extractButton.Text = "Extract";
this.extractButton.UseVisualStyleBackColor = true;
this.extractButton.Click += new
System.EventHandler(this.extractButton_Click);
//
// menuStrip1
//
this.menuStrip1.ImageScalingSize = new
System.Drawing.Size(20, 20);
this.menuStrip1.Items.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.helpToolStripMenuItem})
;
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new
System.Windows.Forms.Padding(8, 2, 0, 2);
this.menuStrip1.Size = new System.Drawing.Size(1103, 28);
this.menuStrip1.TabIndex = 5;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.openToolStripMenuItem,
this.saveToolStripMenuItem});
this.fileToolStripMenuItem.Font = new
System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(44,
24);
this.fileToolStripMenuItem.Text = "File";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.imageToolStripMenuItem1,
this.textToolStripMenuItem1});
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new
System.Drawing.Size(114, 24);
this.openToolStripMenuItem.Text = "Open";
//
// imageToolStripMenuItem1
//
this.imageToolStripMenuItem1.Name =
"imageToolStripMenuItem1";
this.imageToolStripMenuItem1.Size = new
System.Drawing.Size(120, 24);
this.imageToolStripMenuItem1.Text = "Image";
this.imageToolStripMenuItem1.Click += new
System.EventHandler(this.imageToolStripMenuItem1_Click);
//
// textToolStripMenuItem1
//
this.textToolStripMenuItem1.Name = "textToolStripMenuItem1";
this.textToolStripMenuItem1.Size = new
System.Drawing.Size(120, 24);
this.textToolStripMenuItem1.Text = "Text";
this.textToolStripMenuItem1.Click += new
System.EventHandler(this.textToolStripMenuItem1_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.imageToolStripMenuItem,
this.textToolStripMenuItem});
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new
System.Drawing.Size(114, 24);
this.saveToolStripMenuItem.Text = "Save";
//
// imageToolStripMenuItem
//
this.imageToolStripMenuItem.Name = "imageToolStripMenuItem";
this.imageToolStripMenuItem.Size = new
System.Drawing.Size(120, 24);
this.imageToolStripMenuItem.Text = "Image";
this.imageToolStripMenuItem.Click += new
System.EventHandler(this.imageToolStripMenuItem_Click);
//
// textToolStripMenuItem
//
this.textToolStripMenuItem.Name = "textToolStripMenuItem";
this.textToolStripMenuItem.Size = new System.Drawing.Size(120,
24);
this.textToolStripMenuItem.Text =
"Text"; this.textToolStripMenuItem.Click
+= new
System.EventHandler(this.textToolStripMenuItem_Click);
//
// helpToolStripMenuItem
//
this.helpToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(53,
24);
this.helpToolStripMenuItem.Text = "Help";
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new
System.Drawing.Size(119, 24);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new
System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// encryptCheckBox
//
this.encryptCheckBox.AutoSize = true;
this.encryptCheckBox.Font = new
System.Drawing.Font("Microsoft Sans Serif", 12F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)
(0)));
this.encryptCheckBox.Location = new System.Drawing.Point(136,
45);
this.encryptCheckBox.Margin = new
System.Windows.Forms.Padding(4);
this.encryptCheckBox.Name = "encryptCheckBox";
this.encryptCheckBox.Size = new System.Drawing.Size(122, 27);
this.encryptCheckBox.TabIndex = 6;
this.encryptCheckBox.Text = "Encrypted";
this.encryptCheckBox.UseVisualStyleBackColor = true;
//
// passwordTextBox
//
this.passwordTextBox.Font = new
System.Drawing.Font("Microsoft Sans Serif", 12F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
this.passwordTextBox.Location = new System.Drawing.Point(136,
100);
this.passwordTextBox.Margin = new
System.Windows.Forms.Padding(4);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(229, 30);
this.passwordTextBox.TabIndex = 7;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans
Serif", 12F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(8, 103);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4,
0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(104, 25);
this.label1.TabIndex = 8;
this.label1.Text = "Password:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.passwordTextBox);
this.groupBox1.Controls.Add(this.encryptCheckBox);
this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans
Serif", 10.2F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox1.Location = new System.Drawing.Point(16, 474);
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new
System.Windows.Forms.Padding(4);
this.groupBox1.Size = new System.Drawing.Size(499, 173);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Do you want
Encryption?";
//
// notesLabel
//
this.notesLabel.AutoSize = true;
this.notesLabel.Font = new System.Drawing.Font("Microsoft Sans
Serif", 12F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.notesLabel.Location = new System.Drawing.Point(11, 695);
this.notesLabel.Margin = new System.Windows.Forms.Padding(4,
0, 4, 0);
this.notesLabel.Name = "notesLabel";
this.notesLabel.Size = new System.Drawing.Size(69, 25);
this.notesLabel.TabIndex = 9;
this.notesLabel.Text = "Notes:";
this.notesLabel.Click += new
System.EventHandler(this.notesLabel_Click);
//
// imagePictureBox
//
this.imagePictureBox.Image =
global::Steganography.Properties.Resources.images;
this.imagePictureBox.Location = new System.Drawing.Point(16,
107);
this.imagePictureBox.Margin = new
System.Windows.Forms.Padding(4);
this.imagePictureBox.Name = "imagePictureBox";
this.imagePictureBox.Size = new System.Drawing.Size(499, 320);
this.imagePictureBox.SizeMode =
System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.imagePictureBox.TabIndex = 4;
this.imagePictureBox.TabStop = false;
//
// groupBox2
//
this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans
Serif", 10.2F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox2.Location = new System.Drawing.Point(562, 54);
this.groupBox2.Margin = new System.Windows.Forms.Padding(4);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new
System.Windows.Forms.Padding(4);
this.groupBox2.Size = new System.Drawing.Size(499, 27);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "ENTER YOUR TEXT
:-"; this.groupBox2.Enter += new
System.EventHandler(this.groupBox2_Enter);
//
// groupBox3
//
this.groupBox3.Font = new System.Drawing.Font("Microsoft Sans
Serif", 10.2F, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox3.Location = new System.Drawing.Point(13, 54);
this.groupBox3.Margin = new System.Windows.Forms.Padding(4);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new
System.Windows.Forms.Padding(4);
this.groupBox3.Size = new System.Drawing.Size(499, 27);
this.groupBox3.TabIndex = 11;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "SELECT YOUR IMAGE
:-";
this.groupBox3.Enter += new
System.EventHandler(this.groupBox3_Enter);
//
// Steganography
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode =
System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1103, 738);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.notesLabel);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.imagePictureBox);
this.Controls.Add(this.extractButton);
this.Controls.Add(this.dataTextBox);
this.Controls.Add(this.hideButton);
this.Controls.Add(this.menuStrip1);
this.Font = new System.Drawing.Font("Script MT Bold", 7.8F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((byte)(0)));
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.Name = "Steganography";
this.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "MCA_PROJECT_STEGANOGRAPHY";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)
(this.imagePictureBox)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
#endregion
SteganographyHelper.cs
using System;
using System.Drawing;
namespace Steganography
{
class SteganographyHelper
{
public enum State
{
Hiding,
Filling_With_Zeros
};
// holds the number of trailing zeros that have been added when
finishing the process
int zeros = 0;
// now, clear the least significant bit (LSB) from each pixel
element
R = pixel.R - pixel.R % 2;
G = pixel.G - pixel.G %
2; B = pixel.B - pixel.B %
2;
charValue /= 2;
}
} break;
case 2:
{
if (state == State.Hiding)
{
B += charValue % 2;
charValue /= 2;
}
pixelElementIndex++;
if (state == State.Filling_With_Zeros)
{
// increment the value of zeros until it is 8
zeros++;
}
}
}
}
return bmp;
}
colorUnitIndex++;
return extractedText;
}
2; n /= 2;
}
return result;
}
}
}
Annexure
Bibliography
Websites
Following websites are referring to create this project reports.
http://www.asp.net
http://www.asp123.com
http://www.wikipedia.org
Books
Following books and ebook are used to complete this project
reports.
Mastering C# (Paperback)
.NET Black Book (Paperback)
Professional C#, 2nd Edition (Paperback)
Professional ASP.NET (Paperback)
MCAD/MCSD Self-Paced Training Kit: Developing Web
Applications with Microsoft® Visual Basic® .NET and
Microsoft Visual C#® .NET, Second Edition
Appendix