Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
plz,explain the code.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
function [secret_img] = lsbstego(secret_img, text)
%% Data Hiding
secret_img=double(secret_img);
val = [double(text) 0]; %Coverting secret text to ASCII representation
[~, siz2] = size(secret_img);
i = 1; j = 1;
for y = 1:length(val)
data = val(y); %data is the character in the secret text to be hidden
bit = 128; %Counter variable
while bit > 0 %Clearing the LSB of a pixel
secret_img(i, j) = floor(secret_img(i, j)/2);
secret_img(i, j) = secret_img(i, j)*2;
if bitand(data, bit) > 0 %Setting the LSB of pixel to the information bit
secret_img(i, j) = secret_img(i,j)+1;
end
j = j+1;
if j > siz2
i = i+1;
j = 1;
end
bit = floor(bit/2);
end
end
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!