Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class Crypt_Base
- {
- /**
- * The Encryption Mode
- *
- * @see Crypt_Base::Crypt_Base()
- * @var Integer
- * @access private
- */
- public $mode;
- /**
- * The Block Length of the block cipher
- *
- * @var Integer
- * @access private
- */
- public $block_size = 16;
- /**
- * The Key
- *
- * @see Crypt_Base::setKey()
- * @var String
- * @access private
- */
- public $key = "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0";
- /**
- * The Initialization Vector
- *
- * @see Crypt_Base::setIV()
- * @var String
- * @access private
- */
- public $iv;
- /**
- * A "sliding" Initialization Vector
- *
- * @see Crypt_Base::enableContinuousBuffer()
- * @see Crypt_Base::_clearBuffers()
- * @var String
- * @access private
- */
- public $encryptIV;
- /**
- * A "sliding" Initialization Vector
- *
- * @see Crypt_Base::enableContinuousBuffer()
- * @see Crypt_Base::_clearBuffers()
- * @var String
- * @access private
- */
- public $decryptIV;
- /**
- * Continuous Buffer status
- *
- * @see Crypt_Base::enableContinuousBuffer()
- * @var Boolean
- * @access private
- */
- public $continuousBuffer = false;
- /**
- * Encryption buffer for CTR, OFB and CFB modes
- *
- * @see Crypt_Base::encrypt()
- * @see Crypt_Base::_clearBuffers()
- * @var Array
- * @access private
- */
- public $enbuffer;
- /**
- * Decryption buffer for CTR, OFB and CFB modes
- *
- * @see Crypt_Base::decrypt()
- * @see Crypt_Base::_clearBuffers()
- * @var Array
- * @access private
- */
- public $debuffer;
- /**
- * mcrypt resource for encryption
- *
- * The mcrypt resource can be recreated every time something needs to be created or it can be created just once.
- * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode.
- *
- * @see Crypt_Base::encrypt()
- * @var Resource
- * @access private
- */
- public $enmcrypt;
- /**
- * mcrypt resource for decryption
- *
- * The mcrypt resource can be recreated every time something needs to be created or it can be created just once.
- * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode.
- *
- * @see Crypt_Base::decrypt()
- * @var Resource
- * @access private
- */
- public $demcrypt;
- /**
- * Does the enmcrypt resource need to be (re)initialized?
- *
- * @see Crypt_Twofish::setKey()
- * @see Crypt_Twofish::setIV()
- * @var Boolean
- * @access private
- */
- public $enchanged = true;
- /**
- * Does the demcrypt resource need to be (re)initialized?
- *
- * @see Crypt_Twofish::setKey()
- * @see Crypt_Twofish::setIV()
- * @var Boolean
- * @access private
- */
- public $dechanged = true;
- /**
- * mcrypt resource for CFB mode
- *
- * mcrypt's CFB mode, in (and only in) buffered context,
- * is broken, so phpseclib implements the CFB mode by it self,
- * even when the mcrypt php extension is available.
- *
- * In order to do the CFB-mode work (fast) phpseclib
- * use a separate ECB-mode mcrypt resource.
- *
- * @link http://phpseclib.sourceforge.net/cfb-demo.phps
- * @see Crypt_Base::encrypt()
- * @see Crypt_Base::decrypt()
- * @see Crypt_Base::_setupMcrypt()
- * @var Resource
- * @access private
- */
- public $ecb;
- /**
- * Optimizing value while CFB-encrypting
- *
- * Only relevant if $continuousBuffer enabled
- * and $engine == CRYPT_MODE_MCRYPT
- *
- * It's faster to re-init $enmcrypt if
- * $buffer bytes > $cfb_init_len than
- * using the $ecb resource furthermore.
- *
- * This value depends of the choosen cipher
- * and the time it would be needed for it's
- * initialization [by mcrypt_generic_init()]
- * which, typically, depends on the complexity
- * on its internaly Key-expanding algorithm.
- *
- * @see Crypt_Base::encrypt()
- * @var Integer
- * @access private
- */
- public $cfb_init_len = 600;
- /**
- * Does internal cipher state need to be (re)initialized?
- *
- * @see setKey()
- * @see setIV()
- * @see disableContinuousBuffer()
- * @var Boolean
- * @access private
- */
- public $changed = true;
- /**
- * Padding status
- *
- * @see Crypt_Base::enablePadding()
- * @var Boolean
- * @access private
- */
- public $padding = true;
- /**
- * Is the mode one that is paddable?
- *
- * @see Crypt_Base::Crypt_Base()
- * @var Boolean
- * @access private
- */
- public $paddable = false;
- /**
- * Holds which crypt engine internaly should be use,
- * which will be determined automatically on __construct()
- *
- * Currently available $engines are:
- * - CRYPT_MODE_MCRYPT (fast, php-extension: mcrypt, extension_loaded('mcrypt') required)
- * - CRYPT_MODE_INTERNAL (slower, pure php-engine, no php-extension required)
- *
- * In the pipeline... maybe. But currently not available:
- * - CRYPT_MODE_OPENSSL (very fast, php-extension: openssl, extension_loaded('openssl') required)
- *
- * If possible, CRYPT_MODE_MCRYPT will be used for each cipher.
- * Otherwise CRYPT_MODE_INTERNAL
- *
- * @see Crypt_Base::encrypt()
- * @see Crypt_Base::decrypt()
- * @var Integer
- * @access private
- */
- public $engine;
- /**
- * The mcrypt specific name of the cipher
- *
- * Only used if $engine == CRYPT_MODE_MCRYPT
- *
- * @link http://www.php.net/mcrypt_module_open
- * @link http://www.php.net/mcrypt_list_algorithms
- * @see Crypt_Base::_setupMcrypt()
- * @var String
- * @access private
- */
- public $cipher_name_mcrypt;
- /**
- * The default password key_size used by setPassword()
- *
- * @see Crypt_Base::setPassword()
- * @var Integer
- * @access private
- */
- public $password_key_size = 32;
- /**
- * The default salt used by setPassword()
- *
- * @see Crypt_Base::setPassword()
- * @var String
- * @access private
- */
- public $password_default_salt = 'phpseclib/salt';
- /**
- * The namespace used by the cipher for its constants.
- *
- * ie: AES.php is using CRYPT_AES_MODE_* for its constants
- * so $const_namespace is AES
- *
- * DES.php is using CRYPT_DES_MODE_* for its constants
- * so $const_namespace is DES... and so on
- *
- * All CRYPT_<$const_namespace>_MODE_* are aliases of
- * the generic CRYPT_MODE_* constants, so both could be used
- * for each cipher.
- *
- * Example:
- * $aes = new Crypt_AES(CRYPT_AES_MODE_CFB); // $aes will operate in cfb mode
- * $aes = new Crypt_AES(CRYPT_MODE_CFB); // identical
- *
- * @see Crypt_Base::Crypt_Base()
- * @var String
- * @access private
- */
- public $const_namespace;
- /**
- * The name of the performance-optimized callback function
- *
- * Used by encrypt() / decrypt()
- * only if $engine == CRYPT_MODE_INTERNAL
- *
- * @see Crypt_Base::encrypt()
- * @see Crypt_Base::decrypt()
- * @see Crypt_Base::_setupInlineCrypt()
- * @see Crypt_Base::$use_inline_crypt
- * @var Callback
- * @access private
- */
- public $inline_crypt;
- /**
- * Holds whether performance-optimized $inline_crypt() can/should be used.
- *
- * @see Crypt_Base::encrypt()
- * @see Crypt_Base::decrypt()
- * @see Crypt_Base::inline_crypt
- * @var mixed
- * @access private
- */
- public $use_inline_crypt;
- /**
- * Default Constructor.
- *
- * Determines whether or not the mcrypt extension should be used.
- *
- * $mode could be:
- *
- * - CRYPT_MODE_ECB
- *
- * - CRYPT_MODE_CBC
- *
- * - CRYPT_MODE_CTR
- *
- * - CRYPT_MODE_CFB
- *
- * - CRYPT_MODE_OFB
- *
- * (or the alias constants of the choosen cipher, for example for AES: CRYPT_AES_MODE_ECB or CRYPT_AES_MODE_CBC ...)
- *
- * If not explictly set, CRYPT_MODE_CBC will be used.
- *
- * @param optional Integer $mode
- * @access public
- */
- public function Crypt_Base($mode = CRYPT_MODE_CBC)
- {
- $const_crypt_mode = 'CRYPT_' . $this->const_namespace . '_MODE';
- ..................................................................
- ...................................
- ................
Add Comment
Please, Sign In to add comment