Quote:
|
Originally Posted by till
Sure  The code is in /home/admispconfig/ispconfig/lib/classes/isp_isp_user.lib.php
The code is there twice, once in the user_insert and once in the user_update function.
|
ok that is the problem the standard php crypt function crypt(), returns the seed as the 2 first chars of the output generated string, in this way it only uses the first 8 chars of the string parameter, so if we use the 2 strings with the same first 8 chars then it returns the same output.
looking at the code:
/home/admispconfig/ispconfig/lib/classes/ispconfig_isp_user.lib.php
(LINE APROX 300)
if($go_info["server"]["password_hash"] == 'crypt') {
$salt="";
for ($n=0;$n<2;$n++) {
$salt.=chr(mt_rand(64,126));
}
} else {
$salt="$1$";
for ($n=0;$n<8;$n++) {
$salt.=chr(mt_rand(64,126));
}
$salt.="$";
}
ok taking just a look here i can see that default form of being crypt is DES with 2 chars generated seed, and never is reached long passwords in this way, so the solution i think that is ....
so if u want to try change the above code that appears in both functions insert & update with this...
if($go_info["server"]["password_hash"] == 'crypt') { // by lyndros
// i have to encrypt password in which way?
// now we have to look for the password length
if (strlen($user["user_passwort"])<=8){
// CODE FOR GENERATING 2 CHAR SEED
$salt="";
for ($n=0;$n<2;$n++) {
$salt.=chr(mt_rand(64,126));
}
//echo "hi im type short STANDARD DES DEFAULT ENCRYPTION";
} else {
// CODE FOR GENERATING 8 CHARS SEED
$salt="$1$";
for ($n=0;$n<8;$n++) {
$salt.=chr(mt_rand(64,126));
}
$salt.="$";
//echo "hi im type long STANDARD MD5 ENCRYPTION";
}
}
i think that this is the solution, its working for me for short & long passwords, hope that helps
thk u all for supporting all my questions
Recent comments
1 day 6 hours ago
1 day 8 hours ago
1 day 20 hours ago
1 day 23 hours ago
2 days 3 hours ago
2 days 9 hours ago
2 days 19 hours ago
2 days 21 hours ago
3 days 5 hours ago
3 days 6 hours ago