Hi little example of returning a hd5 hash from a string.
Hope it comes in useful comments suggestions welcome.

Class code:

vbnet Code:
  1. Imports System.Text
  2. Imports System.Security.Cryptography
  3.  
  4. Public Class cMd5Hash
  5.  
  6.     Public Function Md5FromString(ByVal Source As String) As String
  7.         Dim Bytes() As Byte
  8.         Dim sb As New StringBuilder()
  9.  
  10.         'Check for empty string.
  11.         If String.IsNullOrEmpty(Source) Then
  12.             Throw New ArgumentNullException
  13.         End If
  14.  
  15.         'Get bytes from string.
  16.         Bytes = Encoding.Default.GetBytes(Source)
  17.  
  18.         'Get md5 hash
  19.         Bytes = MD5.Create().ComputeHash(Bytes)
  20.  
  21.         'Loop though the byte array and convert each byte to hex.
  22.         For x As Integer = 0 To Bytes.Length - 1
  23.             sb.Append(Bytes(x).ToString("x2"))
  24.         Next
  25.  
  26.         'Return md5 hash.
  27.         Return sb.ToString()
  28.  
  29.     End Function
  30.  
  31. End Class

Example code:

vbnet Code:
  1. Private Sub cmdGetHash_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetHash.Click
  2.         Dim HashCode As cMd5Hash
  3.  
  4.         HashCode = New cMd5Hash()
  5.  
  6.         MessageBox.Show(HashCode.Md5FromString("password"), "Md5", MessageBoxButtons.OK, MessageBoxIcon.Information)
  7.  
  8.     End Sub