资源简介
matlab开发-该算法基于密钥对图像进行解密和加密。

代码片段和文件信息
%%
% Purpose:
%
% This algorithm decrypts and encrypts images based on keys
%
% INPUTS:
%
%
%
% imMat: If the nargin is one imMat is the filename of the image which
% you would like to encrypt. If the nargin is 4 imMat is the encrypted
% matrix
%
% key1 key2 key3: These are number values used to encrypt and decrypt
% images.
% key3 and key2 and key1 can be left blank if the nargin is one and you would like
% the computer to make the keys for you. if the nargin is 4 key1 is
% a vector at baseto that is the encrypted vector of the original random numbers.
% key2 is the base of the original vector (baseKey) **Please
% read the help section of baseVecExpand.
%
% OUTPUTS:
%
% cryptPic: If the nargin = 1 cryptPic is a matrix of encrypted
% numbers representing an encrypted image. If the nargin = 4 imMat
% is a uint8 array which is a decrypted image. This function will also
% display the decrypted image.
%
% keyVec: If the nargin = 1 the computer will use the random number generator to
% make three keys. These three keys are then changed to a random base baseto
% using baseVecExpand. The starting base is baseKey.
% keyVec is a vector containing the key vector at baseto. if nargin = 4
% keyVec is not returned
%
% baseKey: If the nargin = 1 baseKey is the base of the
% original vector. please read the help section of baseVecExpand. baseKey
% is not returned if the nargin = 4.
%
% COMMENTS:
%
% Please change the formulas used to encrypt and decrypt the images into
% your own unique formulas so that nobody can see your images.
function [cryptPic keyVec baseto baseKey] = picCrypt(imMatkeykey2key3)
if nargin == 1
key = rand;
key2 = rand;
key3 = rand;
baseto = rand*1000;
baseKey = max(floor(1000000*[key key2 key3])) + rand*100;
keyVec = baseVecExpand(floor(1000000*[key key2 key3])baseKeybaseto);
pic = 10000*im2double(imread(imMat));
cryptPic = ((floor(pic)/key2).^key)+key3;
imagesc(im2uint8(cryptPic));
axis equal;
axis tight;
elseif nargin == 4
key10 = baseVecExpand(keykey3key2)/1000000;
cryptPic = im2uint8(((imMat - key10(3)).^(1/key10(1))*key10(2))/10000); % CHANGE THIS FORMULA (this is the opposite of the formula above
imagesc(cryptPic);
axis equal;
axis tight;
else
error(‘You must enter the correct number of parameters‘);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2403 2011-02-17 05:02 picCrypt.m
文件 1316 2014-02-12 13:26 license.txt
相关资源
- matlab开发-能带计算
- matlab开发-FlockingAlgorithm
- matlab开发-MuellerStokesJonesCalculus
- matlab开发-HX711的自定义数据库
- matlab开发-SMOTEBoost
- matlab开发-果蝇优化算法第二版
- matlab开发-多变量决策树
- matlab开发-水轮发电机模型
- matlab开发-交通警告标志识别标签代码
- matlab开发-RUSBoost
- matlab开发-基于遗传算法的机器人运动
- matlab开发-MPU6050加速度陀螺仪
- matlab开发-功率曲线FAsmallscalewindturbi
- matlab开发-NASAJPLDE405开发星历表
- matlab开发-SortinoRatio
- matlab开发-永磁TDC并联电机数学模型
- matlab开发-3相SPWM整流器
- matlab开发-Kilobotswarm控制Matlabarduino
- matlab开发-简单音频播放
- matlab开发-记录文件的绘图仪加速度、
- matlab开发-永磁同步电机PMSM动态数学模
- matlab开发-多目标优化差分进化算法
- matlab开发-随机微分方程解算
- matlab开发-波长调制光谱的二次谐波模
- matlab开发-仿制药生物生理学基础药动
- matlab开发-使用svmrfe选择功能
- matlab开发-KDTreeNearestNeighborandRangeSear
- matlab开发-stlread
- matlab开发-三维图像堆栈查看器
- matlab开发-动态电压恢复器故障dvr
评论
共有 条评论