title: Javascript XOR Encrypt | PHP XOR Decrypt
body: <p>I am looking for a simple and lightweight method of encrypting a string with javascript then decrypting with PHP after it's been sent in a header. <strong>With code for both JS and PHP parts</strong>.</p>
  
  <p>There is no need for security as it's merely a means to obscure the string in the header.</p>
  
  <p>XOR seems to be the best/lightest way. There are plenty of examples with incomplete answers.</p>
  
  <p>The easiest answer seems to be the required PHP to decode this answer of the JS part: <a href="https://stackoverflow.com/questions/3609005/simple-javascript-encrypt-php-decrypt-with-shared-secret-key/3609208#3609208">Simple Javascript encrypt, PHP decrypt with shared secret key</a></p>
  
  <p>Open to any other lightweight methods.</p>