如何解密XOR密码?

时间:2017-10-01 11:43:39

标签: php

<?php 

// The reply from server is Encrypted using XOR key = 12498
    // You shoud store this key securly inside your code. don't make it exposed to everyone.
    // You have to pass the string to XOR decryption function.
    // And the Result will be JSON code.
    // you can google for C code using XOR encryption.
    // Note: to see decrypted XOR string: pass this parameter to url: &raw=yes
    // We use this PHP function for XOR


 function _xor($InputString, $KeyPhrase=12498){

  $retString='';
  for ($j = 0; $j < strlen($InputString); $j++)
     $retString .= chr(ord(substr($InputString, $j, 1)) ^ $KeyPhrase);

  return $retString;
 }

$p= _xor("momen jaber");
echo $p;

  ?>

0 个答案:

没有答案