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. With code for both JS and PHP parts.
There is no need for security as it's merely a means to obscure the string in the header.
XOR seems to be the best/lightest way. There are plenty of examples with incomplete answers.
The easiest answer seems to be the required PHP to decode this answer of the JS part: Simple Javascript encrypt, PHP decrypt with shared secret key
Open to any other lightweight methods.