While researching hash and encryption examples, I stumbled upon a class library that contains functions that can encrypt string data using MD5, SHA1, SHA256, SHA384, and SHA512 algorithms. The code is very neat and clean, and was develped by Guo Xu (
However, the sample code only converts the data to hash, it does not convert the hash back to the original values. I understand the code but I can not figure out how to convert the data back.
Here is a sample of the code:
Can someone please inform me on how I can convert the hash data back to the original state?
---
By the way, if anyone wants all of the code that was found in this module please let me know. Mr. Guo Xu kindly stated that we can redistribute this code if needed.
-lucyv
However, the sample code only converts the data to hash, it does not convert the hash back to the original values. I understand the code but I can not figure out how to convert the data back.
Here is a sample of the code:
Code:
Public Class HashLib
Public Function MD5Hash(ByVal InputStr As String) As String
Dim MD5Hasher As New System.Security.Cryptography.MD5CryptoServiceProvider
Return ToHexString(MD5Hasher.ComputeHash(Encoder.GetBytes(InputStr)))
End Function
Private Function ToHexString(ByVal ByteArray As Byte()) As String
Dim i As Integer
For i = LBound(ByteArray) To UBound(ByteArray)
ToHexString &= Hex(ByteArray(i))
Next
End Function
End Class
Can someone please inform me on how I can convert the hash data back to the original state?
---
By the way, if anyone wants all of the code that was found in this module please let me know. Mr. Guo Xu kindly stated that we can redistribute this code if needed.
-lucyv