ok im trying to figure out how to handle the correct methods for md5 hash + salt
i have the salt for each password formated as 5 bytes or characters w/e
i need to take this and somehow convert the md5 with the salt
right now im just using one password trying to get the correct info from it so im doing the following method
Code:
Private Function GetHashedPassword(ByVal password As String) As String
Dim salt As String = ";w#nO"
Dim bytHashedData As Byte()
Dim encoder As New UTF8Encoding()
Dim md5Hasher As New MD5CryptoServiceProvider
Dim passwordBytes As Byte() = Encoding.ASCII.GetBytes(password)
Dim saltBytes As Byte() = encoder.GetBytes(salt)
Dim passwordAndSaltBytes As Byte() = _
New Byte(passwordBytes.Length + saltBytes.Length - 1) {}
For i As Integer = 0 To passwordBytes.Length - 1
passwordAndSaltBytes(i) = passwordBytes(i)
Next
For i As Integer = 0 To saltBytes.Length - 1
passwordAndSaltBytes(i + passwordBytes.Length) = saltBytes(i)
Next
bytHashedData = md5Hasher.ComputeHash(passwordAndSaltBytes)
Dim hashValue As String
hashValue = Convert.ToBase64String(saltBytes)
Return hashValue
End Function
if i convert it using md5 first I get ' vcyAp/w0owFSLj8+BRYtwQ==" which is no whers near right
it needs to show up as "bdf4a74bb6042a4174ee369ba992c4ca"
if i dont convert to Md5 first it gives me ""JVG9ewOtSR3X1aSAa4Du1w==" Which still isnt right
can anyone help with this. im stuck and confused.