Saturday, August 7, 2010

How To Make A MD5 Encryter

Well, today I am going to teach you how to make a MD5 encrypter
I will teach you how to make a MD5 decrypter soon
But I am not done with my MD5 decrypter

Insert 2 Labels
2 TextBoxes
and
1 Button

Name the 2 Labels
1 Input and the other one Output
Rename the button to Encrypt

So you have something like this:












Paste this code into your project:
Private Function StringToMD5(ByVal Content) As String
        Dim M5 As New Security.Cryptography.MD5CryptoServiceProvider

        Dim ByteString() As Byte = System.Text.Encoding.ASCII.GetBytes(Content)
        ByteString = M5.ComputeHash(ByteString)

        Dim FinalString As String = Nothing
        For Each bt As Byte In ByteString
            FinalString &= bt.ToString("x2")
        Next
        Return FinalString
    End Function

Once you're done
Double click on your button
Type in the following code:
  txtOutput.Text = StringToMD5(txtInput.Text)

Done!

No comments:

Post a Comment