![]()
I originally wrote the MD5 implementation to improve security on a login form for a website I was making, running on a web space account with no SSL capability. You can use a secure hash function to avoid sending the password as clear text; this makes it more secure than .htaccess access control. First the web server sends a random variable to the client. The client asks the user for the password, and makes the MD5 hash of the random variable and password, and sends this to the server. The server makes the MD5 hash of the random variable and its stored password. If the two hashes match, then the user knew the correct password, and the server allows access. At no point was the password transmitted in the clear. An eavesdropped won't be able to do a replay attack as the server will then expect a different random variable.
I've written a simple Perl example but this is far from ideal. My ideas for version 2 are below - contributions welcome!
Initilly send: md5(hmac_md5(password, random)) I'd be very interested in comments on the security of this scheme.
© 1998 - 2003 Paul Johnston, distributed under the BSD License Updated: 27 Jul 2003 |