// 如何再url中传递可以使用 urlencode urldecode
static public function Encryption_and_decryption($type,$data)
{
$method = 'DES-ECB';//加密方法
$passwd = '12344321';//加密密钥
$options = 0;//数据格式选项(可选)
$iv = '';//加密初始化向量(可选)
if ($type == 1) { //加密
$result = openssl_encrypt($data, $method, $passwd, $options);
} else {//解密
$result = openssl_decrypt($data, $method, $passwd, 0);
}
return $result;
}