397095991247900827image-encryption
所属分类:其他
开发工具:matlab
文件大小:172KB
下载次数:2
上传日期:2020-04-26 07:18:29
上 传 者:
1115342
说明: clear;clc;
%提取位图的数据
x=imread('加密后的lena.bmp','bmp');
[a,b]=size(x);
N=a*b;
m(1)=input('请输入解密密钥: ');
disp('解密中');
%产生logistic混沌序列
for i=1:N-1
m(i+1)=4*m(i)-4*m(i)^2;
end
m=mod(1000*m,256);
m=uint8(m);
%使用logistic对图像加密
n=1;
for i=1:a
for j=1:b
e(i,j)=bitxor(m(n),x(i,j));
n=n+1;
end
end
%写数据
imwrite(e,'解密后的lena.bmp','bmp');
disp('解密成功');
%打开加密后文件
winopen('解密后的lena.bmp');
(clear;clc;
%Extract bitmap data
X = imread ('encrypted Lena. BMP ',' BMP ');
[a,b]=size(x);
N=a*b;
M (1) = input ('Please input decryption key: ');
Disp ('decrypting ');
%Generating Logistic chaotic sequence
for i=1:N-1
m(i+1)=4*m(i)-4*m(i)^2;
End
m=mod(1000*m,256);
m=uint8(m);
%Using logistic to encrypt image
N=1;
for i=1:a
for j=1:b
e(i,j)=bitxor(m(n),x(i,j));
N=n+1;
End
End
%Write data
Imwrite (E, 'decrypted Lena. BMP', 'BMP');
Disp ('decryption succeeded ');
%Open encrypted file
Winopen ('lena. BMP 'after decryption);)
文件列表:
397095991247900827image-encryption (0, 2020-04-26)
397095991247900827image-encryption\hslogic.txt (215, 2019-07-14)
397095991247900827image-encryption\image encryption (0, 2020-04-14)
397095991247900827image-encryption\image encryption\decrypt1.m (493, 2014-04-01)
397095991247900827image-encryption\image encryption\encrypt1.m (489, 2014-04-01)
397095991247900827image-encryption\image encryption\lena.bmp (66616, 2005-11-09)
397095991247900827image-encryption\image encryption\logistic_bmp.m (1288, 2019-04-19)
397095991247900827image-encryption\image encryption\加密后的lena.bmp (66614, 2019-04-19)
397095991247900827image-encryption\image encryption\解密后的lena.bmp (66614, 2014-04-01)
近期下载者:
相关文件:
收藏者: