开发者

Javascript XOR Encrypt | PHP XOR Decrypt [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or exp开发者_开发技巧ertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜