MFC中有java des加密密的函数吗

 上传我的文档
 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
mfc des加密解密
下载积分:1000
内容提示:mfc des加密解密
文档格式:DOC|
浏览次数:28|
上传日期: 17:13:55|
文档星级:
该用户还上传了这些文档
mfc des加密解密
官方公共微信DES加密解密函数
//默认密钥向量
private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
/// &summary&
/// DES字符串
/// &/summary&
/// &param name=&encryptString&&待加密的字符串&/param&
/// &param name=&encryptKey&&加密密钥,要求为8位&/param&
/// &returns&加密成功返回加密后的字符串,失败返回源串&/returns&
public static string EncryptDES(string encryptString, string encryptKey)
&&&&&&& byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));
&&&&&&& byte[] rgbIV = K
&&&&&&& byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString);
&&&&&&& DESCryptoServiceProvider dCSP = new DESCryptoServiceProvider();
&&&&&&& MemoryStream mStream = new MemoryStream();
&&&&&&& CryptoStream cStream = new CryptoStream(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
&&&&&&& cStream.Write(inputByteArray, 0, inputByteArray.Length);
&&&&&&& cStream.FlushFinalBlock();
&&&&&&& return Convert.ToBase64String(mStream.ToArray());
&&&&&&& return encryptS
/// &summary&
/// DES解密字符串
/// &/summary&
/// &param name=&decryptString&&待解密的字符串&/param&
/// &param name=&decryptKey&&解密密钥,要求为8位,和加密密钥相同&/param&
/// &returns&解密成功返回解密后的字符串,失败返源串&/returns&
public static string DecryptDES(string decryptString, string decryptKey)
&&&&&&& byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey);
&&&&&&& byte[] rgbIV = K
&&&&&&& byte[] inputByteArray = Convert.FromBase64String(decryptString);
&&&&&&& DESCryptoServiceProvider DCSP = new DESCryptoServiceProvider();
&&&&&&& MemoryStream mStream = new MemoryStream();
&&&&&&& CryptoStream cStream = new CryptoStream(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
&&&&&&& cStream.Write(inputByteArray, 0, inputByteArray.Length);
&&&&&&& cStream.FlushFinalBlock();
&&&&&&& return Encoding.UTF8.GetString(mStream.ToArray());
&&&&&&& return decryptS
摘自 爱智旮旯
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'DES加密程序代码(有比较详细的讲解)_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
DES加密程序代码(有比较详细的讲解)
上传于||文档简介
&&用C编写的DES加密程序,有一个DES的加密流程图,其中有程序的说明介绍.
阅读已结束,如果下载本文需要使用2下载券
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩11页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 mfc des加密 的文章

 

随机推荐