- Модуль: ldap
- Путь к файлу: ~/bitrix/modules/ldap/lib/Internal/Security/Encryption.php
- Класс: BitrixLdapInternalSecurityEncryption
- Вызов: Encryption::encrypt
static function encrypt(string $str, ?string $salt = null): string
{
$key = $salt ?? COption::GetOptionString('main', 'pwdhashadd', 'ldap');
$key1 = self::binMd5($key);
$res = '';
while ($str)
{
$m = mb_substr($str, 0, 16, 'ASCII');
$str = mb_substr($str, 16, mb_strlen($str, 'ASCII') - 16, 'ASCII');
$res .= self::byteXor($m, $key1, 16);
$key1 = self::binMd5($key . $key1 . $m);
}
return base64_encode($res);
}