两组容易的PHP解密解密代码
程序员文章站
2022-03-31 17:31:20
...
两组简单的PHP解密解密代码
http://www.phper.org.cn/?post=133
加密算法如下:
http://www.phper.org.cn/?post=133
加密算法如下:
function encrypt($data, $key){ $key = md5($key); $x = 0; $len = strlen($data); $l = strlen($key); for ($i = 0; $i
解密算法如下:function decrypt($data, $key){ $key = md5($key); $x = 0; $data = base64_decode($data); $len = strlen($data); $l = strlen($key); for ($i = 0; $i
使用:$data = 'PHP加密解密算法'; // 被加密信息$key = '123'; // 密钥$encrypt = encrypt($data, $key);$decrypt = decrypt($encrypt, $key);echo $encrypt, "\n", $decrypt;
http://www.thinkphp.cn/code/282.html/** * 通用加密 * @param String $string 需要加密的字串 * @param String $skey 加密EKY * @author Anyon Zou * @date 2013-08-13 19:30 * @return String */ function enCode($string = '', $skey = 'echounion') { $skey = array_reverse(str_split($skey)); $strArr = str_split(base64_encode($string)); $strCount = count($strArr); foreach ($skey as $key => $value) { $key * @date 2013-08-13 19:30 */ function deCode($string = '', $skey = 'echounion') { $skey = array_reverse(str_split($skey)); $strArr = str_split(str_replace('O0O0O', '=', $string), 2); $strCount = count($strArr); foreach ($skey as $key => $value) { $key相关文章
相关视频
上一篇: 教你如何打开xml文件的详解