binary: www(dot)mediafire(dot)com/download/pr7f00rz874x82c/CryptEX.exe
Pretty useless, but i thought i would share:)
Imports System.Text
Imports Microsoft.VisualBasic
Public Class Form1
Private Shared Function GetMD5Hash(ByVal md5hash As MD5, ByVal input As String) As String
Dim data As Byte() = md5hash.ComputeHash(Encoding.UTF8.GetBytes(input))
Dim sBuilder As New StringBuilder()
For i As Integer = 0 To data.Length - 1
sBuilder.Append(data(i).ToString("x2"))
Next i
Return sBuilder.ToString()
End Function
Public Shared Function CompareThem(ByVal hashedStr As String, ByVal str As String) As Boolean
Dim md5hash As MD5 = MD5.Create()
Dim comparer As StringComparer = StringComparer.OrdinalIgnoreCase
If comparer.Compare(hashedStr, GetMD5Hash(md5hash, str)) = 0 Then
Return True
Else
Return False
End If
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If RadioButton1.Checked Then Label1.Text = "MD5"
If RadioButton1.Checked Then Button2.Enabled = False
If RadioButton2.Checked Then Label1.Text = "BASE64"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If RadioButton1.Checked Then
Dim input As String
input = TextBox1.Text
Dim hash As String = ""
Using md5hash As MD5 = MD5.Create()
hash = GetMD5Hash(md5hash, Input)
End Using
TextBox2.Text = hash
End If
If RadioButton2.Checked Then
Dim base64Decoded As String = TextBox1.Text
Dim base64Encoded As String
Dim data As Byte()
data = System.Text.ASCIIEncoding.ASCII.GetBytes(base64Decoded)
base64Encoded = System.Convert.ToBase64String(data)
TextBox2.Text = base64Encoded
End If
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If RadioButton2.Checked = True Then
Dim base64Encoded As String = TextBox1.Text
Dim base64Decoded As String
Dim data() As Byte
data = System.Convert.FromBase64String(base64Encoded)
base64Decoded = System.Text.ASCIIEncoding.ASCII.GetString(data)
TextBox2.Text = base64Decoded
End If
End Sub
End Class