.net中的加密请给出具体的MD5和哈希加密方法 谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/20 23:30:31
请高手进来解答
我想调用实例。

.net 里面这个算法都是封装好的

如果你想研究到底怎么算的 需要自己查网页了

不知道你是要运用示例 还是运算

运算的话 你看不到微软的原代码
===
#region DES加密字符串
/// <summary>
/// 加密字符串
/// 注意:密钥必须为8位
/// </summary>
/// <param name="strText">字符串</param>
public string DesEncrypt(string strText)
{
byte[] byKey = null;
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
try
{
string encryptKey = "XX_XX_XX"; //密钥
byKey = System.Text.Encoding.UTF8.GetBytes(encryptKey);

DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputByteArray = Encoding.UTF8.GetBytes(strText);

MemoryStream ms = new MemoryStream();
CryptoStream cs = n