Ho risolto con questo codice:

codice:
Public Shared Function MD5Encode(ByVal S As String) As String

        Dim hexstring As String = ""

        If S = "" = False Then
            Dim md5 As New Security.Cryptography.MD5CryptoServiceProvider()
            Dim bytestring As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(S)
            Dim result As Byte()
            result = md5.ComputeHash(bytestring)

            For i As Integer = 0 To result.Length - 1
                hexstring &= result(i).ToString("x").PadLeft(2, "0")
            Next
        End If

        Return hexstring

    End Function
Saluti