52,,,自定义加密算法

来源:互联网 发布:淘宝多口袋工装休闲裤 编辑:程序博客网 时间:2024/04/30 14:36
<?phpsession_start();?><body background="../image/1.jpg" style="font-size:12px; color:#000099; font-family:'微软雅黑'"><?phpecho "<form action='' method='post'>";echo "数字口令:<input name='text' type='text'>";echo "<input type='submit' name='sub' value='确定'>";   echo "</form>";define("PI",3.1415926);function Encrypt($str){return $str = $str << PI;//向左位移;}function Decrypt($str){return $str = $str >> PI;}if($_POST[sub]){echo "加密口令  ".Encrypt($_POST[text])."<br>";$_SESSION[pwd] = Encrypt($_POST[text]);?><a href='index.php?pwd=1'>解密口令</a><?php}if(isset($_GET[pwd])){echo "解密口令  ".Decrypt($_SESSION[pwd]);}?></body>

0 0
原创粉丝点击