www.pudn.com > zishiyingjiami.rar > Bmain.m, change:2011-12-09,size:721b


%按行列加解密 
clc; 
close all; 
A=imread('lena128.bmp'); 
subplot(3,3,1),imshow(uint8(A));title('原图'); 
[m,n]=size(A); 
A=double(A); 
A1=HUD(A); 
subplot(3,3,2),imshow(uint8(A1));title('从上到下行加密'); 
A2=HDU(A1); 
subplot(3,3,3),imshow(uint8(A2));title('从下到上行加密'); 
A3=LLR(A2); 
subplot(3,3,4),imshow(uint8(A3));title('从左到右列加密'); 
A4=LRL(A3); 
subplot(3,3,5),imshow(uint8(A4));title('从右到左列加密'); 
%解密 
A5=LLRJ(A4); 
subplot(3,3,6),imshow(uint8(A5));title('从右到左列解密'); 
A6=LRLJ(A5); 
subplot(3,3,7),imshow(uint8(A6));title('从左到右列解密'); 
A7=HUDJ(A6); 
subplot(3,3,8),imshow(uint8(A7));title('从上到下行解密'); 
A8=HDUJ(A7); 
subplot(3,3,9),imshow(uint8(A8));title('从下到上行解密');