hi friends iI am using a form with useruser and passwordpassword fields in that iI need to encrypt the password before sending the form to the server for validation, for. For that iI am using md5.jsmd5.js for encryption inon client side using the salt information.
test.phptest.php
<script LANGUAGE="Javascript" SRC="js/md5.js"></script> <script> function encryptPwd1(strPwd, strSalt, strit) { var strNewSalt = new String(strSalt); if (strPwd == "" || strSalt == "") { return null; } var strEncPwd; var strPwdHash = MD5(strPwd); var strMerged = strNewSalt + strPwdHash; var strMerged1 = MD5(strMerged); return strMerged1; } function validateForm(strSalt, strit) { var strEncPwd = new String(encryptPwd1(document.getElementById("password").value, strSalt, strit)); document.getElementById("password").value = strEncPwd; document.login.submit(); return true; } </script> <form method="post" action="test1.php"> <input type="hidden" name="salt" id="salt" value="8qadr4xnCPW275BaNpYX"> <label class="login">Password:</label> <input name="password" id="password" type="password" /> <input type="submit" name="gos" id="gos" value="Login" onClick="return validateForm('8qadr4xnCPW275BaNpYX','38');"> </form> thisThis is the form which contains the client encryption using the javascriptJavaScript and md5.jsmd5.js. iI can successfully encrypt the message and send it to test1.phptest1.php in that test1test1.php.php i dont I don't know how to decrypt the text please help me.