Module MD5 加密

Module MD5
#Region "MD5加密Encrypt(ByVal sMessage, ByVal Code_Lenght)"
    Public Function Encrypt(ByVal sMessage As String, ByVal CodeLenght As Int16) As String
        If CodeLenght = 16 Then
            Encrypt = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sMessage, "MD5").ToLower().Substring(8, 16)
        ElseIf CodeLenght = 32 Then
            Encrypt = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sMessage, "MD5").ToLower()
        Else
            Encrypt = "00000000000000000000000000000000"
        End If
    End Function
#End Region
End Module
posted @ 2006-07-01 11:52  Nina  阅读(196)  评论(0编辑  收藏  举报