Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

MD5

Dear Oren,

In your response you mention 'MD5(Password)', do you have an (preferably)
VB source code for MD5 where i could generate MD5 has from 3 small strings?

Well, originally i am trying to generate unique primary keys for some tables
in my database. Somebody mentioned MD5 and sounds ok for me. What other opinions
you could recommend ?

Thanks, Jouni

>Database ->
> UserName/Pwd
> Text MD5
>
>Program ->
> Set Password ->
> FieldUserName = UserName
> FieldPassword = MD5(Password) 'If you need code to access
>the crypto api just ask
>
> WriteRegKey MyLocation, MyKey, CRC(MD5(Password)) 'Don't
use
>the internal reg writing commands in vb, the values are too easy to spot
>
> Get Password ->
> SELECT UserName, Password FROM ....... WHERE ...."
>
> IF MD5(Password) = FieldPassword THEN
> IF GetRegKey(MyLocation, MyKey) = CRC(FieldPassword) THEN
> UserHasPermission
>
>
>
>Got the idea?
>
> Oren
>
>
[1337 byte] By [Jouni Kuisma] at [2007-11-9 23:49:33]
# 1 Re: MD5
why not call CryptoAPI from VB? you can wrap the functions pretty easily.
also, i note you're using CRC(MD5(...)), why are you using a CRC, they have
high collisions, relative to hash functions.

"Jouni Kuisma" <jouni@kuisma.org> wrote:
>
>
>Dear Oren,
>
>In your response you mention 'MD5(Password)', do you have an (preferably)
>VB source code for MD5 where i could generate MD5 has from 3 small strings?
>
>Well, originally i am trying to generate unique primary keys for some tables
>in my database. Somebody mentioned MD5 and sounds ok for me. What other
opinions
>you could recommend ?
>
> Thanks, Jouni
>
>>Database ->
>> UserName/Pwd
>> Text MD5
>>
>>Program ->
>> Set Password ->
>> FieldUserName = UserName
>> FieldPassword = MD5(Password) 'If you need code to access
>>the crypto api just ask
>>
>> WriteRegKey MyLocation, MyKey, CRC(MD5(Password)) 'Don't
>use
>>the internal reg writing commands in vb, the values are too easy to spot
>>
>> Get Password ->
>> SELECT UserName, Password FROM ....... WHERE ...."
>>
>> IF MD5(Password) = FieldPassword THEN
>> IF GetRegKey(MyLocation, MyKey) = CRC(FieldPassword) THEN
>> UserHasPermission
>>
>>
>>
>>Got the idea?
>>
>> Oren
>>
>>
>
Michael Howard at 2007-11-12 0:15:05 >