资源简介
RSA加密及解密的MATLAB源程序
有需要的,可以下

代码片段和文件信息
function outp = rsadec(inpkey)
% RSADEC - rapidly decrypt a short message using RSA
%
% pt=rsadec(ctkey)
%
% ct = cyphertext (uint8 vector) created by RSAENC
% key = private or public key created by the RSAKEYS function
% pt = plaintext message (a vector of type uint8) which you may
% wish to convert to text using “char(pt)“
%
% Notes: (1) This function uses Java which contains the calculation
% routines
% (2) The usual use of RSA is for encryption of keys in a “key
% exchange“ so the plaintext size limits provided by the Java
% routines (which are adequate for that purpose) have not been
% expanded here. (For example a 128-bit AES encryption key
% requires only 16 bytes.) See the RSAENC function.
% (3) An RSA “key“ consists of two quatities: a modulus and an
% exponent. RSA keys always come in pairs with one key denoted
% “public“ and the other as “private.“ A message that is
% encrypted using EITHER key must be decrypted using the OTHER
% key. You keep the private key secret and broadcast the public
% key. Anyone can then encrypt any message to you using the
% public key but no one but you can decrypt it (not even the
% sender) since only you have the secret key. Also you can
% encrypt a message using your private key and anyone can
% decrypt it using the public key. The benefit is that they then
% know for sure that you are the person who generated the
% message.
% (4) RSA modulus and exponent selection have certain nuances
% beyond the basic numerical calculations. In particular
% certain values for various components of the key generation
% can result in encryption weaknesses. For this reason you
% may choose to avoid generating RSA key pairs yourself and
% instead rely upon “official“ key generation code such as the
% Java routines used in this function.
% (5) As of 2005 “RSA Laboratories currently recommends key
% sizes of 1024 bits for corporate use and 2048 bits for
% extremely valuable keys....“ For more information see
% http://www.rsasecurity.com/rsalabs/node.asp?id=2218
% (6) As of 2005 the US National Institue of Standards and
% Technology claims that 2048 bit keys for RSA will remain
% resistant to cracking until about 2030.
% (7) Tested but no warranty; use at your own risk.
% (8) Michael Kleder Nov 2005
%
% EXAMPLE:
%
% [pripub]=rsakeys(1024);
% char(rsadec(rsaenc(‘This is a secret.‘pub)pri))
% char(rsadec(rsaenc(‘This is a secret.‘pri)pub))
if ischar(inp) | islogical(inp)
inp=uint8(inp(:));
else
inp=typecast(inp(:)‘uint8‘);
end
modulus = java.math.BigInteger(key.modulus);
pubexp = java.math.BigI
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3442 2005-11-19 01:04 rsadec.m
文件 3545 2005-11-19 01:04 rsaenc.m
相关资源
- MATLAB实现混沌图像加密仿真程序
- matlab实现仿射加密解密
- 用matlab实现RSA数字签名
- matlab实现RSA公钥密码体制
- 张新鹏教授的加密域可逆信息隐藏实
- AES加密算法的MATLAB仿真
- Bursa_Wolf,布尔莎坐标转换matlab
- Matlab的GUI展示两种图像加密算法
- 图像加密算法实现 matlab
- 基于matlab的语音加密器的设计
- MATLAB揭秘解密版
- 基于行列像素置乱和DWT小波变换的图
- 高分辨率数字图像加密算法
- npcr.m NPCR及UACI
- 激光雷达点云滤波---根据TIN渐进加密
- Matlab强化学习_网格迷宫问题_SarsaLam
- hill密码加密和解密.rar
- 非常简单的MatLab加密程序原创-MatLab加
- 加密软件ms转mse
- MATLAB 使用混沌算法对图像进行加密
- 基于MATLAB图像加解密程序
- Bursa_Wolf,布尔莎坐标转换,matlab,平
- 基于分数傅里叶变换的加密
- arnold映射图像加密
- AES加密的matlab实现
- 数据加密标准DESmatlab程序
- 图像加密的源代码
- 基于Logistic系统的图像加密MATLAB版
- 图像加密matlab代码
- 采用混沌和小波相结合的方式实现的
评论
共有 条评论