當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。