• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/crypt.php
  • Класс: CSteganos
  • Вызов: CSteganos::HideData
function HideData($containerFile, $data, $resultFile, $level = 2)
{
	if (!file_exists($containerFile) || !is_file($containerFile) || !is_readable($containerFile))
	{
		$this->errorMessage = "The container file '".$containerFile."' was not found or not readable";
		return false;
	}

	$containerFile_tmp = trim($containerFile, ". rnt");
	$arContainerFile_tmp = explode(".", $containerFile_tmp);
	$containerFileExt = mb_strtolower($arContainerFile_tmp[count($arContainerFile_tmp) - 1]);
	switch(mb_strtolower($containerFileExt))
	{
		case "bmp":
			$this->containerType = "bmp";
			break;
		case "txt":
		case "php":
		case "html":
		case "htm":
		case "css":
			$this->containerType = "txt";
			break;
		default:
			$this->errorMessage = "Unknown container type";
			return false;
	}

	if (empty($data))
	{
		$this->errorMessage = "No data to hide";
		return false;
	}

	if (empty($resultFile))
	{
		$this->errorMessage = "The output file was not specified";
		return false;
	}

	$this->data = $data;
	$this->containerFile = $containerFile;
	$this->resultFile = $resultFile;
	$this->level = $level;

	if (!$this->__CheckContainer())
		return false;

	$this->__OpenContainer();

	//$this->__CompressData();

	$this->__HideData();

	$this->__SaveResult();

	return null;
}