Exemplo n.º 1
0
 /**
  * Decrypts a message.
  *
  * Mostly a wrapper for \phpseclib\Crypt\Base::decrypt, with some additional OpenSSL handling code
  *
  * @see self::encrypt()
  * @access public
  * @param string $ciphertext
  * @return string $plaintext
  */
 function decrypt($ciphertext)
 {
     if ($this->engine == self::ENGINE_OPENSSL) {
         $temp = $this->key;
         $this->key = $this->orig_key;
         $result = parent::decrypt($ciphertext);
         $this->key = $temp;
         return $result;
     }
     return parent::encrypt($ciphertext);
 }
Exemplo n.º 2
0
 /**
  * Decrypts a message.
  *
  * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)).
  * At least if the continuous buffer is disabled.
  *
  * @see \phpseclib\Crypt\Base::encrypt()
  * @see \phpseclib\Crypt\RC4::_crypt()
  * @access public
  * @param String $ciphertext
  * @return String $plaintext
  */
 function decrypt($ciphertext)
 {
     if ($this->engine != Base::ENGINE_INTERNAL) {
         return parent::decrypt($ciphertext);
     }
     return $this->_crypt($ciphertext, self::DECRYPT);
 }