Wednesday, May 30, 2012

EFFICIENT STEGANOGRAPHY USING LSB AND ENCRYPTION TECHNIQUE

 EFFICIENT STEGANOGRAPHY USING LSB AND ENCRYPTION TECHNIQUE


Steganography is the process of hiding one file inside another such that others can neither identify the meaning of the embedded object, nor even recognize its existence.  Current trends favor using digital image files as the cover file to hide another digital file that contains the secret message or information. Steganography become more important as more people join the cyberspace revolution. Steganography is the art of concealing information in ways that prevent the detection of hidden messages. The goal of steganography is to avoid drawing suspicion to the existence of a hidden message. This approach of information hiding technique has recently become important in a number of application areas. Digital audio, video, and pictures are increasingly furnished with distinguishing but imperceptible marks, which may contain a hidden copyright notice or serial number or even help to prevent unauthorized copying directly. Military communications system make increasing use of traffic security technique which, rather than merely concealing the content of a message using encryption, seek to conceal its sender, its receiver or its very existence. Similar techniques are used in some mobile phone systems and schemes proposed for digital elections. One of the most common methods of implementation is Least Significant Bit Insertion, in which the least significant bit of every byte is altered to form the bit-string representing the embedded file.  Altering the LSB will only cause minor changes in color, and thus is usually not noticeable to the human eye.  While this technique works well for 24-bit color image files, steganography has not been as successful when using an jpeg color image file, due to limitations in color variations and the use of a color map. The advantages of LSB are its simplicity to embed the bits of the message directly into the LSB plane of cover-image and many techniques use these methods . Modulating the LSB does not result in a human-perceptible difference because the amplitude of the change is small. Therefore, to the human eye, the resulting stego-image will look identical to the cover-image. This allows high perceptual transparency of LSB. Another level of security adds to steganography by using an encryption technique for encrypting message before adding to image.


Matlab Code 


1 Sender programme

clear all
clc;
close all;
x1=input('enter the location to start: ')
X=input('enter msg: ');
pt=double(X);
X=encrypt(pt);
Y=uint16(X);
l=length(Y);
B=dec2bin(Y,16);
RB(1,:)=B(1,:);
for i=2:l
    RB=[RB,B(i,:)];
end
lll=length(RB);
M=imread('7.bmp');
subplot(2,2,1);
imshow('7.bmp');
title('Original image');
x=size(M);
m=1;
M(x1(1)-1,x1(2)-2,1)=l;
M(x1(1)-2,x1(2)-2,1)=lll;
for ii=x1(1):x(1)
    for jj=x1(2):x(2)
        if(m<=lll)
            if(RB(1,m)=='0')
                if(mod(M(ii,jj,1),2)==1)
                    M(ii,jj,1)=M(ii,jj,1)-1;
    %                 disp('error1')
                end
            else
                if(mod(M(ii,jj,1),2)==0)
                    M(ii,jj,1)=M(ii,jj,1)+1;
    %                 disp('error2')
                end
            end
            m=m+1;
        else
            break;
        end
    end
end
imwrite(M,'6.bmp');
subplot(2,2,2);
imshow('6.bmp');
title('Stego image');


2. Receiver Programme

clear all
clc;
close all;
x1=input('enter the location of message: ');
M1=imread('6.bmp');
x=size(M1);
%l=input('enter length of msg: ');
%lll=16*l;
cc=1;
l=double(M1(x1(1)-1,x1(2)-2,1));
lll=double(M1(x1(1)-2,x1(2)-2,1));
for ii=x1(1):x(1)
    for jj=x1(2):x(2)
        if(cc<=lll)
            RRB(1,cc)=dec2bin(mod(M1(ii,jj,1),2));
            cc=cc+1;
        else
            break
        end
    end
end
for ll=1:cc/16
    RBB(ll,1:16)=RRB(1,(ll-1)*16+1:ll*16);
  
end
RRR=bin2dec(RBB);
RR=uint16(RRR);
RR=reshape(RR,1,l);
RR1=double(RR);
rr1=decrypt(RR1);
char(rr1)


The above programme is a part of programme

Download Full Matlab code for Steganography


Download Project report



Download Project Presentation



1 comments:

  1. hello sir thanks for ur code
    i am getting some problem in running this code
    please tell me steps to run this code

    ReplyDelete