Professional Documents
Culture Documents
INTRODUCTION
The objective of the project is to hide a text file inside a video file
and send it to the receiver. This process is called steganography. DWT
compression and LSB methods are used to hide the text file inside the video.
The video file is splitted into frames. Then, the frames are compressed using
DWT compression technique. This is followed by hiding the data using the LSB
method. This is followed by decompressing the frame using inverse DWT. The
frames are rejoined to form the steganographed video. This video will be sent to
the receiver. There will be slight changes in the video. But, it can‟t be identified
by human eyes. The receiver will decompress the video and apply the DWT
compression technique. After that, LSB of each pixel of the steganographed
frame will be extracted. Every eight bits will form a character and this gives the
secret text. In this way, the original video and the secret text can be separately
viewed. Modern cover types can take many forms such as text documents,
audio tracks, digital images, and video streams. Extensive research has been
done on image steganography in the previous decade due to their popularity
on the internet. Nowadays, video files are drawing much more attention.
They are transmitted more and more frequent on internet websites such as
Facebook and YouTube imposing a larger practical significance on video
steganography
1
1.2 EXISTING SYSTEM
Over the past few decades, the art of secretly embedding and
communicating digital data has gained enormous attention because of the
technological development in both digital contents and communication. The
imperceptibility, hiding capacity, and robustness against attacks are three main
requirements that any video steganography method should take into
consideration. In this paper, a robust and secure video steganographic algorithm
in discrete wavelet transform (DWT) and discrete cosine transform (DCT)
domains based on the multiple objects tracking (MOT) algorithm and error
correcting codes is proposed. The secret message is preprocessed by applying
both Hamming and Bose, Chaudhuri, and Hocquenghem codes for encoding the
secret data.
First, motion-based MOT algorithm is implemented on host videos to
distinguish the regions of interest in the moving objects. Then, the data hiding
process is performed by concealing the secret message into the DWT and DCT
coefficients of all motion regions in the video depending on foreground masks.
Our experimental results illustrate that the suggested algorithm not only
improves the embedding capacity and imperceptibility. Unfortunately, most of
the existing algorithms do not discuss their computational complexity. Mainly,
there are four challenges: robustness, tamper resistance, hiding capacity and
perceptual transparency. A video file can simply be viewed as a sequence of
images, yielding video data hiding similar to image data hiding. However, there
are many aspects that differentiate between video steganography and image
steganography. As the video content is dynamic, lower chances of detection of
the hidden data compared with images. In addition to the image attacks that can
be applied on the separate frames of video; there are much more attacks for
videos such as lossy compression, change of frame rate, formats interchanging,
addition or deletion of frames during video processing.
2
1.3 PROPOSED SYSTEM
This paper will focus on hiding information in specific frames of the
by Discrete Wavelet Transform (DWT) Compression and Least Significant Bit
(LSB) substitution. The proposed method uses video based steganography
because of large size and memory requirements. The video is converted into
frames. Frames are splitted for every 0.05 secs. Then these frames are
compressed using DWT Haar compression technique. The frame that should be
used to hide the data is selected. Then the hiding of the text data in the selected
frame is done by LSB insertion technique. After data embedding, the frames are
decompressed using inverse DWT compression. The frames are rejoined to
form the steganographed video. This video will look alike the original video.
But few changes will be made. This can‟t be identified by human eyes. This will
be sent to the receiver.
The receiver will split the video into frames and then compress it
using DWT compression. Now the LSB of each pixel in the steganographed
frame will be extracted. Gather all the bits and make every eight bits as a
character. This will give the hidden data and the original video separately
Although substitution-based techniques are considered the simplest way for
information hiding, but their main disadvantage is the vulnerability to any cover
modification including compression, format change, etc. In addition, the
embedded data using these techniques can be easily destroyed by an attacker.
Transform domain techniques are more complex, but in return, they try to
enhance the robustness and the perceptual transparency of the produced stego-
objects. Basically, any transform-domain technique consists of at least the
following steps: First the cover is transformed into the frequency domain, then
secret message is embedded in some or all of the transformed coefficients, and
finally the modified coefficients are transformed back to the original form of the
cover. Examples of these transforms include: Discrete Fourier Transform
(DFT),
3
1.4 STEGANOGRAPHY CONCEPTS
Steganography is an art of convert communication, which offers secrete
and secure way of communication. It has many application areas such as audio-
video synchronization, copyright control, TV broadcasting, in defense forces
and digital watermarking etc. Broad band internet connections almost an
errorless transmission of data helps people to distribute large multimedia files
and makes identical data copies of them. Sending sensitive messages and files
over the internet are transmitted in an unsecured form but everyone has got
something to keep in secret. The aim of steganography is to hide the secret data
inside the cover medium without changing the overall quality of cover medium.
In steganography actual information is not maintained in its original
format but is converted in such a way that it can be hidden inside multimedia
file e.g. image, video, audio. The current industries mainly demands for digital
watermarking and finger printing of audio and video steganography. The
steganography remains intact under transmission and transformation allowing
us to protect our secret data. For this the image is converted into bit stream and
this bit stream is then embedded in the changing frame. The cybercrimes are
also reporting rapidly nowadays hence the steganographic methods should be
that much effective and secure so that crimes can be minimized for that
cryptography should be combined with steganography for the security of the
data come information.
Video based steganography can be done in two ways: either frame to
frame data storing or converting frame into frequency domain and then store the
result. First way is something like spatial domain and the second way is like
frequency domain. Whichever method is utilized for steganography, the video
steganography can be also classified into two types: lossless and lossy
steganography. In lossless steganography the hidden information and original
video file both can be retrieved without any error or modification, while in lossy
4
steganography the hidden information is retrieved correctly while the original
video will have some errors.
The lossless steganography requires storing hidden information in
specification location and will requires some time to run the algorithm in order
to find the specific location where hidden information can be get stored. Thus,
in real time application, the lossless algorithm is becoming tougher to
implement, and that depends on the system specifications. The lossy
steganography requires storing data at some LSB location or at specific pixel
locations. This is easy to implement and it can be apply in real time application
with any normal system specifications. The LSB (Least Significant Bit) is used
here to hide the data. The first frame is selected as index frame and it contains
the information regarding where the information is stored, in which form
information is getting stored, what is file type of the information, etc
information are stored in the index frame. If the first frame is received properly
and if the receiver recognized the information then it is very easy to get hidden
information from steganography video file.
USES OF STEGANOGRAPHY
Steganography can be a solution which makes it possible to send news
and information without being censored and without their fear of the messages
being intercepted and tracked back to us. It is also possible to simply use
Steganography to store information on a location. For example, several
information sources like our private banking information and some military
secrets can be stored in a cover source. Steganography can also be used to
implement watermarking. There are several steganographic techniques that are
being used to store watermarks in data. The main difference is that the purpose
of steganography is hiding information and watermarking is merely extending
the cover source with extra information. Since people will not accept noticeable
changes in images, audio or video files because of a watermark, steganographic
5
methods can be used to hide this. E-commerce allows for an interesting use of
Steganography. In current e-commerce transactions, most users are protected by
a username and password, with no real method of verifying that the user is the
actual card holder.
Biometric finger print scanning and images via steganography allow for a
very secure option to open e-commerce transaction verification. Paired with
existing communication methods, steganography be used to carry out hidden
exchanges.
6
The objective of steganography is to hide a secret message within a
cover-media in such a way that others cannot discern the presence of the hidden
message. Technically in simple words “steganography means hiding one piece
of data within another”. Modern steganography uses the opportunity of hiding
information into digital multimedia files and also at the network packet level.
K K
C C
S
M Fe Fe M
Y
7
CHAPTER 2
LITERATURE SURVEY
8
2.2 TITLE: RANDOM PIXEL EMBEDDING FOR HIDING SECRET
TEXT OVER VIDEO FILE
Data hiding can be done using steganography technique. The secret
data is embedded in a carrier file such as video in such an invisible manner.
Video format is chosen due to its capacity to store large data within frames.
Moreover, because these frames are displayed rapidly, any tiny modification as
a result of data hiding process is hardly observed by human eye. This study
employed a Random Number Generator function into a method called Random
Pixel Embedding. This was implemented by developing an application to hide
text data in a video file as container. Quality testing for insertion phase result
was done by measuring Signal to Noise Ratio which yielded a value of 99%.
Meanwhile, testing for extraction phase result was done by measuring Character
Error Rate which yielded value of 0.06. Those tests proved that this research
produced a steganography application for hiding text message over video file
which is ready to use.
In this study, randomize the locations of data hiding is applied to improve
data security in steganography. The aims of this proposed method is to make
steganalysis difficult to locate the true pixels carrying the bits of hidden data.
The experiment works are tested objectively by measuring the Signal to Noise
Ratio and testing using Character Error Rate.
9
2.3 TITLE: DATA HIDING IN VIDEO STREAM BY TEXT
SUBSTITUTION
Our proposed approach is data hiding in video stream by text
substitution, it is divided into two parts data embedding and data extraction. To
hide text data file inside frames of video we propose higher least significant bit
algorithm. And to provide more security to the stego video proposed pixel
swapping encryption technique, which is use to encrypt stego video. For data
hiding inside frame, first divide single frame into four carrier images and hide
data into five LSB bits of each pixel of a carrier image, which satisfy
quantization error condition and leave other pixel as it is. Key generated while
hiding data is store into last pixel of carrier image. Data hiding key and
encryption key are used to preserve privacy. Our proposed approach tries to
improve payload capacity and provide more security to the stego video.
Information security is becoming important concern in today‟s world
because of widespread use of internet as a communication channel. We
generally need to communicate data in the form of text, image, audio or video.
This information is mostly communicated through the network. But in a
network, data is not secure, it can get eavesdrop. To protect transfer of sensitive
data in network from a third person steganography techniques can be used.
There are different steganography techniques such as image, audio, video, text,
network steganography. Steganography means hiding secret data inside a cover
medium such that no one other than the sender and intended recipient suspect
the existence of secret data. Our paper, Data Hiding in Video Stream by text
Substitution concerned with video steganography. Data embedding in videos
seems very similar to images. However, there are many differences between
data hiding in images and videos, where the first important difference is the size
of the host media.
10
2.4 TITLE: HIDING TEXT IN VIDEO USING STEGANOGRAPHIC
TECHNIQUE – A REVIEW
This paper presents the hiding of text in video using Haar wavelet
transform in particular frame and BCH codes. Haar wavelet transform is applied
to get the low frequency sub-band in an image to hide data. The frequency sub-
bands are (LL, LH, HL and HH). BCH codes are used to encrypt the data. The
work of various researchers is discussed about video steganography and their
techniques for embedding and extraction of data. With the advancement of
technology and multimedia information, Videos and digital images are
increasing very quickly. Steganography is hiding private or secret data within a
carrier in invisible manner. A lot of information can be stored in video files. It
contains number of frames played over a period of time. .Information can be
stored in any or number of frames. Moreover, Attacker or Human eye cannot
detect the presence of message in video because video frame is only visible for
a fraction of time.
Video Steganography is a very important task in real life where the users
want to keep data secret. Data is the heart of computer communication and over
the years, different methods have been proposed and created to accomplish the
goal of using steganography to hide data. The problem occurs when Traditional
Text and Image Based Steganography techniques is not plentiful .They are able
to carry only small files. So there is a problem, how to get much enough files to
hide our message. This becomes a very tedious task for carry large amount of
data. Here, comes the need of Video Steganography. The use of video as a
carrier cover for the secure message is overcame the capacity problem.
Information can be hidden in any frame of video. Video has a large Capacity to
store information. Added small enhancement to the security aspects. The
integration of Steganography and cryptography techniques provided powerful
systems for sharing secure messages.
11
2.5 TITLE: A NOVEL DATA EMBEDDING TECHNIQUE FOR HIDING
TEXT IN VIDEO FILE USING STEGANOGRAPHY
Today‟s internet applications require data to be transmitted in a secure
manner. Data transmission in public communication system is not secure
because of interception and improper manipulation by eavesdropper. So the
solution for this problem is Steganography. That has to do with secure data
transmission between a sender and a receiver; implementing Steganography is
the best way. Steganography is hiding private or secret data within a carrier in
an invisible manner, in such a way that no one, apart from the sender and intend
recipient. This paper focus on hiding text in a computer video file and to
retrieve the hidden information. Generally Video files are collection of both
images and audio. Hiding large amount of data in video is possible compare
with others. Video Steganography deals with hiding secret data or information
within a video. This can be done by using LSB technique.
The proposed system is depends on video Steganography for hiding
secret message into the video file, retrieving the hidden secret message from the
video using Least Significant Bit(LSB) mechanism. By using Data Encryption
Standard (DES) algorithm at the sender side the secret text message is
encrypted. The key which is used in DES is shared by both sender and receiver.
The encrypted message is passed to embedding phase. In embedding phase the
encrypted message will embedded into the cover file (video file) resulting in a
steganographed video file. The embedded steganographed video file contains
the encrypted text message which is extracted at the receiver side. At the
receiver side Stego‟d video file is passed to the de embedding phase. In
extraction process encrypted text will be extracted from embedded video file
and encrypted text is decrypted using decryption module.
12
2.6 TITLE: A COMPARATIVE STUDY ON VIDEO STEGANOGRAPHY
IN SPATIAL AND IWT DOMAIN
Steganography is a technique for embedding digital information inside
another digital medium such as text, images, audio signals or video signals,
without revealing its presence in the medium. In video steganography, a video
file will be used as a cover medium within which any secret message can be
embedded. In steganography, the secret information can be hidden either
directly by altering the pixel values of the images in the spatial domain or in the
frequency components of the images after transforming the images into
frequency domain by using transformation algorithms such as DCT (Discrete
Cosine Transform), DWT(Discrete Wavelet Transform) and IW(Integer
Wavelet Transform).. In this paper, secret data are embedded inside a video file
using both the methods, spatial and frequency, and the outcomes are analyzed
and compared. Results are compared based on PSNR (Peak Signal to Noise
Ratio), MSE (Mean Square Error), BER (Bit Error Rate) and Standard
Deviation. The findings of this study are given as suggestions for further
enhancement.
Spatial domain techniques are very simple and easy to implement. More
amount of information can be hidden without much difficulty. LSB (Least
Significant Bit) substitution is the most commonly used method for hiding data
in the spatial domain. In this method, few least significant bits of the pixels of
the cover image are replaced by the bits of secret data. Replacing few least
significant bits of the pixels does not create significant visual change in the
image. Since the change is very less it is invisible to the human visual system.
At the same time if a hacker suspects the presence of the message, then he can
trace the message without much
13
CHAPTER 3
SYSTEM SPECIFICATION
14
Runtime (CLR), an application virtual machine that provides services such as
security, memory management, and exception handling. The class library and
the CLR together constitute the .NET Framework.
The .NET Framework's Base Class Library provides user interface, data
access, database connectivity, cryptography, web application development,
numeric algorithms, and network communications. Programmers produce
software by combining their own source code with the .NET Framework and
other libraries. The .NET Framework is intended to be used by most new
applications created for the Windows platform. Microsoft also produces an
integrated development environment largely for .NET software called Visual
Studio
Design Features
Interoperability
15
Language independence
The Base Class Library (BCL), part of the Framework Class Library
(FCL), is a library of functionality available to all languages using the .NET
Framework. The BCL provides classes that encapsulate a number of common
functions, including file reading and writing, graphic rendering, database
interaction, XML document manipulation, and so on. It consists of classes,
interfaces of reusable types that integrate with CLR (Common Language
Runtime).
Simplified deployment
The .NET Framework includes design features and tools which help
manage the installation of computer software to ensure it does not interfere with
previously installed software, and it conforms to security requirements.
Security
16
Portability
17
3.3.2 BACK END – SQL SERVER
SQL Server
It is a software developed by Microsoft, which is implemented from the
specification of RDBMS. It is also an ORDBMS. It is platform dependent. It is
both GUI and command based software. It supports SQL (SEQUEL) language
which is an IBM product, non-procedural, common database and case
insensitive language.
SQL Editions
SQL Server is available in various editions. This chapter lists the multiple
editions with its features.
Enterprise: This is the top-end edition with a full feature set.
18
Standard: This has less features than Enterprise, when there is no
requirement of advanced features.
Workgroup: This is suitable for remote offices of a larger company.
SQL Architecture
We have classified the architecture of SQL Server into the following parts for
easy understanding:
19
General Architecture
Client: Where the request initiated.
Query: SQL query which is high level language.
Logical Units: Keywords, expressions and operators, etc.
N/W Packets: Network related code.
Protocols: In SQL Server we have 4 protocols.
Shared memory (for local connections and troubleshooting purpose).
Named pipes (for connections which are in LAN connectivity).
TCP/IP (for connections which are in WAN connectivity).
VIA-Virtual Interface Adapter (requires special hardware to set up by
vendor and also deprecated from SQL 2012 version).
Server: Where SQL Services got installed and databases reside.
Relational Engine: This is where real execution will be done. It contains Query
parser, Query optimizer and Query executor.
Query Parser (Command Parser) and Compiler (Translator): This will
check syntax of the query and it will convert the query to machine language.
Query Optimizer: It will prepare the execution plan as output by taking query,
statistics and Algebrizer tree as input.
Execution Plan: It is like a roadmap, which contains the order of all the steps to
be performed as part of the query execution.
Query Executor: This is where the query will be executed step by step with the
help of execution plan and also the storage engine will be contacted.
20
CHAPTER 4
SYSTEM DESIGN
4.1 ARCHITECTURE DIAGRAM
A system architecture or systems architecture is the conceptual model that
defines the structure, behavior, and more views of a system. An architecture
description is a formal description and representation of a system, organized in
a way that supports reasoning about the structures and behaviors of the system.
System architecture can comprise system components, the externally visible
properties of those components, the relationships (e.g. the behavior) between
them. It can provide a plan from which products can be procured, and systems
developed, that will work together to implement the overall system. There have
been efforts to formalize languages to describe system architecture, collectively
these are called architecture description languages (ADLs).
21
long-range plans and priorities for future purchases, and a plan for
upgrading and/or replacing dated equipment and software.
In this use case diagram, there were two actors namely Sender and
Receiver. The sender will do the actions like upload video, convert into frames,
he will do DWT compression to hide the data into the frame selected from the
video and then rejoins the frame. The receiver will receive the video, convert it
into frames, do the same operation as the sender, use the LSB coding algorithm
to extract the text from the steganographed video.
23
Fig 4.2 Use case diagram for Video steganography
24
4.3 SEQUENCE DIAGRAM
25
Fig 4.3 Sequence diagram
26
4.4 COLLOBORATION DIAGRAM
27
4.5 ACTIVITY DIAGRAM
Activity diagram is another important diagram in UML to describe the
dynamic aspects of the system. Activity diagram is basically a flowchart to
represent the flow from one activity to another activity. The activity can be
described as an operation of the system. The control flow is drawn from one
operation to another. An activity diagram visually presents a series of actions or
flow of control in a system similar to a flowchart or a data
flow diagram. Activity diagrams are often used in business process modeling.
They can also describe the steps in a use case diagram. Activities modeled can
be sequential and concurrent. Activity diagram is another important diagram in
UML to describe the dynamic aspects of the system. Activity diagram is
basically a flowchart to represent the flow from one activity to another activity.
The activity can be described as an operation of the system. The control flow is
drawn from one operation to another.
28
Fig 4.5 Activity Diagram
29
CHAPTER 5
MODULE DESCRIPTION
5.1 MODULES
• Video Upload & Frame Split
• DWT Compression
• Data Embedding
• Inverse DWT Compression
• Data Extraction
31
into a byte to form a character. These characters form the secret text data. The
secret data and the original video can be viewed separately.
The receiver on receiving the stego video sent by the sender using
the DWT steganographic process will also separate the video into number of
frames. Then he will apply the same procedure done on the sender side in the
reverse order in order to extract the required data. The extraction process will
involves a key which will be sent to the receiver at the time of the embedding of
the text into the frame selected from the video. This key will be used to extract
the text from the frame in which the data is hidden. After the key applying
process, the receiver will get both the data and video in separate. The text may
be any size .Irrespective of the size, it can be easily embedded into the frame of
the video.
32
LSB SUBSTITUTION ALGORITHM
In digital steganography, sensitive messages may be concealed by
manipulating and storing information in the least significant bits of an image or
a sound file. In the context of an image, if a user were to manipulate the last two
bits of a color in a pixel, the value of the color would change at most +/- 3 value
places, which is likely to be indistinguishable by the human eye. The user may
later recover this information by extracting the least significant bits of the
manipulated pixels to recover the original message. The steps used here were
given as following,
1. Input a video and convert into a 24-bit color image having JPG format.
2. Divide the columns of the input image in to sets
3. Number the pixels of a set in the RGB plane
4. Now input the secret message and key which is used to hide the message in
the input image.
5. If the secret message has the first character „A‟ and key used to hide this
message has the first value „4‟ then this character is hidden.
6. Similarly next character of the message is hided with the next value of the
key field. Key values are chosen in the circular way to hide the complete
message.
33
CHAPTER 6
SYSTEM TESTING
White box testing is a testing technique that takes into account the
internal mechanism of a system. It is also called structural testing and glass box
testing. White box testing is used for verification.
All the above testing types are performed and no defect is found.
35
CHAPTER 7
CONCLUSION
36
CHAPTER 8
FUTURE ENHANCEMENT
37
CHAPTER – 9
APPENDICES
9.1.SOURCE CODE
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using AForge.Video.FFMPEG;
using System.Data.SqlClient;
using System.Net;
using System.IO;
using System.Net.Mail;
namespace Video_Inpainting_With_Short_Term_Windows
{
public partial class Home : Form
{
public string sende123;
SqlConnection con = new SqlConnection(@"Data
Source=.\SQLEXPRESS;AttachDbFilename=E:\Project\TextHiding\Video
38
Inpainting With Short-Term Windows\capctha.mdf;Integrated
Security=True;User Instance=True");
SqlCommand cmd;
public Home()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
//AdminHome ah = new AdminHome();
//ah.Show();
}
private void button1_Click(object sender, EventArgs e)
{
//Camera c = new Camera();
//c.Show();
}
private void button3_Click(object sender, EventArgs e)
{
VideoCopyDetection v = new VideoCopyDetection();
v.Show();
}
int video;
private void button2_Click_1(object sender, EventArgs e)
{
if (textBox1.Text == "" || pictureBox1.Image == null || textBox3.Text == "")
{
MessageBox.Show("Please Enter Text Or Image");
}
39
else
{
string path =
System.IO.Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Hide\\";
string path1 =
System.IO.Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Hide\\";
Bitmap bmpp1 = new Bitmap(pictureBox1.Image);
bmpp1 = HideText.invisbleText(textBox1.Text, bmpp1);
pictureBox1.Image = bmpp1;
pictureBox1.Image.Save(path + filename);
MessageBox.Show("Data hide Completed!");
}
Random rr = new Random();
video = rr.Next(1111, 9999);
int width = pictureBox1.Image.Width;
int height = pictureBox1.Image.Height;
// create instance of video writer
VideoFileWriter writer = new VideoFileWriter();
// create new video file
writer.Open(video + ".avi", width, height, 25, VideoCodec.MPEG4);
// create a bitmap to save into the video file
DirectoryInfo di = new
DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath.ToString())
+ "\\Frame\\");
for (int i = 0; i < di.GetFiles("*.*").Length - 1; i++)
{
if (filename == i.ToString() + ".jpg")
40
{
//label3.Text = filename;
Bitmap image = new
Bitmap(Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Hide\\" + i.ToString() + ".jpg");
writer.WriteVideoFrame(image);
}
else
{
Bitmap image = new
Bitmap(Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Frame\\" + i.ToString() + ".jpg");
writer.WriteVideoFrame(image);
}
}
writer.Close();
MessageBox.Show("Video Completed!");
}
string filename;
string fullpath;
private void button1_Click_1(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
filename = System.IO.Path.GetFileName(op.FileName);
fullpath = op.FileName;
textBox2.Text = fullpath;
pictureBox1.Image = new Bitmap(op.FileName);
}
41
private void button3_Click_1(object sender, EventArgs e)
{
int width = pictureBox1.Image.Width;
int height = pictureBox1.Image.Height;
// create instance of video writer
VideoFileWriter writer = new VideoFileWriter();
// create new video file
writer.Open("test.avi", width, height, 25, VideoCodec.MPEG4);
// create a bitmap to save into the video file
DirectoryInfo di = new
DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath.ToString())
+ "\\Frame\\");
for (int i = 0; i < di.GetFiles("*.*").Length - 1; i++)
{
if (filename == i.ToString() + ".jpg")
{
//label3.Text = filename;
Bitmap image = new
Bitmap(Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Hide\\" + i.ToString() + ".jpg");
writer.WriteVideoFrame(image);
}
else
{
Bitmap image = new
Bitmap(Path.GetDirectoryName(Application.ExecutablePath.ToString()) +
"\\Frame\\" + i.ToString() + ".jpg");
writer.WriteVideoFrame(image);
}
42
}
writer.Close();
MessageBox.Show("Video Completed!");
}
class HideText
{
public enum State
{
Hiding,
Filling_With_Zeros
};
public static Bitmap invisbleText(string text, Bitmap bmp)
{
State state = State.Hiding;
int charIndex = 0;
int charValue = 0;
long pixelElementIndex = 0;
int zeros = 0;
// hold pixel elements
int R = 0, G = 0, B = 0;
// pass through the rows
for (int i = 0; i < bmp.Height; i++)
{
for (int j = 0; j < bmp.Width; j++)
{
Color pixel = bmp.GetPixel(j, i);
// now, clear the least significant bit (LSB) from each pixel
element
R = pixel.R - pixel.R % 2;
43
G = pixel.G - pixel.G % 2;
B = pixel.B - pixel.B % 2;
// for each pixel, pass through its elements (RGB)
for (int n = 0; n < 3; n++)
{
// check if new 8 bits has been processed
if (pixelElementIndex % 8 == 0)
{
// check if the whole process has finished
// we can say that it's finished when 8 zeros are added
if (state == State.Filling_With_Zeros && zeros == 8)
{
// apply the last pixel on the image
// even if only a part of its elements have been affected
if ((pixelElementIndex - 1) % 3 < 2)
{
bmp.SetPixel(j, i, Color.FromArgb(R, G, B));
}
// return the bitmap with the text hidden in
return bmp;
}
// check if all characters has been hidden
if (charIndex >= text.Length)
{
// start adding zeros to mark the end of the text
state = State.Filling_With_Zeros;
}
else
{
44
// move to the next character and process again
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;
}
45
bmp.SetPixel(j, i, Color.FromArgb(R, G, B));
} break;
}
pixelElementIndex++;
if (state == State.Filling_With_Zeros)
{
// increment the value of zeros until it is 8
zeros++;
}
}
}
}
return bmp;
}
public static string extractText(Bitmap bmp)
{
int colorUnitIndex = 0;
int charValue = 0;
// holds the text that will be extracted from the image
string extractedText = String.Empty;
// pass through the rows
for (int i = 0; i < bmp.Height; i++)
{
// pass through each row
for (int j = 0; j < bmp.Width; j++)
{
Color pixel = bmp.GetPixel(j, i);
// for each pixel, pass through its elements (RGB)
for (int n = 0; n < 3; n++)
46
{
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 8 bits has been added, then add the current character to the
result text
if (colorUnitIndex % 8 == 0)
{
// reverse? of course, since each time the process happens
on the right (for simplicity)
charValue = reverseBits(charValue);
// can only be 0 if it is the stop character (the 8 zeros)
if (charValue == 0)
{
return extractedText;
}
47
// convert the character value from int to char
char c = (char)charValue;
// add the current character to the result text
extractedText += c.ToString();
}
}
}
}
return extractedText;
}
public static int reverseBits(int n)
{
int result = 0;
for (int i = 0; i < 8; i++)
{
result = result * 2 + n % 2;
n /= 2;
}
return result;
}
}
private void button4_Click(object sender, EventArgs e)
{
}
string fileid;
string mail;
private void button4_Click_1(object sender, EventArgs e)
{
48
//Bitmap bmp = new Bitmap(pictureBox1.Image);
label4.Text = sende123;
cmd = new SqlCommand("insert into frametb
values(@SenderName,@ReceiverName,@FrameName,@Keys,@Image,@Vide
o)", con);
cmd.Parameters.AddWithValue("@SenderName", sende123);
cmd.Parameters.AddWithValue("@ReceiverName", comboBox1.Text);
cmd.Parameters.AddWithValue("@FrameName", filename);
cmd.Parameters.AddWithValue("@Keys", textBox3.Text);
cmd.Parameters.AddWithValue("@Video", video + ".avi");
// cmd.Parameters.AddWithValue("@Image", "");
conv_photo1();
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Record Saved!");
cmd = new SqlCommand("select max(id) as id from frametb ", con);
con.Open();
SqlDataReader dr22 = cmd.ExecuteReader();
if (dr22.Read())
{
fileid = dr22["id"].ToString();
}
con.Close();
con.Open();
cmd = new SqlCommand("select * from rregtb where Username='" +
comboBox1.Text + "'", con);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
49
{
mail = dr["Email"].ToString();
}
con.Close();
string to = mail;
string from = "sampletest685@gmail.com";
// string subject = "Key";
// string body = TextBox1.Text;
string password = "mailtest2";
using (MailMessage mm = new MailMessage(from, to))
{
mm.Subject = "Keys";
mm.Body = "FileId " + fileid + " FileName: " + filename + " Key"
+ textBox3.Text;
//Image image = pictureBox1.Image;
//System.IO.MemoryStream stream = new
System.IO.MemoryStream();
//image.Save(stream, ImageFormat.Jpeg);
//stream.Position = 0;
//mm.Attachments.Add(new Attachment(stream, "Screenshot.jpg"));
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential(from,
password);
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
50
smtp.Send(mm);
MessageBox.Show("Mail Send!");
}
}
void conv_photo1()
{
MemoryStream ms;
//string path1 =
Path.GetDirectoryName(Application.ExecutablePath).ToString();
//converting photo to binary data
string ss = fullpath;
FileStream fs = new FileStream(ss, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
br.Close();
fs.Close();
cmd.Parameters.AddWithValue("@Image", bytes);
}
private void Home_Load(object sender, EventArgs e)
{
con.Open();
cmd = new SqlCommand("select * from rregtb", con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
comboBox1.Items.Add(dr["UserName"].ToString());
}
con.Close();
}
51
string file,ext;
private void button5_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.ShowDialog();
file = op.FileName;
ext = System.IO.Path.GetExtension(op.FileName);
if (ext == ".txt")
{
textBox1.Text = File.ReadAllText(op.FileName);
}
else
{
MessageBox.Show("Please Choose Text Document");
}
}
}
}
52
9.2.SCREENSHOTS
SENDER LOGIN:
UPLOAD VIDEO:
53
VIEW FRAME:
TEXTHIDING:
54
RECIEVER LOGIN:
TEXT EXTRAXTION:
55
CHAPTER 10
REFERENCES
1. Dongqing Zhang, B.L. Tseng and Shih-Fu Chang, “Accurate Overlay
Text Extraction for Digital Video Analysis”, International Conference on
Information Technology: Research and Education, Proceedings. Aug.
2003.
2. Muhammad Khaerul Anam, Eko Adi Sarwoko, Edy Suharto and Kharis
Khasburrahman, “Random Pixel Embedding for Hiding Secret Text over
Video File”, 1st International Conference on Informatics and
Computational Sciences (ICICoS), Nov.2017, pp: 41 – 46.
3. Amruta B. Bhojane and Priti A. Khodke, “Data Hiding In Video Stream
By Text Substitution”, International Journal of Science, Engineering and
Technology, July 2015, pp: 735 – 738.
4. Jaspreet Kaur and Jagroop Kaur, “Hiding Text in Video Using
Steganographic Technique - A Review”, International Journal of
Engineering Sciences, January 2016, Vol. 17, pp: 578 – 582.
5. K.V.Vinodkumar and V. Lokeswara Reddy, “A Novel Data Embedding
Technique for Hiding Text in Video File using Steganography”,
International Journal of Computer Applications, Vol. 77, September
2013, pp: 13 – 18.
6. K.Rosemary Euphrasi and M. Mary Shanthi Rani, “A Comparative Study
On Video Steganography in Spatial and IWT Domain”, ICACA,
Oct.2016, pp: 104 – 109.
7. O.Bardhan, A. Bhattacharya, B. P. Sinha, “A Steganographic Technique
56
Based on VLSB Method using RC4 Stream Cipher”, International
Conference on Advances in Computing, Communications and
informatics, 2014.
8. Swetha V, Prajith V, Kshema V, “Data Hiding Using Video 213.
9. H. M. Kelash, O. F. Abdel Wahab, O. A. Elshakankiry, and H. S. El-
Sayed, “Hiding data in video sequences using steganography algorithms,”
Int. Conf. ICT Converg., 2013 pp. 353–358.
10.Carli M, Campisi P, Neri (2006) A Data hiding driven by perceptual
features for secure communications. In: International Conference on
Networking, International Conference on Systems and International
Conference on Mobile Communications and Learning Technologies
(ICN/ICONS/MCL) 85–85 Multimed Tools Appl
11.Chae JJ, Manjunath BS (1999) Data hiding in video. In: Proceedings of
International Conference on Image Processing (ICIP 99) 311–315
12.Chandramouli R, Memon ND (2003) Steganography capacity: A
steganalysis perspective. In: Proceedings of SPIE 173–177
13.Chang K-C, Chang C-P, Huang PS, Tu T-M (2008) A novel image
steganographic method using tri-way pixel-value differencing. J
Multimed 3(2):37–44
14.Chang F-C, Hang H-M, Huang H-C (2007) Layered access control
schemes on watermarked scalable media. J VLSI Signal Process Syst
Signal Image Video Technol 49(3):443–455
15.Channalli S, Jadhav A (2009) Steganography an Art of hiding data. Int J
Comput Sci Eng (IJCSE) 1(3): 137–141
16.Cheddad A, Condell J, Curran K, Mc Kevitt P (2009) A skin tone
detection algorithm for an adaptive approach to steganography. Signal
Process 89(12):2465–2478
57
17.Cheddad A, Condell J, Curran K, Mc Kevitt P (2010) Digital image
steganography: survey and analysis of current methods. Signal Process
90(3):727–752
18.Das R, Tuithung T (2012) A novel steganography method for image
based on Huffman Encoding. In: 3rd National Conference on Emerging
Trends and Applications in Computer Science (NCETACS) 14–18
19.Eltahir ME, Kiah LM, Zaidan BB, Zaidan AA (2009) High rate video
streaming steganography. In: International Conference on Future
Computer and Communication (ICFCC 2009) 672–675
20.Fridrich J, Goljan M, Du R (2001) Detecting LSB steganography in color,
and gray-scale images. Multimed IEEE 8(4):22–28
21.Hamid N, Yahya A, Ahmad RB, Al-Qershi OM (2012) Image
steganography techniques: an overview. Int J Comput Sci Secur (IJCSS)
6(3):p168–p187
22.Hanafy AA, Salama GI, Mohasseb YZ (2008) A secure covert
communication model based on video steganography. In: Military
Communications Conference (MILCOM 2008) 1–6
23.Handel TG, Sandford Ii MT (1996) Hiding data in the OSI network
model. In: Proceedings of the First International Workshop on
Information Hiding 23–38
58