当前位置: 首页>>代码示例>>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;未经允许,请勿转载。