Entry
Can I use Javascript to encrypt passwords entered in HTML forms?
How can I send a users password from a HTML form back to the server encrypted?
Jul 7th, 1999 20:18
Nathan Wallace, Manuel Lemos
The most common technique to do so is to use Javascript to encode the
password field right before submitting the form.
I have developed a PHP class that generates forms with the necessary
Javascript code to do so. The the page located at the URL below you may
find the code for that class as well an example to do what you need.
The class uses an hidden field to store the encoded version of the
password and clears the password field after validating the form.
In this case the md5 algorithm is used. This assumes that you will be
able to check your password on the server side with the correct password
also encoded as md5. You may use other encoding algorithms if you can
provide a Javascript to implement them.
Note that the ability to encode passwords this way before submitting a
form relies on a Javascript enable browser. If the browser does not
support Javascript, it will still send the password in clear text.
http://phpclasses.upperdesign.com/browse.html?package=1