I have a jquery dialog modal box pop up for logging into my website. When a user clicks login it does a post request to a login.php file as follows:
$.post(
'includes/login.php',
{ user: username, pass: password },
onLogin,
'json' );
How do I do an md5 on that password before putting it in the post request? Also, I have the user's passwords stored in a MySQL database using MD5(), so I would like to just compare the stored version of the password with the MD5 of the password submitted. Thanks to anyone that replies.
crypto-js is a rich javascript library containing many cryptography algorithms.
All you have to do is just call CryptoJS.MD5(password)
$.post(
'includes/login.php',
{ user: username, pass: CryptoJS.MD5(password) },
onLogin,
'json' );