标签:
function mycrypt( $str, $key ){ $slen = strlen( $str ); $klen = strlen( $key ); $cipher = ‘‘; for ($i=0;$i<$slen;$i=$i+$klen) { $cipher .= substr( $str, $i, $klen )^$key; } return $cipher; }
接收端实现简单的解密
function myuncrypt( $str, $key ){ $slen = strlen( $str ); $klen = strlen( $key ); $plain = ‘‘; for ($i=0;$i<$slen;$i=$i+$klen) { $plain .= $key^substr( $str, $i, $klen ); } return $plain; }
标签:
原文地址:http://www.cnblogs.com/yiyide266/p/5576784.html