資源簡介
很好的圖像加密程序
代碼片段和文件信息
close?all;
%?clear?all;
prompt={‘The?key‘‘The?first?block?key‘‘The?second?block?key‘‘The?third?block?key‘‘The?fourth?block?key‘};
title=‘Encrption?Key?Setting‘;
def={‘100‘‘100‘‘100‘‘100‘‘100‘};
answer=inputdlg(prompttitle1def);
if?isempty(answer)?return;?end;
%tic;
key=str2num(answer{1});
key1=str2num(answer{2});
key2=str2num(answer{3});
key3=str2num(answer{4});
key4=str2num(answer{5});
iptsetpref(‘ImshowBorder‘‘tight‘);
I=loadimage(‘F:\研究生論文\圖像加密\圖片\‘);
figure(‘name‘‘原圖像‘)imshow(I);
if?isempty(I)
????return;
end
%?加密
if?mode==1
????tic;
????????J=encrption(Ikeykey1key2key3key4);
????????disp([‘Original?entropy:?‘?num2str(entropy(I(::1)))]);
????????disp([‘Encrypted?entropy:?‘?num2str(entropy(J(::1)))]);
????????h1=figure(‘Name‘‘Original?histogram‘‘Pos‘[50?600?320?280]);imhist(I(::1));
????????h2=fi
- 上一篇:后方-前方交會
- 下一篇:matlab打開las文件
評論
共有 條評論