[ASP.NET2.0]Common层通用代码之MD5
2007-05-17 12:14
351 查看
using System;
using System.Collections.Generic;
using System.Text;
using System.Security;
using System.Security.Principal;
using System.Security.Cryptography;
namespace Common
...{
public class MD5
...{
public static string Encrypt(string password)
...{
/**////获取Byte数组
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
/**////获取Hash值
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
/**////获取加密后的信息
return BitConverter.ToString(hashedBytes);
}
}
}
相关文章推荐
- [ASP.NET2.0]Common层通用代码之数据库访问
- [ASP.NET2.0]Common层通用代码之加密解密
- [ASP.NET2.0]Common层通用代码之JavaScript弹出信息框
- [ASP.NET2.0]Common层通用代码之JavaScript弹出新窗体
- [ASP.NET2.0]Common层通用代码之JavaScript脚本输出
- [ASP.NET2.0]Common层通用代码之服务器端正则表达式验证
- [ASP.NET2.0]Common层通用代码之Week枚举
- [ASP.NET2.0]Common层通用代码之字符串处理
- [ASP.NET1.1]Common层通用代码之树型控件递归加入子项方法
- Common层通用代码之服务器端正则表达式验证
- 通用数据库存储过程代码--高效分页存储过程
- Hibernate编写通用数据库操作代码
- MD5加密,java String 转变成MD5 String 详细代码,工具类Android开发必备
- Android网络传输中必用的两个加密算法:MD5 和 RSA (附java完成测试代码)
- asp.net 通用的连接数据库实例代码
- .NET 生成高质量缩略图的通用函数代码 (修改版)
- python代码的通用写法
- ASP.NET2.0学习--N层代码示例
- C# ASP.NET 最常用的通用权限的3个方法例子展示(每个功能一行代码实现)
- 通用高效分页存储过程代码