'abc' returns a hash value of 900150983cd24fb0d6963f7d28e17f72 when tested using the Windows crypto functions...
GenHash FRAME pszString,pHash
uses edi,esi,ebx
LOCAL dwStatus :D
LOCAL bResult :D
LOCAL hProv :D
LOCAL hHash :D
LOCAL cbRead :D
LOCAL rgbHash[64] :B
LOCAL cbHash :D
LOCAL rgbDigits[16] :B
// Generate a 16 byte MD5 HASH from the string
mov ,"0123"
mov ,"4567"
mov ,"89ab"
mov ,"cdef"
invoke lstrlen,
test eax,eax
jz >>.ERRORCONTEXT
mov ,eax
invoke CryptAcquireContext,offset hProv,NULL,NULL,PROV_RSA_FULL,CRYPT_VERIFYCONTEXT
test eax,eax
jz >>.ERRORCONTEXT
invoke CryptCreateHash,, CALG_MD5, NULL, NULL, offset hHash
test eax,eax
jz >>.ERRORHASH
invoke CryptHashData,, , , NULL
test eax,eax
jz >>.ERROROTHER
mov D,64
invoke CryptGetHashParam,, HP_HASHVAL, offset rgbHash, offset cbHash, NULL
test eax,eax
jz >>.ERROROTHER
// convert the hash to an MD5 string using a lookup table
xor eax,eax
xor edx,edx
mov ebx,
mov edi,offset rgbHash
mov ecx,
mov esi,offset rgbDigits
:
mov al,
shr al,4
mov dl,
mov ,dl
inc ebx
mov al,
and al,0fh
mov dl,
mov ,dl
inc edi
inc ebx
dec ecx
jnz <
mov B,0
invoke CryptDestroyHash
invoke CryptReleaseContext, , NULL
xor eax,eax
ret
.ERROROTHER
invoke CryptDestroyHash
.ERRORHASH
invoke CryptReleaseContext, , NULL
.ERRORCONTEXT
invoke VirtualFree,,NULL,MEM_RELEASE
xor eax,eax
dec eax
RET
ENDF
i used roy|crisiscrackers MD5 to test.
"abc"="900150983cd24fb0d6963f7d28e17f72"
could someone test iblis MD5?
"abc"="900150983cd24fb0d6963f7d28e17f72"
could someone test iblis MD5?
All of my tests show it matching exactly the output of the crypto functions...
Output:
IblisHash FRAME pszString, pHash
uses ebx
invoke lstrlen,
mov ebx,eax
invoke MD5.lib:MD5_Startup
invoke MD5.lib:MD5_Init, offset md5ctxt
invoke MD5.lib:MD5_Read, offset md5ctxt, , ebx
invoke MD5.lib:MD5_Digest, offset md5ctxt, offset md5hash
invoke MD5.lib:MD52StringA, offset md5hash, , 1
ret
ENDF
invoke GenHash,offset key,offset hash
PrintString(hash)
invoke IblisHash,offset key,offset hash
PrintString(hash)
Output:
Executing:
"D:\RadASM\GoAsm\Projects\ODCombo\Testhash.exe"
Line 101: hash = 900150983cd24fb0d6963f7d28e17f72
Line 103: hash = 900150983CD24FB0D6963F7D28E17F72
I am guessing that discrepancy is due to your poor implementation..
Your code is being called whenever the editbox content is changed, which likely is more than once.. I am guessing when you type 'abc' you're in fact sending three EN_CHANGE notifications, causing the hashing functions to all be called three times..
The MD5_Init function is meant to be called just once, not multiple times, if I was a betting man I'd place my bets.
I've certainly had no problems with generating valid hashes using this lib.
Try hashing the term 'abc' from static data instead, as a one-shot deal.
Your code is being called whenever the editbox content is changed, which likely is more than once.. I am guessing when you type 'abc' you're in fact sending three EN_CHANGE notifications, causing the hashing functions to all be called three times..
The MD5_Init function is meant to be called just once, not multiple times, if I was a betting man I'd place my bets.
I've certainly had no problems with generating valid hashes using this lib.
Try hashing the term 'abc' from static data instead, as a one-shot deal.
thanks you.
my error:"invoke MD5_Read, offset ctxt, offset bfBuffer, SIZEOF bfBuffer"
best regards
my error:"invoke MD5_Read, offset ctxt, offset bfBuffer, SIZEOF bfBuffer"
best regards
Hi dcskm4200,
Glad you got it worked out, I may take a look at Iblis' lib myself, I generally use the Advapi32 Cryptxxxx functions for hashes since they are reasonably fast and available in all but one version of Windows (95 1st release) but there are a few places where I could use an increase in hashing speed.
Donkey
Glad you got it worked out, I may take a look at Iblis' lib myself, I generally use the Advapi32 Cryptxxxx functions for hashes since they are reasonably fast and available in all but one version of Windows (95 1st release) but there are a few places where I could use an increase in hashing speed.
Donkey
Nice to see people still using it after all these years.
And Hi again ;)
I'll have to go through my archives and see if I can find it and reupload.
Did all the attachments disappear when the board software changed?
Edit: Oops, I see I already reuploaded it in 2005
And Hi again ;)
I'll have to go through my archives and see if I can find it and reupload.
Did all the attachments disappear when the board software changed?
Edit: Oops, I see I already reuploaded it in 2005