MD5 with ASP (wodCrypt)
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
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
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
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!