PHP头条
热点:

php加密程序


php加密程序

<?php
  //加密
  function jiami($data,$psw){
      for($i=0,$j=0;$i<strlen($data);$i++,$j++){
          $middle = ord(substr($data,$i,1)) +
           ord(substr($psw,$j,1));
    if ($j > strlen($psw)){
     $j=0;
    }
          $str .=chr($middle);
      }
   return($str);
  }
  //解密
  function jiemi($data,$psw){
   for($i=0,$j=0;$i<strlen($data);$i++,$j++){
          $middle = ord(substr($data,$i,1)) -
           ord(substr($psw,$j,1));
    if ($j > strlen($psw)){
     $j=0;
    }
          $str .=chr($middle);
      }
   return($str);
  }
?>

这是在一个网站看到一网友的加密程序,所以写出来.

www.phpzy.comtrue/php/5153.htmlTechArticlephp加密程序 php加密程序 ?php //加密 function jiami($data,$psw){ for($i=0,$j=0;$istrlen($data);$i++,$j++){ $middle = ord(substr($data,$i,1)) + ord(substr($psw,$j,1)); if ($j strlen($psw)){ $j=0; } $str .=chr($middle); } return($str...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐