下载mcrypt 函数库你找找以前的贴~~有说~~有教你安装的~~~运用如下:<?
$EnCoder_Key = "My Love Is Fang"; //钥匙
$EnCoder_type=MCRYPT_RIJNDAEL_128; //加密类型function Do_Crypt($s){
global $EnCoder_Key,$EnCoder_type;
$iv = mcrypt_create_iv(mcrypt_get_iv_size($EnCoder_type,MCRYPT_MODE_ECB), MCRYPT_RAND);
$encrypted_string = mcrypt_encrypt( $EnCoder_type, trim($EnCoder_Key), $s, MCRYPT_MODE_CBC, $iv);
$encrypted_string=bin2hex($encrypted_string);
return $encrypted_string;
}function Do_Uncrypt($s){
global $EnCoder_Key,$EnCoder_type;
$s=trim($s);
for ($i=0;$i<strlen($s);$i+=2) {
$string_en.=chr(hexdec(substr($s,$i,2)));
}
$iv = mcrypt_create_iv(mcrypt_get_iv_size($EnCoder_type,MCRYPT_MODE_ECB), MCRYPT_RAND);
$decrypted_string = mcrypt_decrypt( $EnCoder_type, $EnCoder_Key, trim($string_en), MCRYPT_MODE_CBC, $iv);
return trim($decrypted_string);
}$encoder = Do_Crypt("我爱你");echo $encoder;echo Do_Uncrypt($encoder);
?>-------------------------------------------
传递:http://xxxx/index.php?v=$encoder