将它们打包成一个文件就叫fun.php吧 复制代码 代码如下:<?php function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ‘‘; for($i = 0;$i < strlen($txt); $i++) { $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } funct...
最近学习URL跳转的时候新进三个超好用的PHP加密解密函数,貌似是discuz里的…使用这些加密解密的原因是因为有时自己的URL地址被人获取以后想破解你里面传值的内容就必须知道你的key,没有key,他应该要破了一阵子才能知道你URL里面的内容吧。将它们打包成一个文件就叫fun.php吧 代码如下:<?php
function passport_encrypt($txt, $key) {
srand((double)
microtime
() * 1000000);
$encrypt_key = md5(rand(0, 32000));
$ctr = 0...
将它们打包成一个文件就叫fun.php吧 <?php
function passport_encrypt($txt, $key) {
srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000));
$ctr = 0;
$tmp = ;
for($i = 0;$i < strlen($txt); $i++) {
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
$tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]);
}
return base64_encode(passport_key($tmp, $key));
} function passpor...
PHP Blowfish 算法的加密解密,供大家参考,具体内容如下<?php/*** php blowfish 算法* Class blowfish*/
class blowfish{/*** blowfish + cbc模式 + pkcs5补码 加密* @param string $str 需要加密的数据* @return string 加密后base64加密的数据*/public function blowfish_cbc_pkcs5_encrypt($str){$cipher = mcrypt_module_open(MCRYPT_BLOWFISH, , MCRYPT_MODE_CBC, );//pkcs5补码$size = mcrypt_get_block_size(MCRYPT_BLOWFI...
将它们打包成一个文件就叫fun.php吧 代码如下:function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ''; for($i = 0;$i $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } function passport_decrypt($txt, $key) { $txt ...
加密php算法 最近项目需求,要用php将一些普通的信息通过加密算法生成一个加密串,加密串能通过解密算法(逆向)解析出先前的信息。因为没有操作过,所以想问一下这里的朋友是否有现成的加解密算法的思路,算法需要够复杂不易被破解,有具体代码更好就更好啦 回复内容:http://blog.shiniv.com/2013/11/use-aes-encryption-algorithm-to-encrypt-data-in-php/http://ww...
PHP AES加密解密算法 输出的是32的倍数位16进制的字符串 echo '第一种AES加密方案:'; printf("128-bit encrypted result:\n%s\n\n",bin2hex($cipherText)); echo '';echo ''; } //--------第一种AES加密方案-------- ?> 转载来源:http://www.chilkatsoft.com/p/php_aes.asp http://www.cnblogs.com/adylee/archive/2007/09/14/893438.html 转载来源:http://blog.csdn.net/shushengsky/archive/2009/...
将它们打包成一个文件就叫fun.php吧 代码如下:function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ''; for($i = 0;$i $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } function passport_decrypt($txt, $key) { $txt ...
将它们打包成一个文件就叫fun.php吧 代码如下:function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ''; for($i = 0;$i $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } function passport_decrypt($txt, $key) { $txt ...
将它们打包成一个文件就叫fun.php吧 代码如下:<?php function passport_encrypt($txt, $key) { srand((double)microtime() * 1000000); $encrypt_key = md5(rand(0, 32000)); $ctr = 0; $tmp = ; for($i = 0;$i < strlen($txt); $i++) { $ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr; $tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]); } return base64_encode(passport_key($tmp, $key)); } function passport...
/*** 加密方法* @param string $data 要加密的字符串* @param string $key 加密密钥* @param int $expire 过期时间 (单位:秒) * @return string*/
function _encrypt($data, $key, $expire = 0) {$key = md5($key);$data = base64_encode($data);$x = 0;$len = strlen($data);$l = strlen($key);$char = ;for ($i = 0; $i < $len; $i++) {if ($x == $l) $x=0;$char .= substr($key, $x, 1);$x++;}$str = sprintf(%010d, $expire ? ...