SteveOH

ASP.NET: MD5 Hashing of Passwords

by Steve Hernandez on May.10, 2008, under Technology

Imports System.Security.Cryptography

    Function MD5_me(ByVal txt As String) As String
Dim strPlainText As String = txtPassword.Text
Dim hashedDataBytes As Byte()
Dim encoder As New UTF8Encoding()
Dim x As Integer
Dim hashedStr As String = “”

Dim md5Hasher As New MD5CryptoServiceProvider()

hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(strPlainText))

For x = 0 To hashedDataBytes.Length – 1
hashedStr += hashedDataBytes(x).ToString()
Next

MD5_me = hashedStr
End Function

:,

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...