Hi community ! :pimp:
today i open this thread for release the login cryptography written in php..
it's the function that i use for convert string to hex
it's an example, how to make the login packet
good luck with your project ! :handsdown:
today i open this thread for release the login cryptography written in php..
Code:
// encrypt 'NoS0575..' packet
function packet_enc($packet)
{
$str_enc = "";
for($i = 0; $i < strlen($packet); $i++)
$str_enc .= chr((ord($packet[$i])^195) + 15);
return $str_enc .= chr(216);
}
// encrypt password of login
function password_enc($password)
{
$pos = rand(0, 22);
$str_hex = strtoupper(ToHex($password));
$secondtable = array(46, 42, 23, 79, 32, 36, 71, 17, 91, 55, 83, 67, 21, 52, 69, 37, 75, 29, 47, 88, 43, 50, 99);
$pw_enc = strtoupper(ToHex(chr($secondtable[$pos])));
for($i = 0; $i < strlen($str_hex); $i += 2)
{
$pw_enc .= strtoupper(ToHex(chr(($secondtable[$pos] & 240) >> 4)));
$pw_enc .= $str_hex[$i];
$pw_enc .= strtoupper(ToHex(chr($secondtable[$pos] & 15)));
$pw_enc .= $str_hex[$i + 1];
$pos == 22 ? $pos = 0 : $pos++;
}
return $pw_enc;
}
// decrypt response received from server
function packet_dec($packet)
{
$str_dec = "";
for($i = 0; $i < strlen($packet); $i++)
$str_dec .= chr(ord($packet[$i]) - 15);
return $str_dec .= chr(25);
}
Code:
function ToHex($string)
{
$hex = "";
for ($i = 0; $i < strlen($string); $i++)
$hex .= dechex(ord($string[$i]));
return $hex;
}
Code:
$HASH = "529D12EF5699E29548A9914C7B2AB6DFA735FA8053A6B0EDFF75E607FF3EBBED";
$ID = "YOUR ID";
$PW = password_enc("YOUR PW");
$login_packet = "NoS0575 10039722 ".$ID." ".$PW." 00564F36";
$login_packet .= chr(11);
$login_packet .= "0.9.3.3021 0 ".strtoupper(md5($HASH.$ID));
$login_packet = packet_enc($login_packet);