11 public static function encrypt(
string $str, ?
string $salt =
null): string
13 $key = $salt ?? \COption::GetOptionString(
'main',
'pwdhashadd',
'ldap');
18 $m = mb_substr($str, 0, 16,
'ASCII');
19 $str = mb_substr($str, 16, mb_strlen($str,
'ASCII') - 16,
'ASCII');
23 return base64_encode($res);
26 public static function decrypt(
string $str, ?
string $salt =
null): string
28 $key = $salt ?? \COption::GetOptionString(
'main',
'pwdhashadd',
'ldap');
30 $str = base64_decode($str);
34 $m = mb_substr($str, 0, 16,
'ASCII');
35 $str = mb_substr($str, 16, mb_strlen($str,
'ASCII') - 16,
'ASCII');