You have no items in your shopping cart.

Subtotal: 0.00

LSB Algorithm

Steganography is a branch of information hiding. It allows the people to communicate secretly. Asincreasingly more material becomes available electronically, the influence of steganography on our liveswill continue to grow. Many confidential information were leaked to a rival firm using steganographic toolsthat hid the information in music and picture files. The application of steganography is an importantmotivation for feature selection. A new steganographic algorithm for 8bit(grayscale) or 24bit (colour image) is presented in this article, based on Logical operation. Algorithm embedded Ascii code of text in to LSB of cover image.

Demonstration Video

Cover-Image: An image in which the secret information is going to be hidden. The term "cover" is used to describe the original, innocent message, data, audio, still, video etc. The cover image is sometimes called as the "host".

Stego-Image: The medium in which the information is hidden. The "stego" data is the data containing both the cover image and the "embedded" information. Logically, the processing of hiding the secret information in the cover image is known as embedding.

Payload: The information which is to be concealed. The information to be hidden in the cover data is known as the "embedded" data.

Secret key: This is the key used as a password to encrypt and decrypt the cover and stego respectively in order to extract the hidden message. Secret key is optional.

Block Diagram of Steganography







Matlab code for LSB Steganography

Data Hiding

target=imread(‘image.jpg’);
fid = fopen('message.txt','r');
F = fread(fid);
s = char(F');
fclose(fid);
 
sz1=size(original);
size1=sz1(1)*sz1(2);
sz2=size(F);
size2=sz2(1);
 
if size2> size1
fprintf('\nImage File Size  %d\n',size1);
fprintf('Text  File Size  %d\n',size2);
disp('Text File is too Large');
else
fprintf('\nImage File Size  %d\n',size1);
fprintf('Text  File Size  %d\n',size2);
disp('Text File is Small');
    i=1;j=1;k=1;
while k<=size2
        a=F(k);
        o1=original(i,j,1);
        o2=original(i,j,2);
        o3=original(i,j,3);
 
        [r1,r2,r3]=hidetext(o1,o2,o3,a);
 
        target(i,j,1)=r1;
        target(i,j,2)=r2;
        target(i,j,3)=r3;
 
if(i<sz1(1))
                i=i+1;
else
                i=1;
                j=j+1;
end
            k=k+1;
end
        width=sz1(1);
txtsz=size2;
        n=size(original);
        target(n(1),n(2),1)=txtsz;% Text Size
        target(n(1),n(2),2)=width;% Image's Width
%save secret.mat target;% txtsz width;
imwrite(target,'secret.bmp','bmp');
 
imshow(target)
 
end
helpdlg('data hided succesfully in secret.bmp');

Date Retrieval

target=imread(‘stego.bmp’);
        n=size(target);
txtsz=target(n(1),n(2),1);% Text Size
        width=target(n(1),n(2),2);% Image's Width
 
        i=1;j=1;k=1;
while k<=txtsz
 
        r1=target(i,j,1);
        r2=target(i,j,2);
        r3=target(i,j,3);
 
        R(k)=findtext(r1,r2,r3);
 
if(i<width)
             i=i+1;
else
            i=1;
            j=j+1;
end
            k=k+1;
end
 
        fid = fopen('secret.txt','wb');
fwrite(fid,char(R),'char');
fclose(fid);
 
helpdlg('data Retrivedsuccesfully in secret.txt');

Function for findtext

function data = findtext(redc,greenc,bluec)
txt=0;
ifbitand(redc,4)== 4
txt=bitor(txt,128);
end
ifbitand(redc,2)== 2
txt=bitor(txt,64);
end
ifbitand(redc,1)== 1
txt=bitor(txt,32);
end
ifbitand(greenc,4)== 4
txt=bitor(txt,16);
end
ifbitand(greenc,2)== 2
txt=bitor(txt,8);
end
ifbitand(greenc,1)== 1
txt=bitor(txt,4);
end
ifbitand(bluec,2)== 2
txt=bitor(txt,2);
end
ifbitand(bluec,1)== 1
txt=bitor(txt,1);
end
data=txt;
return

Function for hidetext

 
function[red,green,blue]=hidetext(redc,greenc,bluec,text)
 red=bitand(redc,248);
green=bitand(greenc,248);
blue=bitand(bluec,252);
txt=0;
 ifbitand(text,128)== 128
red=bitor(red,4);
end
 
ifbitand(text,64)== 64
    red=bitor(red,2);
end
 
ifbitand(text,32)== 32
    red=bitor(red,1);
end
 
ifbitand(text,16)== 16
    green=bitor(green,4);
end
 
ifbitand(text,8)== 8
    green=bitor(green,2);
end
 
ifbitand(text,4)== 4
    green=bitor(green,1);
end
 
ifbitand(text,2)== 2
    blue=bitor(blue,2);
end
 
ifbitand(text,1)== 1
    blue=bitor(blue,1);
end
 
return

Gui for LSB steganography




LSB Steganography