试过不行,可以自己试试
Dim s As String = "content=""hello1234"";charset=""utf-8"";keys=""key123"";"
Dim es As String = Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(s, "MD5")
Output.Show(es)
Dim str2 As String = Convert.ToBase64String(Encoding.UTF8.GetBytes(es.ToLower))
Output.Show( str2)
Using md5Hash As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create()
Dim data As Byte() = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(s))
Dim sBuilder As New StringBuilder()
Dim i As Integer
For i = 0 To data.Length - 1
If data(i) < 16 Then
sBuilder.Append("0" & data(i).ToString("x2"))
Else
sBuilder.Append(data(i).ToString("x2"))
End If
Next
Dim hash As String = sBuilder.ToString().ToLower
Output.Show(hash)
Dim bs() As Byte = Encoding.UTF8.GetBytes(hash)
Dim str As String = Convert.ToBase64String(bs)
Output.Show( str)
End Using
Dim md5Hash2 As System.Security.Cryptography.MD5 = System.Security.Cryptography.MD5.Create()
Dim data3 As Byte() = md5Hash2.ComputeHash(Encoding.UTF8.GetBytes(s))
Dim str3 As String = Convert.ToBase64String(data3)
Output.Show( str3)
Output.Show( MD5Encrypt(s))