Dumb Question
From: Dave Bost (dbost@solpart.com)
Date: 10/28/02
- Next message: Frank Hoover: "Importing Keys from PGP"
- Previous message: Joel Zhou: "Problem setting authentication modes on files under a virtual directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Dave Bost" <dbost@solpart.com> Date: Mon, 28 Oct 2002 16:29:32 -0600
I've spent that past 2 hours searching for answers to this quandry and I'm
tired of wasting time. Hopefully you are able to help me.
Can anyone tell me how to utilize the MD5CryptoServiceProvider class in such
a way that the computed hash equals the same hash generated from the
FormsAuthentication.HashPasswordForStoringInConfigFile() method?
Here's what I have for generating the MD5 hash through the
MD5CryptoServiceProvider:
Function MD5Hash(ByVal inputString As String) As String
Dim myEncoder As New System.Text.UnicodeEncoding()
Dim md5 As New System.Security.Cryptography.MD5CryptoServiceProvider()
Dim hashBytes As Byte()
hashBytes = md5.ComputeHash(myEncoder.GetBytes(inputString))
Return System.Convert.ToBase64String(hashBytes)
End Function
When I call the function with the string "password", I get
"sIHb6F4ew//D1OfQInQAzQ==", however the HashPasswordForStoringInConfigFile
gives me "5F4DCC3B5AA765D61D8327DEB882CF99". I'm assuming that this has to
do with either my choice of Encoding object or converting to a Base 64
string.
Any ideas?
Dave Bost
- Next message: Frank Hoover: "Importing Keys from PGP"
- Previous message: Joel Zhou: "Problem setting authentication modes on files under a virtual directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|