Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
Each pixel has a color. The color is a 32-bit integer. The first
eight bits determine the redness of the pixel, the next eight bits the
greenness, the next eight bits the blueness, and the remaining eight bits
the transparency of the pixel.
1
a two-dimensional signal and applying standard signal-processing
techniques to it.
2
In particular, digital image processing is the only practical
technology for:
Classification
Feature extraction
Pattern recognition
Projection
3
Image recognition, for example, may extract the text from the image
using optical character recognition or checkbox and bubble values
using optical mark recognition
Image segmentation
1.2 APPLICATIONS
Computer vision, Optical sorting, Augmented Reality, Face
detection, Feature detection, Lane departure warning system, Non-
photorealistic rendering, Medical image processing, Microscope image
processing, Morphological image processing, Remote sensing.
1.3 STEGANOGRAPHY
5
1.4 PHYSICAL STEGANOGRAPHY
6
Steganography has been widely used, including in
recent historical times and the present day. Possible permutations are
endless and known examples include:
During World War II, the French Resistance sent some messages
written on the backs of couriers using invisible ink.
7
During and after World War II, espionage agents used
photographically produced microdots to send information back and
forth. Microdots were typically minute, approximately less than the
size of the period produced by a typewriter. World War II microdots
needed to be embedded in the paper and covered with an adhesive,
such as collodion. This was reflective and thus detectable by
viewing against glancing light. Alternative techniques included
inserting microdots into slits cut into the edge of post cards.
During World War II, a spy for Japan in New York City, Velvalee
Dickinson, sent information to accommodation addresses in neutral
South America. She was a dealer in dolls, and her letters discussed
how many of this or that doll to ship. The stegotext was the doll
orders, while the concealed "plaintext" was itself encoded and gave
information about ship movements, etc. Her case became somewhat
famous and she became known as the Doll Woman.
8
1.5 DIGITAL STEGANOGRAPHY
9
Pictures embedded in video material (optionally played at slower or
faster speed).
10
or audio but still has smaller memory occupation and simpler
communication. The method that could be used for text steganography
is data compression. Data compression encodes information in one
representation into another representation.
1.7 STEGANALYSIS
Some of the suspect signal or file may have noise or irrelevant data
encoded into them (which can make analysis very time consuming).
Pixelization
Linear filtering
14
Anisotropic diffusion
Self-organizing maps
Neural networks
Wavelets
CHAPTER 2
TOOLS
2.1 JSTEG
JSteg Shell is a Win95/98/NT interface to run JSteg DOS, a
program by Derek Upham which hides data in the ever popular JPG
image format. Version 1.0 has a number of new improvements,
including 40 bit RC4 encryption, determination of the amount of data a
JPG can hide beforehand, and user-selectable JPG options (ie. degree
of compression). JSteg Shell has a slick, easy to use interface that
makes using JSteg DOS a snap. Don't worry about downloading the
DOS executables as Jsteg Shell comes with them, and the installer
takes care of all of the setup details. The distribution comes with the
15
necessary VB v4 runtimes, so the file is quite large (3.9 MB). There are
many steps for the encoding.
JPEG files use a different color space than bitmaps. The three
color coefficients (Red, Green, Blue or RGB) for each pixel are
transformed into a new coding scheme: one luminance coefficient (the
intensity - defined a black and white image), and two chrominance
coefficients (the actual color in a 2D grid defined by a Blue/Yellow and
a Red/Green axis). At this point you have the YCbCr values.
2.1.4 QUANTIZATION
17
2.1.5 ZIG-ZAG ORDERING
Now you will be left, in each 8x8 block, with a few coefficients
still alive, and a whole bunch of zeroes. The first step here is to re-order
all the coefficients in what is called the "zig-zag" order. It's basically
done to put a maximum of zeroes close to each others, because it will
compress better on the next step. It's called "zig-zag" because it goes
this way through a 8x8 block.
18
in the JPG header. And now you have the final JPG raw binary data, or
what you see in a JPG file.
2.1.7 EXTRACTION
2.2 STOOLS-4.0
Designed by Andrew Brown, S-Tools, short for Steganography
Tools, is a program that allows users to hide information within
different types of files including, Windows sound files, otherwise
known as .WAV files [28]. With a user-friendly interface, messages can
be hidden and retrieved from .WAV files with a click of a mouse. By
using least significant bit insertion, S-Tools is able to hide information
within audio samples without changing the size of the sound file. This
technique is also chosen because the information hidden inside the
19
.WAV files will not sound any different to the human ear than the
original.
24
Decoding, on the other hand, is carefully defined in the standard.
Most decoders are "bit stream compliant", which means that the
decompressed output will be the same, within a specified degree of
rounding tolerance, as the output specified mathematically in the
ISO/IEC high standard document (ISO/IEC 11172-3). Therefore,
comparison of decoders is usually based on how computationally
efficient they are (i.e., how much memory or CPU time they use in the
decoding process).
With too low a bit rate, compression artifacts (i.e. sounds that
were not present in the original recording) may be audible in the
reproduction. Some audio is hard to compress because of its
randomness and sharp attacks. When this type of audio is compressed,
artifacts such as ringing or pre-echo are usually heard. A sample of
applause compressed with a relatively low bit rate provides a good
example of compression artifacts.
25
Besides the bit rate of an encoded piece of audio, the quality of
MP3 files also depends on the quality of the encoder itself, and the
difficulty of the signal being encoded. As the MP3 standard allows
quite a bit of freedom with encoding algorithms, different encoders
may feature quite different quality, even with identical bit rates.
2.4 OUTGUESS
OutGuess is a universal steganographic tool that allows the
insertion of hidden information into the redundant bits of data sources.
The nature of the data source is irrelevant to the core of OutGuess. The
program relies on data specific handlers that will extract redundant bits
and write them back after modification. In this version the PNM and
JPEG image formats are supported. In the next paragraphs, images will
be used as concrete example of data objects, though OutGuess can use
any kind of data, as long as a handler is provided. You can download
OutGuess as UNIX source tar ball. OutGuess is available under a BSD
software license.
27
This class supports reading the PNM image format into
System.Drawing.Image and writing it back to PNM format. It makes it
possible to inter convert different image file formats including PNM.
PNM is a portable bitmap format used in legacy software. The use of
PNM file format is more common in LINUX / UNIX Platform. PNM
file format consists of three different file formats namely PBM, PGM
and PPM.
29
CHAPTER 3
PROPOSED METHOD
30
output data are shifted by half a sample. There are eight standard DCT
variants, of which four are common.
DCT-I
Eq 3.1
Some authors further multiply the x0 and xN-1 terms by √2, and
correspondingly multiply the X0 and XN-1 terms by 1/√2. This makes the
DCT-I matrix orthogonal, if one further multiplies by an overall scale
31
factor of , but breaks the direct correspondence with a
real-even DFT.
DCT-II
Eq
3.2
DCT-III
Eq
3.3
DCT-IV
Eq
3.4
3.1.2 APPLICATIONS
3.2.3 OTHERS
3.2.4 PROPERTIES
3.2.5 APPLICATIONS
37
rotation, scaling cropping, collusion attacks among many other digital
signal processing operations.
38
39
3.3.1 EMBEDDING ALGORITHM
40
The main strength offered by transform domain techniques is that
they can take advantage of special properties of alternate domains to
address the limitations of spatial domain or to support additional
features. Steganography process is started by applying 3-leveles DWT
on the host image. The agreement adopted by many DWT-based
steganography methods is to embed the steganography in the middle
frequency sub-bands HLx and LHx is better in perspective of
imperceptibility and robustness.
Step 1: Perform DWT on the host image to decompose it into four non-
overlapping multi-resolution coefficient sets: LL1, HL1, LH1
and HH1.
Step 2: Perform DWT again on two HL1 and LH1coefficient sets to get
eight smaller coefficient sets and choose four coefficient sets:
HL12, LH12, HL22 andLH22.
41
Step 4: Divide four coefficient sets: HL13, LH13, HL23 and LH23 into
4 x 4 blocks.
42
Step 10: Perform inverse DCT (IDCT) on each block after its mid-band
coefficients have been modified to embed the steganographic bits
as described in the previous step.
Step 11: Perform the inverse DWT (IDWT) on the DWT transformed
image, including the modified coefficient sets, to produce the
steganographic host image.
43
44
3.3.2 EXTRACTING ALGORITHM
45
Step 3: Perform DWT again on two coefficient sets HL1 and LH1 to
get eight smaller coefficient sets and choose four coefficient sets:
HL12, LH12, HL22 and LH22.
Step 5: Divide four coefficient sets: HL13, LH13, HL23 and LH23 into
4 x 4 blocks.
Step 8: For each block in the coefficient sets: HL13, LH13, HL23 and
LH23 calculate the correlation between the mid-band coefficients
and the two generated pseudorandom sequences (PN_0 and
PN_1). If the correlation with the PN_0 was higher than the
correlation with PN_1, then the extracted steganography bit is
considered 0, otherwise the extracted steganography bit is
considered 1.
46
Ss (i, j), and compute the similarity between the original and
extracted image.
47
CHAPTER 4
MATLAB
48
Functions for integrating MATLAB based algorithms with external
applications and languages.
49
Before actually initiating the execution of MATLAB, it configures the
run-time environment by
There are two ways in which you can control the way matlab works:
50
mlm_license_file environment variables. Matlab –logfile filename
starts matlab and makes a copy of any output to the command window
in filename. This includes all crash reports. Matlab –nosplash starts
matlab, but does not display the splash screen during startup. Matlab
-nofigure windows starts matlab, but disables the display of any figure
windows in matlab. Matlab -r "statement" starts matlab and executes
the specified matlab statement. Any required file must be on the matlab
search path or in the startup directory. Matlab –reg server registers
matlab as a component object model (com) server. Matlab -sd "startdir"
specifies the startup directory for matlab (the current directory in
matlab after startup). The -sd option has been deprecated. For
information about alternatives, see startup folder on windows
platforms.
51
MATLAB variable names are normally case-sensitive. A variable
name can have up to 19 characters, including letters, numbers and
underscores. The command variables begins a variables declaration
block, which is terminated by an end keyword. In a component file, this
block contains declarations for all the variables associated with the
component. In a domain file, this block contains declarations for all the
Across variables associated with the domain . Additionally, domain files
must have a separate variables declaration block, with the Balancing
attribute set to true, which contains declarations for all the Through
variables associated with the domain.
52
verify : Validate and verify SimBiology model
CHAPTER 5
53
Fig 5.2 Selection of the required file
54
Fig 5.3 Data embedded using JSteg tool
55
Fig 5.4 Data embedded using Stool
56
Fig 5.5 Data embedded using Outguess tool
57
Fig 5.5 Data embedded using MP3 Stego tool
58
5.1 COMBINED 3-LEVEL DCT & DWT EMBEDDING
AND EXTRACTING
The steganography process has its own respective tools for the
secret data embedding and extraction processes but each of the tool has
its own images of particular format such as JPEG, GIF etc., The
Combined 3-Level DCT-DWT proposed method improves the
investigation process on the image package. It also reduces the
processing time for any type of image formats.
59
Fig 5.1.1 Text embedded using combined 3-level DCT & DWT
60
Fig 5.1.2 Text extracted using combined 3-level DCT & DWT
61
Fig 5.1.3 Image after extraction
62
CHAPTER 6
63
REFERENCES
CODING
64
JSTEG
%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,'
..')| strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
stego_img = imread(strcat('stego\',int2str(i),'.jpg '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
65
[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Jsteg 4.0')
end
end
end
SUB PROGRAM
function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;
66
STOOL
%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,
'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
stego_img = imread(strcat('stego\',int2str(i),'.gif '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
67
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Stool 4.2')
end
end
end
SUB PROGRAM
function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;
68
OUTGUESS
%Steganography
close all;
clear all;
clc;
warning off all;
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
69
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,
'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number stego_img =
imread(strcat('stego \',int2str(i),'.jpg '));
bi{i}=gray2bi(stego_img);
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
[namefile,pathname]=uigetfile('input\*.*','All Files');
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
avg1=mean(mean(bi1));
x=find(avg1==e);
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by Outguess 2.0')
end
end
end
SUB PROGRAM
function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
70
end
return;
MP3 STEGO
%Steganography
close all;
clear all;
clc;
warning off all;
addpath('mp3readwrite\')
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
71
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|
strcmp(TrainFiles(i).name ,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
ss=strcat('stego\',int2str(i),'.mp3');
[Y,FS,NBITS,OPTS] = mp3read(ss);
bi{i}=mean(mean(Y));
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
[namefile,pathname]=uigetfile('input\*.*','All Files');
a=find(namefile=='.')
if(namefile(a+1)=='w')
w=1;
elseif(namefile(a+1)=='m')
w=2;
end
if(w==2)
[Y1,FS,NBITS,OPTS] = mp3read(strcat(pathname,namefile));
bi1=Y1;
end
if(w==1)
[Y1,FS,NBITS,OPTS] = wavread(strcat(pathname,namefile));
bi1=Y1;
end
avg1=mean(mean(bi1));
x=find(avg1==e);
72
if (isempty(x))
msgbox('The Object is not a stego Object')
else
msgbox('The Object is a stego Object by MP3 Stego')
end
end
end
SUB PROGRAM
function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;
73
COMBINED CODING
%Steganography
%jsteg tool
close all;
clear all;
clc;
warning off all;
addpath('mp3readwrite\')
while 1
choise = menu('Automatic Identification',...
'Train Database',...
'Recognize',...
'Exit');
if choise==3
close all;
clc;
break;
elseif choise==1
% Train database
TrainFiles = dir('stego');
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|
strcmp(TrainFiles(i).name ,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images
in the training database
end
end
bi=[];
for i = 1:Train_Number
if(i<8 || (i>13 && i<21) )
stego_img = imread(strcat('stego\',int2str(i),'.jpg '));
74
end
if(i>7 && i<14)
stego_img = imread(strcat('stego\',int2str(i),'.gif '));
end
bi{i}=gray2bi(stego_img);
if(i>20)
ss=strcat('stego\',int2str(i),'.mp3');
[Y,FS,NBITS,OPTS] = mp3read(ss);
bi{i}=mean(mean(Y));
end
avg{i}=mean(mean(bi{i}));
end
msgbox('Database Trained')
e=cell2mat(avg);
elseif choise==2
% Check the image
[namefile,pathname]=uigetfile('input\*.*','All Files');
a=find(namefile=='.')
if(namefile(a+1)=='w')
w=1;
elseif(namefile(a+1)=='m')
w=2;
else
w=0;
end
if(w==0)
i1=imread(strcat(pathname,namefile));
bi1=gray2bi(i1);
end
if(w==2)
[Y1,FS,NBITS,OPTS] = mp3read(strcat(pathname,namefile));
bi1=Y1;
end
if(w==1)
[Y1,FS,NBITS,OPTS] = wavread(strcat(pathname,namefile));
bi1=Y1;
end
avg1=mean(mean(bi1));
x=find(avg1==e)
if(isempty(x))
75
x=0;
end
if (x<8 && x>0)
msgbox('The Object is a stego Object by Jsteg 4.0')
elseif (x > 7 && x <14)
msgbox('The Object is a stego Object by Stool 4.2 ')
elseif (x > 13 && x <21)
msgbox('The Object is a stego Object by Outguess 2.0')
elseif (x > 20)
msgbox('The Object is a stego Object by MP3 Stego')
else
msgbox('The Object is not a stego Object')
end
end
end
SUB PROGRAM
function b = gray2bi( g )
b(:,1) = g(:,1);
for i = 2:size(g,2),
b(:,i) = xor( b(:,i-1), g(:,i) );
end
return;
76
DWT & DCT EMBEDDING
clear all;
clc;
k=(imread('lena.jpg'));
figure;imshow(k)
for t=1:3
[c,s] = wavedec2(k(:,:,t),3,'db1');
o1=reshape(c(1:1024),[32 32]);
o2=reshape(c(1025:2048),[32 32]);
o3=reshape(c(2049:3072),[32 32]);
o4=reshape(c(3073:4096),[32 32]);
o5=reshape(c(4097:8192),[64 64]);
o6=reshape(c(8193:12288),[64 64]);
o7=reshape(c(12289:16384),[64 64]);
o8=reshape(c(16385:32768),[128 128]);
o9=reshape(c(32769:49152),[128 128]);
o10=reshape(c(49153:65536),[128 128]);
t1=[o1 o2;o3 o4];
t2=[t1 o5;o6 o7];
t3(:,:,t)=[t2 o8;o9 o10];
77
end
figure
imshow(t3)
msg=input('Enter the text \n','s');
u=double(msg);
msg1=dec2bin(msg,8);
i1=1;
for i=1:size(msg1,1)
for j=1:size(msg1,2)
mm(1,i1)=msg1(i,j);
i1=i1+1;
end
end
M=size(msg1,1)*size(msg1,2);
for t=1:3
% tt=reshape(t3(:,:,t),[1 (256*256)]);
[c,s] = wavedec2(k(:,:,t),3,'db1');
y=dct(c(1:1024));
c1(:,:,t)=y;
i1=1;
v=find(y>0);
save v v
for i=1
for j=1:M
o=dec2bin(y(i,v(j)),8);
o(8)=mm(i,j) ;
y(i,v(j))=bin2dec(o);
end
end
save y y
y1=idct(y);
c(1:1024)=y1;
re(:,:,t) = waverec2(c,s,'db1');
end
key=M
imwrite(uint8(re),'emb.tif')
figure
imshow(uint8(re))
78
DWT & DCT EXTRACTING
clc;
close all;
clear all;
k=imread('emb.tif');
figure('name','Input image for extraction','numbertitle','off')
imshow(k)
M=input('Enter the key \n');
for t=1
[c,s] = wavedec2(k(:,:,t),3,'db1');
y=dct(c(1:1024));
load v
load y
i1=1;j1=1;
for i=1
for j=1:M
o=dec2bin(y(i,v(j)),8);
mm(i1,j1)=o(8) ;
if(j1==8)
i1=i1+1;
j1=0;
79
end
j1=j1+1;
end
end
end
% Extracted
Ex=bin2dec(mm)
Extracted=char(Ex)'
80