asp.net 2.0中md5密码加密
1
using System.Text;
2
using System.Security.Cryptography;
3
4
//密码加密
5
public static string Encrypt(string password)
6
{
7
password = password.ToLower();
8
9
Byte[] clearBytes = new UnicodeEncoding().GetBytes(password);
10
Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);
11
12
return BitConverter.ToString(hashedBytes);
13
}

2

3

4

5

6

7

8

9

10

11

12

13

【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步