Ecco il codice che ho utilizzato...così è più chiaro:
Ho usato la funzione:
Private Function EncodePassword(ByVal pass As String, ByVal passwordFormat As Integer, ByVal salt As String) As String
Dim bIn As Byte() = Encoding.Default.GetBytes(pass)
Dim bSalt As Byte() = Convert.FromBase64String(salt)
Dim bAll As Byte()
Array.Resize(bAll, bSalt.Length + bIn.Length)
Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length)
Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length)
Dim shaM As New SHA1Managed()
Dim resultHash As Byte() = System.Security.Cryptography.SHA1.Create().Compute Hash(bAll)
Dim resultHexString = ""
resultHexString = Convert.ToBase64String(resultHash)
Return resultHexString