MD5 with ASP - WeOnlyDo Discussion board

MD5 with ASP (wodCrypt)

by John Lundberg, Friday, November 25, 2005, 11:12 (6721 days ago)

Hi,

I have a problem hashing in ASP.

This is my code:

[code]
Set Crypt = Server.CreateObject( WeOnlyDo.wodCryptCom.1 )
Set EncBlob = Server.CreateObject( WeOnlyDo.MemBlob.1 )
Set DecBlob = Server.CreateObject( WeOnlyDo.MemBlob.1 )

Crypt.LicenseKey = 33A6-xxx-xxx-KE7Z
Crypt.Optimized = 0
Crypt.Type = 100
Crypt.Padding = PadSpace
Crypt.FireEvents = False
Crypt.Compression = NoCompression

DecBlob.Text = 9999ABCD0000011100aaaabbbb

Crypt.Digest DecBlob, EncBlob
encMD5 = EncBlob.ToHex

response.write encMD5

set EncBlob = Nothing
set DecBlob = Nothing
set Crypt = Nothing
[/code]

This function are supposed to return the MD5 value: 26efb0517cdfbbacb13a61e91feae16d

but it returns:
d41d8cd98f00b204e9800998ecf8427e

another thing is that its returning the same value regardless of what i type in DecBlob.Text.


What is wrong with my script?

// John

Re: MD5 with ASP

by wodSupport, Friday, November 25, 2005, 11:17 (6721 days ago) @ John Lundberg

I tried this in VB and it returns 26efb0517cdfbbacb13a61e91feae16d as it should. Let me try in ASP to see what could be different there. Perhaps one Cstr will help.

Re: MD5 with ASP

by wodSupport, Friday, November 25, 2005, 11:20 (6721 days ago) @ wodSupport

Hm, I just created new ASP page and pasted your code exactly as it is, and I get response 26efb0517cdfbbacb13a61e91feae16d.

Not sure where did your different value come from, but are you sure you use exactly the same code?

Re: MD5 with ASP

by John Lundberg, Friday, November 25, 2005, 11:28 (6721 days ago) @ wodSupport

Hi,

I found the problem.

The component was registred as a COM+ in MTS. When i registred the component with regsvr32 instead it worked fine.

Tkanks!