资源简介

南开大学信息隐藏大作业之一,实现简单的可是密码或者是叠相术,本方案是一种比较创新的方案,重点自己看

资源截图

代码片段和文件信息


imfinfo ‘lbc1.bmp‘;
lbc=imread(‘lbc1.bmp‘);
for i=1:ans.Height
    for j=1:ans.Width
        random=rand()*4;
        if(random<1)
            L(ij)=1;L(ij+1)=1;L(i+1j)=0;L(i+1j+1)=0;
            B(ij)=1;B(ij+1)=0;B(i+1j)=1;B(i+1j+1)=0;
            C(ij)=1;C(ij+1)=0;C(i+1j)=0;C(i+1j+1)=1;
        else
            if(random<2)
                L(ij)=1;L(ij+1)=1;L(i+1j)=0;L(i+1j+1)=0;
                B(ij)=0;B(ij+1)=1;B(i+1j)=0;B(i+1j+1)=1;
                C(ij)=0;C(ij+1)=1;C(i+1j)=1;C(i+1j+1)=0;
            else
                if(random<3)
                    L(ij)=0;L(ij+1)=0;L(i+1j)=1;L(i+1j+1)=1;
                    B(ij)=1;B(ij+1)=0;B(i+1j)=1;B(i+1j+1)=0;
                    C(ij)=0;C(ij+1)=1;C(i+1j)=1;C(i+1j+1)=0;
                else
                    if(random<4) 
                        L(ij)=0;L(ij+1)=0;L(i+1j)=1;L(i+1j+1)=1;
                        B(ij)=0;B(ij+1)=1;B(i+1j)=0;B(i+1j+1)=1; 
                        C(ij)=1;C(ij+1)=0;C(i+1j)=0;C(i+1j+1)=1;
                    end
                end
            end
        end
    end 
end

for i=1:ans.Height
    for j=1:ans.Width
        if(lbc(ij)==0)
            random=rand()*4;
            if(random<1)
                L(ij)=0;L(ij+1)=0;L(i+1j)=1;L(i+1j+1)=1;
                B(ij)=0;B(ij+1)=1;B(i+1j)=0;B(i+1j+1)=1;
                C(ij)=0;C(ij+1)=1;C(i+1j)=1;C(i+1j+1)=0;
            else
                if(random<2)
                    L(ij)=0;L(ij+1)=0;L(i+1j)=1;L(i+1j+1)=1;
                    B(ij)=1;B(ij+1)=0;B(i+1j)=1;B(i+1j+1)=0;
                    C(ij)=1;C(ij+1)=0;C(i+1j)=0;C(i+1j+1)=1;
                else
                    if(random<3)
                        L(ij)=1;L(ij+1)=1;L(i+1j)=0;L(i+1j+1)=0;
                        B(ij)=0;B(ij+1)=1;B(i+1j)=0;B(i+1j+1)=1;
                        C(ij)=1;C(ij+1)=0;C(i+1j)=0;C(i+1j+1)=1;
                    else
                        if(random<4)
                            L(ij)=1;L(ij+1)=1;L(i+1j)=0;L(i+1j+1)=0;
                            B(ij)=1;B(ij+1)=0;B(i+1j)=1;B(i+1j+1)=0; 
                            C(ij)=0;C(ij+1)=1;C(i+1j)=1;C(i+1j+1)=0;
                        end
                    end
                end
            end
        end
    end
end
imwrite(L‘0l.bmp‘‘bmp‘);
imwrite(B‘2b.bmp‘‘bmp‘);
imwrite(C‘1c.bmp‘‘bmp‘);

L1=imread(‘0l.bmp‘); 
B1=imread(‘2b.bmp‘); 
C1=imread(‘1c.bmp‘);
random=rand()*3;
if(random<1)
    lbc=L1;lb=L1;lc=L1;bc=L1;
else
    if(random<2)
        lbc=B1;lb=B1;lc=B1;bc=B1;
    else
        lbc=C1;lb=C1;lc=C1;bc=C1;
    end
end

for i=1:ans.Height+1
    for j=1:ans.Width+1
        if((xor(xor(L1(ij)B1(ij))C1(ij))==0)&&(xor(xor(L1(i+1j)B1(i+1j))C1(i+1j))==0)&&(xor(xor(L1(i+1j+1)B1(i+1j+1))C1(i+1j+1))==0)&&(xor(xor(L1(ij+1)B1(ij+1))C1(ij+1))==0))
            lbc(ij)=0; 
        else

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件      754078  2012-05-17 02:48  0l.bmp
     文件      754078  2012-05-17 02:48  1c.bmp
     文件      754078  2012-05-17 02:48  2b.bmp
     文件      754078  2012-05-17 02:48  3bc.bmp
     文件      754078  2012-05-17 02:48  4lb.bmp
     文件      754078  2012-05-17 02:48  5lc.bmp
     文件        3716  2012-05-17 02:44  lbc0.asv
     文件        3716  2012-04-22 18:37  lbc0.m
     文件       95934  2012-04-22 02:33  lbc1.bmp
     文件      754078  2012-05-17 02:48  lbc2.bmp
     文件     2351104  2012-05-17 02:50  可视密码.ppt

评论

共有 条评论