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


PHP mcrypt_cbc函數代碼示例

本文整理匯總了PHP中mcrypt_cbc函數的典型用法代碼示例。如果您正苦於以下問題:PHP mcrypt_cbc函數的具體用法?PHP mcrypt_cbc怎麽用?PHP mcrypt_cbc使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: decrypt

 public function decrypt($string, $key)
 {
     $dec = "";
     $string = trim(base64_decode($string));
     $dec = mcrypt_cbc(MCRYPT_TripleDES, $key, $string, MCRYPT_DECRYPT, $this->iv);
     return $dec;
 }
開發者ID:roycocup,項目名稱:enclothed,代碼行數:7,代碼來源:gifts.php

示例2: decrypt

 function decrypt($str)
 {
     $str = base64_decode($str);
     $str = mcrypt_cbc(MCRYPT_DES, $this->key, $str, MCRYPT_DECRYPT, $this->iv);
     $str = $this->pkcs5Unpad($str);
     return $str;
 }
開發者ID:justinyaoqi,項目名稱:qyhr,代碼行數:7,代碼來源:desjava.class.php

示例3: decode

 /**
  * 解密
  * @param string $str 要處理的字符串
  * @param string $key 解密Key,為8個字節長度
  * @return string
  */
 public function decode($str, $key)
 {
     $strBin = base64_decode($str);
     $str = mcrypt_cbc(MCRYPT_DES, $key, $strBin, MCRYPT_DECRYPT, $key);
     $str = $this->pkcs5Unpad($str);
     return $str;
 }
開發者ID:noikiy,項目名稱:shopnc-minion,代碼行數:13,代碼來源:remoteDes.php

示例4: decrypt

 static function decrypt($str, $key)
 {
     $strBin = self::hex2bin($str);
     $str = mcrypt_cbc(MCRYPT_DES, $key, $strBin, MCRYPT_DECRYPT, $key);
     $str = self::pkcs5Unpad($str);
     return $str;
 }
開發者ID:qiaopingxie,項目名稱:eLong-OpenAPI-PHP-demo,代碼行數:7,代碼來源:Xcrypt.php

示例5: encrypt

 function encrypt($str)
 {
     //加密,返回大寫十六進製字符串
     $size = mcrypt_get_block_size(MCRYPT_DES, MCRYPT_MODE_CBC);
     $str = $this->pkcs5Pad($str, $size);
     return strtoupper(bin2hex(mcrypt_cbc(MCRYPT_DES, $this->key, $str, MCRYPT_ENCRYPT, $this->iv)));
 }
開發者ID:samuelcs,項目名稱:videonewsweb,代碼行數:7,代碼來源:des.php

示例6: decrypt

 function decrypt($str)
 {
     $strBin = $this->hex2bin(strtolower($str));
     $str = mcrypt_cbc(MCRYPT_DES, $this->key, $strBin, MCRYPT_DECRYPT, $this->iv);
     $str = $this->pkcs5Unpad($str);
     return $str;
 }
開發者ID:justinyaoqi,項目名稱:qyhr,代碼行數:7,代碼來源:des.class.php

示例7: decrypt2

 public static function decrypt2($str, $key)
 {
     //½âÃÜ
     $strBin = hex2bin(strtolower($str));
     $str = mcrypt_cbc(MCRYPT_DES, $key, $strBin, MCRYPT_DECRYPT, $key);
     return trim($str);
 }
開發者ID:3116246,項目名稱:haolinju,代碼行數:7,代碼來源:DES.php

示例8: encrypt

 public static function encrypt($string, $secret = null)
 {
     $secret = empty($secret) ? ENCRYPT_SECRET : $secret;
     $ivsize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
     $iv = self::generateIV($ivsize, $secret);
     return mcrypt_cbc(MCRYPT_RIJNDAEL_128, $secret, $string, MCRYPT_MODE_CBC, $iv);
 }
開發者ID:snowleopardw,項目名稱:Tw2other,代碼行數:7,代碼來源:Encryption.php

示例9: decode

 /**
  * 解密 
  * @param string $str 要處理的字符串
  * @param string $key 解密Key,為8個字節長度
  * @return string
  */
 public function decode($str, $key)
 {
     $str = str_replace("@@", "/", $str);
     $str = str_replace("\$\$", "+", $str);
     $strBin = base64_decode($str);
     $str = mcrypt_cbc(MCRYPT_DES, $key, $strBin, MCRYPT_DECRYPT, $key);
     $str = $this->pkcs5Unpad($str);
     return $str;
 }
開發者ID:lingPro,項目名稱:zj_web_demo,代碼行數:15,代碼來源:MyDes.class.php

示例10: decrypt

 protected function decrypt($text)
 {
     //解密
     $key = C('TD_SECRET_KEY');
     $str = base64_decode($text);
     $str = mcrypt_cbc(MCRYPT_DES, $key, $str, MCRYPT_DECRYPT, $key);
     $str = $this->pkcs5Unpad($str);
     return $str;
 }
開發者ID:rainly123,項目名稱:zyzm,代碼行數:9,代碼來源:ApiController.class.php

示例11: do_mdecrypt

function do_mdecrypt($input, $key) {
	$input = str_replace ( "\n", "", $input );
	$input = str_replace ( "\t", "", $input );
	$input = str_replace ( "\r", "", $input );
	$input = base64_decode ( $input );
	$iv = "EjRWeJCrze8=";
	$str = mcrypt_cbc ( MCRYPT_DES, $key, $input, MCRYPT_DECRYPT, base64_decode ( $iv ) );
	$str = pkcs5Unpad ( $str );
	return $str;
}
開發者ID:hutao1004,項目名稱:yintt,代碼行數:10,代碼來源:DesUtil.php

示例12: decrypt

 public function decrypt($cipher)
 {
     if ($this->blockmode == Lms_Crypt::MODE_ECB) {
         $plain = mcrypt_ecb($this->alghoritm, $this->key, $cipher, MCRYPT_DECRYPT, $this->iv);
     }
     if ($this->blockmode == Lms_Crypt::MODE_CBC) {
         $plain = mcrypt_cbc($this->alghoritm, $this->key, $cipher, MCRYPT_DECRYPT, $this->iv);
     }
     return $plain;
 }
開發者ID:nagyistoce,項目名稱:lanmediaservice-lms-video-ce-1.x,代碼行數:10,代碼來源:Mcrypt.php

示例13: function

 /**
 Session storage function (write).
 Writes the session data after the page code has finished to the cookie with the session id as the cookie name.
 @param arg_str_session_id the 32 byte session id supplied by the client.
 @param arg_str_session_data the session data to be written to cookie.
 @return Boolean true/false.
 @see read().
 @access Public.
 */
 function write($arg_str_session_id, $arg_str_session_data)
 {
     $iv = strrev(substr(SESSION_ENCRYPTION_KEY, 0, 8));
     $cypher = base64_encode(mcrypt_cbc(MCRYPT_TRIPLEDES, SESSION_ENCRYPTION_KEY, $arg_str_session_data, MCRYPT_ENCRYPT, $iv));
     if (COOKIE_DOMAIN) {
         setcookie(session_name(), session_id(), 0, "/", COOKIE_DOMAIN ? "." . COOKIE_DOMAIN : NULL);
     }
     setcookie($arg_str_session_id, $cypher, 0, "/", COOKIE_DOMAIN ? "." . COOKIE_DOMAIN : NULL);
     ob_end_flush();
     return true;
 }
開發者ID:halaby,項目名稱:smlite-framework,代碼行數:20,代碼來源:cookie_session.php

示例14: decode

 public function decode($content, $key)
 {
     $this->key = $key;
     $this->iv = $key;
     $content = str_replace("@@", "/", $content);
     $content = str_replace("\$\$", "+", $content);
     $content = base64_decode($content);
     $content = mcrypt_cbc(MCRYPT_DES, $this->key, $content, MCRYPT_DECRYPT, $this->iv);
     $content = $this->pkcs5Unpad($content);
     return $content;
 }
開發者ID:lingPro,項目名稱:zj_web_demo,代碼行數:11,代碼來源:DES.class.php

示例15: encrypt

 function encrypt($time, $string)
 {
     if (empty($string)) {
         return '';
     }
     $iv = $this->config['SECRETKEY'];
     # 提供的測試key abcdefgh
     $string = $time . $string;
     $string = $this->pkcs5Pad($string);
     $enc = mcrypt_cbc(MCRYPT_DES, $iv, $string, MCRYPT_ENCRYPT, $iv);
     return base64_encode($enc);
 }
開發者ID:rainly123,項目名稱:zyzm,代碼行數:12,代碼來源:QuickpayController.class.php


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