當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Crypt_Base::decrypt方法代碼示例

本文整理匯總了PHP中Crypt_Base::decrypt方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crypt_Base::decrypt方法的具體用法?PHP Crypt_Base::decrypt怎麽用?PHP Crypt_Base::decrypt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Crypt_Base的用法示例。


在下文中一共展示了Crypt_Base::decrypt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * {@inheritDoc}
  *
  * @throws \UnexpectedValueException
  */
 public function render(AttributeEvent $event)
 {
     $cipherText = $event->getValue();
     // The Amazon SDK base64 encodes binary strings before it sends data to
     // DynamoDB, but it does not base64 decode it after it retrieves the
     // data from DynamoDB. Therefore we have to check wheter it is encoded.
     if (preg_match(self::BASE64_REGEX, $cipherText)) {
         $cipherText = base64_decode($cipherText);
         if (false === $cipherText) {
             throw new \UnexpectedValueException('Error decoding data in the ' . $event->getAttribute() . ' attribute');
         }
     }
     $plainText = $this->cipher->decrypt($cipherText);
     if (false === $plainText) {
         throw new \UnexpectedValueException('Error decrypting data in the ' . $event->getAttribute() . ' attribute: Invalid key');
     }
     $event->setValue($plainText);
 }
開發者ID:cpliakas,項目名稱:dynamo-db-odm,代碼行數:23,代碼來源:EncryptedString.php

示例2: decrypt

 /**
  * Decrypts a message.
  *
  * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)).
  * At least if the continuous buffer is disabled.
  *
  * @see    Crypt_Base::encrypt()
  * @see    Crypt_RC4::_crypt()
  * @access public
  *
  * @param String $ciphertext
  *
  * @return String $plaintext
  */
 function decrypt($ciphertext)
 {
     if ($this->engine == CRYPT_MODE_MCRYPT) {
         return parent::decrypt($ciphertext);
     }
     return $this->_crypt($ciphertext, CRYPT_RC4_DECRYPT);
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:21,代碼來源:RC4.php

示例3: decrypt

 /**
  * Decrypts a message.
  *
  * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)).
  * At least if the continuous buffer is disabled.
  *
  * @see Crypt_Base::encrypt()
  * @see self::_crypt()
  * @access public
  * @param string $ciphertext
  * @return string $plaintext
  */
 function decrypt($ciphertext)
 {
     if ($this->engine != CRYPT_ENGINE_INTERNAL) {
         return parent::decrypt($ciphertext);
     }
     return $this->_crypt($ciphertext, CRYPT_RC4_DECRYPT);
 }
開發者ID:smutt,項目名稱:HOBA-server,代碼行數:19,代碼來源:RC4.php

示例4: decrypt

 /**
  * Decrypts a message.
  *
  * Mostly a wrapper for 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 == CRYPT_ENGINE_OPENSSL) {
         $temp = $this->key;
         $this->key = $this->orig_key;
         $result = parent::decrypt($ciphertext);
         $this->key = $temp;
         return $result;
     }
     return parent::decrypt($ciphertext);
 }
開發者ID:Krassmus,項目名稱:LehrMarktplatz,代碼行數:21,代碼來源:RC2.php


注:本文中的Crypt_Base::decrypt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。