A simple VB.Net application to hash a string to a MD5 hash

I created the below console application in Visual Basic.Net Express 2008 to convert a given string to a MD5 hash, atteched is the complied EXE

Example usage:

C:\>MD5.exe String_To_Hash

Module Module1
    Sub Main()
        Dim strToHash As String
        strToHash = Command$()
        Dim md5Obj As New Security.Cryptography.MD5CryptoServiceProvider
        Dim bytesToHash() As Byte = System.Text.Encoding.ASCII.GetBytes(strToHash)
        bytesToHash = md5Obj.ComputeHash(bytesToHash)
        Dim strResult As String = ""
        For Each b As Byte In bytesToHash
            strResult += b.ToString("x2")
    End Sub
End Module



Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.