• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/crypt.php
  • Класс: CCrypt
  • Вызов: CCrypt::__EncryptECB
function __EncryptECB($text)
{
	$blockSize = $this->cipher->blockSize;
	$cipher = "";

	if ($blockSize <= 0)
	{
		$cipher = $this->cipher->__Encrypt($text);
	}
	else
	{
		$textLength = mb_strlen($text);
		for ($i = 0; $i < $textLength; $i = $i + $blockSize)
		{
			$block = mb_substr($text, $i, $blockSize);

			if (mb_strlen($block) < $blockSize)
				$block = str_pad($block, $blockSize, "", STR_PAD_LEFT);

			$cipher .= $this->cipher->__Encrypt($block);
		}
	}

	return $cipher;
}