MD5 conversion problem

From: Peter Afonin (pva_at_speakeasy.net)
Date: 08/27/04


Date: Thu, 26 Aug 2004 19:37:01 -0700

Hello,

I'm struggling with the string conversion to MD5 which I've never user
before.

I have a string that I need to encode which looks approximately like this:

"pva:0.05:101214:pa7735tH:inv_desc=205308:shp_Email=petera_gudzon.net:lang
=ru:shp_PaymentNo=20040825205308:shp_UserID=pva:shp_Price=2.95:shp_HostPlan=
BU:shp_Term=2"

I'm doing it this way:

Dim hashedBytes As Byte()
Dim md5 As New MD5CryptoServiceProvider
Dim encoder As New ASCIIEncoding
hashedBytes = md5.ComputeHash(encoder.GetBytes(sCRC))
Dim sNewCRC as String = Convert.ToString(md5.ComputeHash(hashedBytes))

It doesn't work. When I see the output on the page where I pass this string,
it looks like this:

'<input type=hidden name=crc value="System.Byte[]">'+

I don't know exactly how it should look like, but probably not like
"System.Byte[]"

I'm doing something wrong, but I don't know what.

I would really appreciate your help.

Thank you,

Peter Afonin



Relevant Pages

  • Question about VB5 encryption algorithm (included)
    ... Keyis a string array. ... set of all 256 ASCII characters in random order. ... The Encode and Decode functions are reversible. ... Dim j, k, i As Integer ...
    (sci.crypt)
  • MD5 erzeugen
    ... Public Function GenerateHash(ByVal sourceText As String) As String ... Dim md5 As New MD5CryptoServiceProvider ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • MD5
    ... Public Function GenerateHash(ByVal sourceText As String) As String ... Dim md5 As New MD5CryptoServiceProvider ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: MD5
    ... Public Function GenerateHash(ByVal sourceText As String) As String Dim md5 As New MD5CryptoServiceProvider ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • bytes to hex characters
    ... the md5 hashes of your input strings. ... Public Function MD5String(vData As String) As String ... Dim DBytesAs Byte, i As Integer ... Dim retstr As String ...
    (microsoft.public.dotnet.languages.vb)