Info

此问题已关闭。 请重新打开它进行编辑或回答。

plz,explain the code.

1 次查看(过去 30 天)
Md.Simul Hasan Talukder
关闭: Rik 2019-1-28
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 个)

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by