<kbd id='woaibaidu'></kbd><address id='woaibaidu'><style id='woaibaidu'></style></address><button id='woaibaidu'></button>

          当前位置:主页 > 网络安全 > 加密解密 >
            PHP自定义的加密和解密程序
            2018-04-16 13:03 发布 次浏览

          $tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1); 

          <?php 

          function decrypt($txt,$key) 

          print "Original text : $string <Br>\n"; 
          return $tmp; 

          $ctr++; 
          $txt = keyED($txt,$key); 


          print "Decrypted text : $dec_text <Br>\n"; 

          ?> 


          for ($i=0;$i<strlen($txt);$i++) 
          srand((double)microtime()*1000000); 
          if ($ctr==strlen($encrypt_key)) $ctr=0; 
          $enc_text = encrypt($string,$key); 


          $string = "Hello World !!!"; 

          $dec_text = decrypt($enc_text,$key); 


          $md5 = substr($txt,$i,1); 
          return keyED($tmp,$key); 
          $encrypt_key = md5(rand(0,32000)); 
          for ($i=0;$i<strlen($txt);$i++) 
          (substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1)); 

          // decrypt the encrypted text $enc_text, and store it in $dec_text 
          $tmp.= (substr($txt,$i,1) ^ $md5); 
          $key = "This is supposed to be a secret key !!!"; 

          // encrypt $string, and store it in $enc_text 

          if ($ctr==strlen($encrypt_key)) $ctr=0; 
          $ctr=0; 
          $tmp = ""; 

          function encrypt($txt,$key) 

          $encrypt_key = md5($encrypt_key); 

          function keyED($txt,$encrypt_key) 
          $tmp = ""; 
          $ctr=0; 
          $tmp.= substr($encrypt_key,$ctr,1) . 
          print "Encrypted text : $enc_text <Br>\n"; 
          $i++; 
          for ($i=0;$i<strlen($txt);$i++) 
          return $tmp; 
          $ctr++; 
          $tmp = "";