Posted by admin on 2008-08-03, 11:56 AM
$string = "我是加密字符"; // encrypt $string, and store it in $enc_text
$enc_text = base64_encode(encrypt($string,$key)); // decrypt the encrypted text $enc_text, and store it in $dec_text
$dec_text = decrypt(base64_decode($enc_text),$key);
print "加密的 text : ".$enc_text." <Br> ";
print "解密的 text : ".($dec_text)." <Br> ";
//添加base64主要是为了能够打印出所加密的字符。实际使用中看情况。继续阅读‘PHP的加解密函数’
Tags: php, 加密, 函数
技术 | 评论:0 | 阅读:343