www.pudn.com > zishiyingjiami.rar > UTDJ.m, change:2011-12-08,size:714b


function A8=UTDJ(A) 
%上对下重构解密 
[m,n]=size(A); 
for i=1:m 
    for j=1:n 
        if i<=m/2 
            A1(i,j)=A(i,j);  %F1=A3(原图上下异或结果) 
        else 
            A2(i-m/2,j)=A(i,j);  %F2=A4(下对上置乱结果) 
        end 
    end 
end 
A3=bitxor(double(A1),double(A2)); 
[m1,n1]=size(A3); 
A4=zeros(1,m1*n1); 
A5=zeros(1,m1*n1); 
A6=zeros(1,m1*n1); 
for i=1:m1 
    for j=1:n1 
        A4((i-1)*n1+j)=A1(i,j); 
        A5((i-1)*n1+j)=A3(i,j); 
    end 
end 
A6=vper(A5,A4); 
for i=1:m1 
    for j=1:n1 
        A7(i,j)=A6((i-1)*n1+j); 
    end 
end 
for i=1:m 
    for j=1:n 
        if i<=m/2 
            A8(i,j)=A1(i,j); 
        else 
            A8(i,j)=A7(i-m/2,j); 
        end 
    end 
end