当前位置: 首页>>代码示例>>PHP>>正文


PHP Crypt_Base::isValidEngine方法代码示例

本文整理汇总了PHP中Crypt_Base::isValidEngine方法的典型用法代码示例。如果您正苦于以下问题:PHP Crypt_Base::isValidEngine方法的具体用法?PHP Crypt_Base::isValidEngine怎么用?PHP Crypt_Base::isValidEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Crypt_Base的用法示例。


在下文中一共展示了Crypt_Base::isValidEngine方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isValidEngine

 /**
  * Test for engine validity
  *
  * This is mainly just a wrapper to set things up for Crypt_Base::isValidEngine()
  *
  * @see Crypt_Base::isValidEngine()
  * @param int $engine
  * @access public
  * @return bool
  */
 function isValidEngine($engine)
 {
     if ($engine == CRYPT_ENGINE_OPENSSL) {
         if ($this->key_length != 16) {
             return false;
         }
         $this->cipher_name_openssl_ecb = 'bf-ecb';
         $this->cipher_name_openssl = 'bf-' . $this->_openssl_translate_mode();
     }
     return parent::isValidEngine($engine);
 }
开发者ID:aaronfrey,项目名称:PepperLillie-Cambridge,代码行数:21,代码来源:Blowfish.php

示例2: isValidEngine

 /**
  * Test for engine validity
  *
  * This is mainly just a wrapper to set things up for Crypt_Base::isValidEngine()
  *
  * @see Crypt_Base::Crypt_Base()
  * @param int $engine
  * @access public
  * @return bool
  */
 function isValidEngine($engine)
 {
     switch ($engine) {
         case CRYPT_ENGINE_OPENSSL:
             switch (strlen($this->key)) {
                 case 5:
                     $this->cipher_name_openssl = 'rc4-40';
                     break;
                 case 8:
                     $this->cipher_name_openssl = 'rc4-64';
                     break;
                 case 16:
                     $this->cipher_name_openssl = 'rc4';
                     break;
                 default:
                     return false;
             }
     }
     return parent::isValidEngine($engine);
 }
开发者ID:smutt,项目名称:HOBA-server,代码行数:30,代码来源:RC4.php

示例3: isValidEngine

 /**
  * Test for engine validity
  *
  * This is mainly just a wrapper to set things up for Crypt_Base::isValidEngine()
  *
  * @see Crypt_Base::Crypt_Base()
  * @param int $engine
  * @access public
  * @return bool
  */
 function isValidEngine($engine)
 {
     switch ($engine) {
         case CRYPT_ENGINE_OPENSSL:
             if ($this->block_size != 16) {
                 return false;
             }
             $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb';
             $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode();
             break;
         case CRYPT_ENGINE_MCRYPT:
             $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3);
             if ($this->key_length % 8) {
                 // is it a 160/224-bit key?
                 // mcrypt is not usable for them, only for 128/192/256-bit keys
                 return false;
             }
     }
     return parent::isValidEngine($engine);
 }
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:30,代码来源:Rijndael.php

示例4: isValidEngine

 /**
  * Test for engine validity
  *
  * This is mainly just a wrapper to set things up for Crypt_Base::isValidEngine()
  *
  * @see Crypt_Base::Crypt_Base()
  * @param int $engine
  * @access public
  * @return bool
  */
 function isValidEngine($engine)
 {
     switch ($engine) {
         case CRYPT_ENGINE_OPENSSL:
             if ($this->current_key_length != 128 || strlen($this->orig_key) < 16) {
                 return false;
             }
             $this->cipher_name_openssl_ecb = 'rc2-ecb';
             $this->cipher_name_openssl = 'rc2-' . $this->_openssl_translate_mode();
     }
     return parent::isValidEngine($engine);
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:22,代码来源:RC2.php

示例5: isValidEngine

 /**
  * Test for engine validity
  *
  * This is mainly just a wrapper to set things up for Crypt_Base::isValidEngine()
  *
  * @see Crypt_Base::isValidEngine()
  * @param int $engine
  * @access public
  * @return bool
  */
 function isValidEngine($engine)
 {
     if ($this->key_length_max == 8) {
         if ($engine == CRYPT_ENGINE_OPENSSL) {
             $this->cipher_name_openssl_ecb = 'des-ecb';
             $this->cipher_name_openssl = 'des-' . $this->_openssl_translate_mode();
         }
     }
     return parent::isValidEngine($engine);
 }
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:20,代码来源:DES.php


注:本文中的Crypt_Base::isValidEngine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。