127) $c -= 75; $word = chr($c);
$s .= $word; } return $s; }
/* String decode function */ function php_decode($str) { if ($str=='''' && strlen($str)>128) return false;
for($i=0; $i<strlen($str); $i++) { $c = ord($word); if ($c>106 && $c<127) $c = $c-20; if ($c>31 && $c<107) $c = $c+75; $word = chr($c);
$s .= $word; } return $s; } // }}}
// {{{ php_encrypt(), php_decrypt() /** * Simple string encrypt/decrypt function * * @param string $str need crypt string variable * @return string encrypt/decrypt after string * @version v0.1 * @create 2005-5-27 * @modified 2005-5-29 * @author heiyeluren <hyeiyeluren@163.com> */
/* define crypt key */ $encrypt_key = ''abcdefghijklmnopqrstuvwxyz1234567890''; $decrypt_key = ''ngzqtcobmuhelkpdawxfyivrsj2468021359'';
/* String encrypt function */ function php_encrypt($str) { global $encrypt_key, $decrypt_key;
if (strlen($str) == 0) return false;
for ($i=0; $i<strlen($str); $i++) { for ($j=0; $j<strlen($encrypt_key); $j++) { if ($str[$i] == $encrypt_key[$j]) { $enstr .= $decrypt_key[$j]; break; } } } return $enstr; }
/* String decrypt function */ function php_decrypt($str) { global $encrypt_key, $decrypt_key;
if (strlen($str) == 0) return false;
for ($i=0; $i<strlen($str); $i++) { for ($j=0; $j<strlen($decrypt_key); $j++) { if ($str[$i] == $decrypt_key[$j]) { $enstr .= $encrypt_key[$j]; break; } } } return $enstr; } // }}}
如果代码不清晰的话,建议查看一下连接,是我在blogchina的博客:
http://heiyeluren.blogchina.com/1741318.html |