cookie 简单加密

//cookie加密
    function cookie_encode($value) {
        $key     = sha1(‘alsdfj’);  //随机加密字符,可以多重加密,越复杂越好
        $temp     = $value ^ $key;
        return base64_encode($temp);
    }

    //cookie解密
    function cookie_decode($value) {
        $key     = sha1(‘alsdfj’);
        $temp     = base64_decode($value);
        return $temp ^ $key;
    }
posted @ 2014-10-05 09:44  栋的博客  阅读(238)  评论(0编辑  收藏  举报
深入理解php php扩展开发 docker mongodb