問題描述
是否有任何可以加密數據的 javascript 函數:例如,我想在我的 ajax GET 請求傳遞的 URL 中使用加密數據,
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
其中 TDjsavbuydksabjcbhgy 相當于 12345 的加密數據.現在我想通過解密來檢索 PHP 中的數據,以便我可以使用 12345.
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.
提前致謝.
推薦答案
我不確定在 javascript 中進行加密會獲得什么.您的整個例程和加密密鑰對公眾有效.如果您要防止嗅探,則應使用 SSL.
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中解密?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!