Click here to Skip to main content
15,609,421 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys..... with this codes below... i successfully encryt text but my problem is... i can't create a vice versa of this.... i mean a "DECRYPTER"... Please Help...... here's my code....

Public Function pwdMd5Hash(ByVal String2Hash As String) As String


          Dim MD5Hasher As New System.Security.Cryptography.MD5CryptoServiceProvider()

          Dim oEncoder As New System.Text.ASCIIEncoding()

          Dim bytes As Byte() = oEncoder.GetBytes(String2Hash)

          Dim myHash As Byte() = MD5Hasher.ComputeHash(bytes)

          Dim myCapacity As Integer = 7

          Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder(myCapacity)

          Dim I As Integer

          For I = 0 To myHash.Length - 1

              sb.Append(BitConverter.ToString(myHash, I, 1))

          Next I

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

      Catch ex As Exception

          Return "0"

      End Try
Updated 22-Jul-12 15:22pm
[no name] 22-Jul-12 21:22pm    
You do know that hashes are one way don't you?
graciax8 23-Jul-12 0:04am    
i use a function in a encrypter and decrypter in one. just sharing.

As Wes said, a hash only goes one way. You can't turn a hash back in to the starting string.
Share this answer
Sergey Alexandrovich Kryukov 23-Jul-12 0:21am    
Of course, a 5.
Considering that MD5 is not an encryption algorithm, but is in fact a hash function (and a broken one at that), no there is no such thing as a decryptor for MD5.
Share this answer
Sergey Alexandrovich Kryukov 23-Jul-12 0:21am    
Of course, a 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900