Answered with the help of @JonSkeet
Given this code:
Dim data1ToHash As Byte() = (New UnicodeEncoding).GetBytes(input)
' 2. Hash the byte array
Dim hashvalue1 As Byte() = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(data1ToHash)
Shouldn't this PHP produce the correct hash?
$md5 = (md5(utf8_encode($signature), true));
I tried, but the md5sums aren't matching up. I assumed it was encoding, but perhaps it has to do with the byte array, can anyone shed some light on this? FYI I can't change the VB
To compare the results:
in .Net
For Each b As Byte In hashvalue1
tb.Text = tb.Text & b.ToString() & ","
Next
tb.Text = tb.Text.Trim(",")
in PHP
print_r(unpack('C*', pack('H*', md5($signature))))
as per another question