Home > php教程 > php手册 > body text

php加密程序

WBOY
Release: 2016-06-13 10:11:27
Original
1173 people have browsed it

php加密程序

  //加密
  function jiami($data,$psw){
      for($i=0,$j=0;$i           $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           $middle = ord(substr($data,$i,1)) -
           ord(substr($psw,$j,1));
    if ($j > strlen($psw)){
     $j=0;
    }
          $str .=chr($middle);
      }
   return($str);
  }
?>

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!