位置:IT落伍者 >> php >> 浏览文章
<?php
/*===========================================================
= 版权协议
= GPL (The GNU GENERAL PUBLIC LICENSE Version June )
=
= 文件名称clssys_cryptphp
= 摘 要php加密解密处理类
= 版 本
= 参 考Discuz论坛的passport相关函数
= Script Written By PHPWMS项目组
= 最后更新xinge
= 最后日期
============================================================*/
class
SysCrypt {
private
$crypt_key
;
// 构造函数
public
function
__construct(
) {
$this
> crypt_key =
}
php_encrypt(
$txt
srand((double)microtime() * );
$encrypt_key
= md(rand());
$ctr
= ;
$tmp
for
(
$i
<
strlen
);
++) {
==
) ? :
[
](
]^
++]);
return
base_encode
(self::__key(
> crypt_key));
php_decrypt(
= self::__key(
base_decode
)
> crypt_key);
$md
];
[++
] ^
__key(
= md(
++];
__destruct() {
> crypt_key = null;
$sc
new
SysCrypt(
phpwms
$text
print(
> php_encrypt(
));
<br>
> php_decrypt(
)));
?>
上一篇:提高PHP编程效率的53个要点
下一篇:php调用MySQL存储过程的方法集合