function bl_dosubmit() { var pwd=document.getElementById("formpassword").value; var hkey=document.getElementById("LoginHashKey").value; bl_submit_encrypt_pwd(pwd,hkey); } function bl_dosubmitencrypted() { //Password encrypted var pwd=document.getElementById("formpassword").value; var hkey=document.getElementById("LoginHashKey").value; if(pwd!=""){ var pwdmd5=hex_md5(pwd); bl_submit_encrypt_pwd(pwdmd5,hkey); } } function bl_submit_encrypt_pwd(pwd,key) { var cryptedpwd=""; try{ cryptedpwd=stringToHex(des(key,pwd,1)); } catch(err){ cryptedpwd=""; } document.getElementById("formpasswordcrypted").value=cryptedpwd; //replace the not crypted password by a string of same length var chaine="crypted password crypted password crypted password crypted password crypted password"; try{ document.getElementById("formpassword").value=chaine.substr(0,document.getElementById("formpassword").value.length); document.getElementById("LoginHashKey").value=hex_md5(key); }catch(err){ document.getElementById("formpassword").value=""; document.getElementById("LoginHashKey").value=""; } }