本文实例讲述了asp.net实现的MD5加密和DES加解密算法类。分享给大家供大家参考,具体如下:
#region MD5算法
public string md5(string str, int code)
{
if (code == 32) //32位加密
{
return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, MD5).ToLower();
}
else //16位MD5加密(取32位加密的9~25字符)
{
return System.Web.Security.