Skip to main content
Improved formatting and wording
Source Link
Palec
  • 13.8k
  • 8
  • 80
  • 145

client Client side password encryption using md5.js and decryption in phpPHP

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.

client side password encryption md5.js and decryption in php

hi friends i am using a form with user and password fields in that i need to encrypt the password before sending the form to the server for validation, for that i am using md5.js for encryption in client side using the salt information.

test.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> 

this is form which contains the client encryption using the javascript and md5.js. i can successfully encrypt the message and send to test1.php in that test1.php i dont know how to decrypt the text please help me.

Client side password encryption using md5.js and decryption in PHP

I am using a form with user and password fields in that I need to encrypt the password before sending the form to the server for validation. For that I am using md5.js for encryption on client side using the salt information.

test.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> 

This is the form which contains the client encryption using JavaScript and md5.js. I can successfully encrypt the message and send it to test1.php in that test1.php. I don't know how to decrypt the text please help me.

Source Link
VPR
  • 77
  • 2
  • 3
  • 13

client side password encryption md5.js and decryption in php

hi friends i am using a form with user and password fields in that i need to encrypt the password before sending the form to the server for validation, for that i am using md5.js for encryption in client side using the salt information.

test.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> 

this is form which contains the client encryption using the javascript and md5.js. i can successfully encrypt the message and send to test1.php in that test1.php i dont know how to decrypt the text please help me.