注册 | 登录 | 首页 | 归档 | 搜索 | 标签 | 评论
浏览模式: 标准 | 列表 Tag: 函数

PHP的加解密函数

$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, 加密, 函数