Home > Backend Development > PHP Tutorial > php encryption program_PHP tutorial

php encryption program_PHP tutorial

WBOY
Release: 2016-07-13 17:09:31
Original
905 people have browsed it

php encryption program

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

I saw a netizen’s encryption program on a website, so I wrote it down.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629748.htmlTechArticlephp encryption program?php //encryption 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))...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template