While I'm not familiar with how salts are supposed to work, I've created a function that hashes a password and a salt, then uses them as input to create the final hash.
You'll need these:
Imports System.Security.Cryptography
Imports System.Text
Imports System.IO
To run this:
Private Function CreateMD5(password As String, salt As String) As String
Dim passwordBytes() As Byte = Encoding.UTF8.GetBytes(password)
Dim saltBytes() As Byte = Encoding.UTF8.GetBytes(salt)
Dim saltedPasswordHash As Byte()
Dim md5Hasher As MD5 = Security.Cryptography.MD5.Create()
Dim buffer As New MemoryStream
Dim writer As New StreamWriter(buffer) With {.AutoFlush = True}
Try
writer.Write(md5Hasher.ComputeHash(passwordBytes))
writer.Write(md5Hasher.ComputeHash(saltBytes))
buffer.Position = 0
saltedPasswordHash = md5Hasher.ComputeHash(buffer)
Finally
writer.Dispose()
buffer.Dispose()
md5Hasher.Dispose()
End Try
Return String.Concat(BitConverter.ToString(saltedPasswordHash).Split("-"c))
End Function
Example usage:
Dim saltedHash As String = CreateMD5("password", "salt")
Console.WriteLine(saltedHash)
Output:
CDA7359AB6408E7F0088CAB68470D5FE