Hi all.
I am trying to right a SHA hasing algorithm to store passwords in a database.
This is the code I am using:
CODE
Dim UE As UnicodeEncoding = New UnicodeEncoding
Dim HashValue As Byte(), MessageBytes As Byte() = UE.GetBytes(txtPre.Text)
Dim SHhash As New SHA256Managed()
Dim strHex As String = ""
HashValue = SHhash.ComputeHash(MessageBytes)
For Each b As Byte In HashValue
strHex += [String].Format("{0:X2}", b)
Next
txtPost.Text = strHex
However, the result that this produces differs from convertors I have found online.
Such as:
http://www.geektimedesign.com/tools-SHA-generator.cfmThe difference in results is like this:
185F8DB32271FE25F561A6FC938B2E264306EC304EDA518007D1764826381969
A07E4F7343246C82B26F32E56F85418D518D8B2F2DAE77F1D56FE7AF50DB97AF
For "Hello"
With the websites generated SHA being the first and mine being the second.
Can anyone help me understand what is going on here, as I am at a total losssss!
Thank you much,
David