发表时间:2015-05-27来源:网络
$key_length = 4; $key = md5($key); $fixedkey = md5($key); $egiskeys = md5(substr($fixedkey, 16, 16)); $runtokey = $key_length ? ($operation == 'ENCODE' ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length)) : ''; $keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16)); $key_length = 4;$key = md5($key);$fixedkey = md5($key);$egiskeys = md5(substr($fixedkey, 16, 16));$runtokey = $key_length ? ($operation == 'ENCODE' ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length)) : '';$keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));
function sys_auth($string, $operation = 'ENCODE', $key = 'hi', $expiry = 0) { $key_length = 4; $key = md5($key); $fixedkey = md5($key); $egiskeys = md5(substr($fixedkey, 16, 16)); $runtokey = $key_length ? ($operation == 'ENCODE' ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length)) : ''; $keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16)); $string = $operation == 'ENCODE' ? sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length)); //10位密文过期信息+16位明文和密钥生成的密文验证信息+明文 $i = 0; $result = ''; $string_length = strlen($string); for ($i = 0; $i < $string_length; $i++){ $result .= chr(ord($string{$i}) ^ ord($keys{$i % 32})); } if($operation == 'ENCODE') { return $runtokey . str_replace('=', '', base64_encode($result)); } else { if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$egiskeys), 0, 16)) { return substr($result, 26); } else { return ''; } } } function sys_auth($string, $operation = 'ENCODE', $key = 'hi', $expiry = 0) {$key_length = 4;$key = md5($key);$fixedkey = md5($key);$egiskeys = md5(substr($fixedkey, 16, 16));$runtokey = $key_length ? ($operation == 'ENCODE' ? substr(md5(microtime(true)), -$key_length) : substr($string, 0, $key_length)) : '';$keys = md5(substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));$string = $operation == 'ENCODE' ? sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length));//10位密文过期信息+16位明文和密钥生成的密文验证信息+明文$i = 0; $result = '';$string_length = strlen($string);for ($i = 0; $i < $string_length; $i++){$result .= chr(ord($string{$i}) ^ ord($keys{$i % 32}));}if($operation == 'ENCODE') {return $runtokey . str_replace('=', '', base64_encode($result));} else {if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$egiskeys), 0, 16)) {return substr($result, 26);} else {return '';}}}
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
PHP中的(++i)前缀自增 和 (i++)后缀自增
将视频设置为Android手机开机动画的教程
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
华为智能光伏官方版(FusionSolar)下载v25.3.101.001 安卓版
130.65MB |商务办公
PETKIT小佩宠物官方软件下载v13.1.1 安卓版
300.76MB |系统工具
分包管家app下载v3.7.3 安卓版
58.74MB |商务办公
tplink物联监控摄像头app下载v5.10.5.1681 安卓版
94.39M |社交娱乐
tplink无线摄像头软件(改名tplink物联)下载v5.11.21.1795 安卓手机客户端
94.93MB |系统工具
多屏互动软件下载v10.1.2471 安卓最新版本
108.16MB |系统工具
朴朴森山官方版下载v1.3.3 安卓版
26.43MB |商务办公
aik钥匙工具app下载v2.7.0 安卓版
82.46M |系统工具
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2022-03-21
2014-09-05