Jump to content
bc-vnt

MD5 Encrypter VB.NET for beginners + source code

Recommended Posts

Posted (edited)

Download : MD5 Encrypt.exe download - 2shared

Imports System
Imports System.Net
Imports System.Text
Imports System.Security
Imports System.Security.Cryptography
Public Class Form1

Public Function MD5(ByVal Source) As String

Dim Bytes() As Byte = ASCIIEncoding.ASCII.GetBytes(Source)
Dim md5h As New MD5CryptoServiceProvider
Dim Byt() As Byte = md5h.ComputeHash(Bytes)
Dim I As Integer = (Byt.Length * 2 + Byt(Byt.Length / 8))
Dim StrBuild As StringBuilder = New StringBuilder(I)
Dim i2 As Integer

For i2 = 0 To Byt.Length - 1
StrBuild.Append(BitConverter.ToString(Byt, i2, 1))
Next i2

Return StrBuild.ToString().TrimEnd(New Char() {" "c}).ToLower

End Function

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
txtMD5.Text = MD5(txtConvert.Text)
End Sub

Private Sub btnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConvert.Click
txtMD5.Text = MD5(txtConvert.Text)
End Sub

Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
Clipboard.SetDataObject(txtMD5.Text)
End Sub

End Class

Sursa : Guida Creare un Encriptatore MD5 [ vb.net ]

Edited by Nytro

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...