i need a code for hiding a text in an image using lsb technique
Afficher commentaires plus anciens
hello, i need a code to hide a message in an image using lsb technique(Steganography).... im new user to use a matlab... i just only knew the basic command of matlab.... plzzzzzzzzz help
17 commentaires
sagar hepat
le 28 Oct 2014
c = imread('any_image.jpg');
message = 'hi this is sagar from nagpur..'
message = strtrim(message);
m = length(message) * 8;
AsciiCode = uint8(message);
binaryString = transpose(dec2bin(AsciiCode,8));
binaryString = binaryString(:);
N = length(binaryString);
b = zeros(N,1); %b is a vector of bits
for k = 1:N
if(binaryString(k) == '1')
b(k) = 1;
else
b(k) = 0;
end
end
s = c;
height = size(c,1);
width = size(c,2);
k = 1; Array=[];l=1;my=1;
for i = 1 : height
for j = 1 : width
LSB = mod(double(c(i,j)), 2);
if (k>m || LSB == b(k))
s(i,j) = c(i,j);
l=k+1;
else
if(LSB == 1)
s(i,j) = c(i,j) - 1;
else
s(i,j) = c(i,j) + 1;
Array(my)=l;
l=l+1;
my= my + 1;
end
k = k + 1;
end
end
end
imwrite(s, 'hiddenmsgimage.bmp');
k = 1;my=1;ur=1;
for i = 1 : height
for j = 1 : width
if( k<=m )
if (my<numel(Array) && Array(my)==ur)
b(k)=~(mod(double(s(i,j)),2));
else
b(k) = mod(double(s(i,j)),2);
end
k = k + 1;
my= my + 1;
end
ur=ur+1;
end
end
try this dude enjoy
Jadem Molina
le 4 Nov 2014
hello, How can I get the hidden data on the Image. Thanks!
vaishali sharma
le 9 Avr 2015
Déplacé(e) : DGM
le 5 Fév 2023
hello sir m beginner and m implementing lsb but i didnt get why we are using : for k = 1:N if(binaryString(k) == '1') b(k) = 1; else b(k) = 0; end end
Akhil Ram Sai
le 3 Avr 2016
can you also comment the code for reconstruction of the text
Walter Roberson
le 3 Avr 2016
Akhil Ram Sai, who are you addressing that to? sagar hepat is unlikely to see your request a year and half after they posted the question, and the volunteers who read this are likely to refer you to http://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22steganography%22 as a number of other people have already commented their reconstruction code.
hudof najeeb
le 4 Déc 2016
can you give me the decoded to return back the hidden text from the original and the encoded image ...please
Image Analyst
le 4 Déc 2016
hudof najeeb
le 5 Déc 2016
sir,it was very interesting program but it used gray-level image .I want color image.how i can get it and if I want to get the hide text from cover image what i must do ?I mean the second part when I have original and cover image thx
Walter Roberson
le 5 Déc 2016
Reshape your color image to rows by (columns * 3) and now the code cannot tell it was not just a wide gray image. Afterwards, reshape() it back.
Image Analyst
le 5 Déc 2016
Or you can just extract one color channel, encode the text into it, then stick it back in.
Amal
le 12 Nov 2022
i need a code for hiding a text in an image using lsb technique ?
Image Analyst
le 12 Nov 2022
@Amal see attached
Image Analyst
le 12 Nov 2022
Déplacé(e) : DGM
le 5 Fév 2023
What do you mean by the image is inside the button? How can you have an image inside the button? You mean a button with a little picture or icon on it? An image that could fit inside a button would most likely not have enough pixels in it to hide anything. Then there's the problem of getting the image out of the button. Why do you want/need to do this anyway?
Walter Roberson
le 13 Nov 2022
Déplacé(e) : DGM
le 5 Fév 2023
If you have a uicontrol style 'edit' (traditional figures), or if you have a uitext (uifigures) and those have text in them, then matlab does not provide any way itself to find out what text is selected.
The same is true for edit fields.
You can find out which cells of a table are selected, or which entries of a list box or drop box are selected, but not what text is selected within a field.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!