• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/crypt.php
  • Класс: CCrypt
  • Вызов: CCrypt::Encrypt
function Encrypt($text)
{
	if (empty($text))
	{
		$this->errorMessage = "Empty source text";
		return false;
	}

	$cipher = false;
	switch ($this->blockCipherMode)
	{
		case CRYPT_MODE_ECB:
			$cipher = $this->__EncryptECB($text);
			break;

		case CRYPT_MODE_CBC:
			$cipher = $this->__EncryptCBC($text);
			break;

		default:
			$this->errorMessage = "Invalid mode '".$this->blockCipherMode."'";
	}

	return $cipher;
}