Javascript XOR Encrypt | PHP XOR Decrypt [closed]
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.
If you XOR it, chances are you'll end up with invalid characters in your headers.
If you don't need security, what is wrong with good ol' base64_encode()
/base64_decode()
? There are plenty of Javascript equivalent codes out there...
精彩评论