如何加密数据在javascript和解密php? [英] How to encrypt data in javascript and decrypt in php?
问题描述
http://sample.com/mypage/TDjsavbuydksabjcbhgy
其中 TDjsavbuydksabjcbhgy 相当于 12345 的加密数据。
现在我想通过解密来获取PHP中的数据,以便我可以使用 12345 。
是否可能?或者任何关于如何做的建议。
提前感谢。
我不知道通过在javascript中进行加密可以获得什么。您的整个例行程序和加密密钥可供公众有效使用。如果您想防止嗅探,您应该使用SSL。
Is there any javascript function that can encrypt data: For example i want to use encrypted data in my URL passed by ajax GET request,
http://sample.com/mypage/TDjsavbuydksabjcbhgy
where TDjsavbuydksabjcbhgy an encrypted data equivalent to 12345. Now i want to retrieve that data in PHP by decrypting it, so that i can use the 12345.
Is it possible? or any suggestion on how to do that.
Thanks in advance.
I'm not sure what you would gain by doing encryption in javascript. Your entire routine and encryption key are effectively available to the public. If you are trying to protect against sniffing, you should use SSL.
这篇关于如何加密数据在javascript和解密php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!