📄 secread.m
字号:
function V=secread(B,key,len)
%this program takes a tiled matrix B that has hidden data in it using the
%bit-o-steg method and extracts the binary stream back out
%in addition to bit-o-steg you need a key and the length of the message
[dnk dnk x dnk]=size(B);
[dnk keylen]=size(key);
row=1;
col=1;
coeffcounter=1;
keycounter=1;
datacounter=1;
data=[];
char(data);
for i=1:x
for j=1:x
for n=1:8
for m=1:8
%this works just like the stegcompress, only reading instead of
%writing
if (coeffcounter==key(keycounter)&(abs(B(n,m,i,j))>0)&(datacounter<=len))
sign=B(n,m,i,j)/abs(B(n,m,i,j));
temp=dec2bin(abs(B(n,m,i,j)));
siz=size(temp,2);
data(datacounter)=temp(siz-key(keycounter)+1);
datacounter=datacounter+1;
keycounter=keycounter+1;
if(keycounter>keylen)
keycounter=1;
end
coeffcounter=1;
else
if (abs(B(n,m,i,j))>0)
coeffcounter=coeffcounter+1;
end
end
end
end
end
end
V=data;
V=char(V);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -