谁能告诉我下面这段JS代码的意思,我知道这是加密方法,但因不懂JS,所以需要哪位好心人帮我解释一下 15
functionsend_login(){varsalt="188f8f92";varpassword="";if(graphic_auth=="false"){pass...
function send_login()
{
var salt = "188f8f92";
var password = "";
if (graphic_auth == "false") {
password = document.forms.myform.old_password.value.substr(0,16);
document.forms.myform.old_password.value = ""; // Make sure password never gets sent as clear text
}
else {
password = document.forms.myform.new_password.value.substr(0,16);
document.forms.myform.new_password.value = ""; // Make sure password never gets sent as clear text
}
for (var i = password.length; i < 16; i++) {
password += String.fromCharCode(1);
}
var input = salt + password;
for (var i = input.length; i < 63; i++) {
input += String.fromCharCode(1);
}
if (graphic_auth == "false") {
input += (document.forms.myform.old_username.value == 'user') ? 'U' : String.fromCharCode(1);
}
else {
input += (document.forms.myform.new_username.value == 'user') ? 'U' : String.fromCharCode(1);
}
var hash = hex_md5(input);
var login_hash = salt.concat(hash);
var auth_url = "";
auth_url = "&auth_code=" + document.forms.myform.auth_code.value + "&auth_id=0C931";
var xml_loader = new ajax_xmlhttp("/post_login.xml?hash=" + login_hash + auth_url, xml_ready, xml_timeout);
if (!xml_loader) {
alert ("Your web browser is too old to use this web site. Please upgrade your browser.");
return;
}
xml_loader.retrieve_xml();
}
function send_key(e)
{
// IE or Firefox
if ((e.keyCode == 13) || (e.which == 13)) {
send_login(); 展开
{
var salt = "188f8f92";
var password = "";
if (graphic_auth == "false") {
password = document.forms.myform.old_password.value.substr(0,16);
document.forms.myform.old_password.value = ""; // Make sure password never gets sent as clear text
}
else {
password = document.forms.myform.new_password.value.substr(0,16);
document.forms.myform.new_password.value = ""; // Make sure password never gets sent as clear text
}
for (var i = password.length; i < 16; i++) {
password += String.fromCharCode(1);
}
var input = salt + password;
for (var i = input.length; i < 63; i++) {
input += String.fromCharCode(1);
}
if (graphic_auth == "false") {
input += (document.forms.myform.old_username.value == 'user') ? 'U' : String.fromCharCode(1);
}
else {
input += (document.forms.myform.new_username.value == 'user') ? 'U' : String.fromCharCode(1);
}
var hash = hex_md5(input);
var login_hash = salt.concat(hash);
var auth_url = "";
auth_url = "&auth_code=" + document.forms.myform.auth_code.value + "&auth_id=0C931";
var xml_loader = new ajax_xmlhttp("/post_login.xml?hash=" + login_hash + auth_url, xml_ready, xml_timeout);
if (!xml_loader) {
alert ("Your web browser is too old to use this web site. Please upgrade your browser.");
return;
}
xml_loader.retrieve_xml();
}
function send_key(e)
{
// IE or Firefox
if ((e.keyCode == 13) || (e.which == 13)) {
send_login(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询