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