Home  >  Article  >  php教程  >  php加密程序

php加密程序

WBOY
WBOYOriginal
2016-06-13 10:11:271174browse

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);
  }
?>

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

Statement:
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
Previous article:php程序员必须Next article:php过滤不安全的html