Forum Moderators: coopster

Message Too Old, No Replies

MD5 Hash

Generating

         

KrazyKid

4:30 am on Jun 3, 2005 (gmt 0)

10+ Year Member



I need to know how to do something which is probably very simple. What I need is a form with two text fields, and you enter something in the first one and press submit, and then the MD5 hash of what you entered is generated and displayed in the second field. Thanks,

madpenguin2

5:03 am on Jun 3, 2005 (gmt 0)

10+ Year Member



Sounds more like ou want to do a md5 hash with javascript... If you don't mind the page reloading, then use the md5 function included with php. It's not quite a real md5... there is no 'salt'. But, for use as an authentication tool, it works well.

Brett

coopster

1:12 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, KrazyKid and madpenguin2.

>>It's not quite a real md5

?

PHP's md5 function does indeed calculate the MD5 hash of a string using the RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. The md5 hash is specific to the OS it runs on though, so it won't be a portable value that can be checked again on a different system by *rehashing* the string and comparing it the stored hash on a different system (... hopefully that made sense).

If you could explain for what do you want to use the hash value we may be able to offer better direction or solutions ...

mcibor

1:28 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Coopster,
hash is not portable

Do you mean that if I first md5 hash the password with javascript, and then compare it with hash done by server I won't get the same values?

Then which hashes can I use to have the same hash disregarding OS?

Best regards
Michal Cibor

KrazyKid

3:47 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



<snipped link to a javascript md5 hashing function>

That's what I need to know how to do. Thanks

[edited by: coopster at 3:56 pm (utc) on June 3, 2005]
[edit reason] no urls per TOS [webmasterworld.com] [/edit]

coopster

3:54 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Incorrect statement on my part, sorry about that -- too early this morning for me to be discussing security topics I guess ... ;)