Monday, 16 December 2013

MATLAB Implementation of Steganography (Simple Data Hiding Method).


AIM: Study & Implementation of Steganography (Simple Data Hiding Method).
THEORY:
Modern information hiding technology is an important branch of information security. The redundancy of digital media, as well as the characteristic of human visual system, makes it possible to hide messages. Information hiding technology used in covert communication is named as steganography. Steganography is the art and science of invisible communication. Three competing aspects, including capacity, security, and robustness, are usually considered in the designing of information hiding schemes.
Security means invisibility and keeping undetectable. Capacity refers to the maximal secure payload. The Robustness relates to amount of modification the stego-object can withstand before an adversary can destroy the hidden information. Basic difference between encryption and steganography is that encryption hides information contents whereas steganography hides information existence.

Generally speaking, robustness is often emphasized in applications of digital watermarking rather than steganography. Security and enough hiding capacity should be needed for desired steganography algorithms. Our aim is to embed sufficient secret message bits into cover image, so as to ensure the effectiveness of communications. At the same time, observable changes of cover objects ought to be avoided after information embedding, so as to ensure the security of communications.

Fig: Simple Steganography Method

Fig: Types of Steganography System
PROCEDURE:
1. Read one gray scale image from current directory.
2. Apply bit-plane slicing function on that image. 
3. Above function gives you 8 bitplanes. Now aim is to replace LSB bitplane with Secrete image, but it has one constraint size of input cover image and secrete image should be same.


PROGRAM:
Function Bitplane Slicing:

function [pl1 pl2 pl3 pl4 pl5 pl6 pl7 pl8]=bitplane_slice(img)
[r c p]=size(img);
b=zeros(r,c,8);

for k=1:8
    for i=1:r
        for j=1:c
            b(i,j,k)=bitget(img(i,j),k);
        end
    end
end
pl1=b(:,:,1);
pl2=b(:,:,2);
pl3=b(:,:,3);
pl4=b(:,:,4);
pl5=b(:,:,5);
pl6=b(:,:,6);
pl7=b(:,:,7);
pl8=b(:,:,8);
end

Test Application Steganography:

clc
[file path]=uigetfile('*.*');
img=imread(file);
[r c p]=size(img);
[pl1 pl2 pl3 pl4 pl5 pl6 pl7 pl8]=bitplane_slice(img);
figure;
subplot(3,3,1);imshow(pl1);title('pln 1')
subplot(3,3,2);imshow(pl2);title('pln 2')
subplot(3,3,3);imshow(pl3);title('pln 3')
subplot(3,3,4);imshow(pl4);title('pln 4')
subplot(3,3,5);imshow(pl5);title('pln 5')
subplot(3,3,6);imshow(pl6);title('pln 6')
subplot(3,3,7);imshow(pl7);title('pln 7')
subplot(3,3,8);imshow(pl8);title('pln 8')

sec=imread('binary.png');
new_sec=imresize(sec,[r c]);
stego=new_sec+pl2*2+pl3*4+pl4*8+pl5*16+pl6*32+pl7*64+pl8*128;
figure;
subplot(1,2,1);imshow(new_sec);title('Sec image')
subplot(1,2,2);imshow(uint8(stego));title('Stego image')
[pl1 pl2 pl3 pl4 pl5 pl6 pl7 pl8]=bitplane_slice(stego);
figure;
subplot(3,3,1);imshow(pl1);title('pln 1')
subplot(3,3,2);imshow(pl2);title('pln 2')
subplot(3,3,3);imshow(pl3);title('pln 3')
subplot(3,3,4);imshow(pl4);title('pln 4')
subplot(3,3,5);imshow(pl5);title('pln 5')
subplot(3,3,6);imshow(pl6);title('pln 6')
subplot(3,3,7);imshow(pl7);title('pln 7')
subplot(3,3,8);imshow(pl8);title('pln 8')


OUTPUTS:
Bit-plane slicing of a given Grayscale Image:

Given Secrete Image and Final Stego Image:
Embedding operation check: 
Applying Bit-plane slicing function to Stego Image for checking whether Secret Image embedded or not.   

12 comments:

  1. Thank you friend for giving such simple information. Definitely useful .

    ReplyDelete
  2. its ok bro......keep in touch....

    ReplyDelete
  3. giving error
    Error using ==> plus
    Integers can only be combined with integers of the same class, or scalar
    doubles.
    stego=new_sec+pl2*2+pl3*4+pl4*8+pl5*16+pl6*32+pl7*64+pl8*128;

    ReplyDelete
  4. hey will u plz send me matlab code of the data hiding by LSB subsitution. I will very thankful to you.

    ReplyDelete
  5. hey can u please send me the code?
    Im doing stagnography and watermaking as my final yr proj.. can u plz send me the code?
    thank u
    email - manushimn@gmail.com

    ReplyDelete
  6. HI ARJUN,
    CAN YOU SEND ME THE LSB STENOGRAPHY CODE ON diamondjonawal@gmail.com
    thanks

    ReplyDelete
  7. hi
    can u please send me tha matlab code for data hiding using DCT/DWT???????
    farhana.tasneemsyeda@gmail.com

    ReplyDelete
  8. Hi dear, I want to draw the capacity via PSNR graph for varying capacity values. How can I calculate different capacity values on embedding the same data? my id: nazeer_saadi@yahoo.com

    ReplyDelete
  9. hi
    can u please send me the Matlab code for datahiding using pvd and dct
    soundarya.rubi02@gmail.com

    ReplyDelete
  10. can you help me .in my project am using msb substitution..can you have any idea about how we select msb value of cover image

    ReplyDelete
  11. hi sir.can u please send me matlab code for data hiding in lower information channel of colour image

    ReplyDelete