wrenfro
asked on
VB.net Function to match ColdFusion hash function
I am looking for some VB.net code to match the ColdFusion Function hash().
I am working on a Web/Client application that is caching some security on the client and needs to work in a disconnected environment using vb.net. the passwords have been saved after using the hash function.
here is a sample if the vb code I have tried but the result does not match the result from hash("test")
Dim md5Hasher As New MD5CryptoServiceProvider
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding
hashedBytes = md5Hasher.ComputeHash(enco der.GetByt es("test") )
Dim hashString As String
hashString = Convert.ToBase64String(has hedBytes)
any ideas?
I am working on a Web/Client application that is caching some security on the client and needs to work in a disconnected environment using vb.net. the passwords have been saved after using the hash function.
here is a sample if the vb code I have tried but the result does not match the result from hash("test")
Dim md5Hasher As New MD5CryptoServiceProvider
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding
hashedBytes = md5Hasher.ComputeHash(enco
Dim hashString As String
hashString = Convert.ToBase64String(has
any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the following code will do the same in VB.NET
Dim PWordbyte As Byte
For Each PWordbyte In hashedBytes
hashString = hashString & String.Format("{0:X2}", PWordbyte)
Next