开发者

Securing parts of an HTTP request?

开发者 https://www.devze.com 2023-01-24 06:02 出处:网络
How does one go about securing parts of an HTTP request, say their Session ID? I know you can use HTTPS, but then your servers must decrypt all of the request. Wouldn\'t it be ideal to only encrypt th

How does one go about securing parts of an HTTP request, say their Session ID? I know you can use HTTPS, but then your servers must decrypt all of the request. Wouldn't it be ideal to only encrypt the required parts of a request?

Are t开发者_如何学运维here any frameworks or resources out that that allow you or inform you how to do this?


HTTPS is the correct tool to use. The computational load of decrypting the packets is very low. Google changed to HTTPS by default for the whole of GMail earlier this year, and they report that the CPU load on their servers for SSL encryption/decryption is around 1%.

If you only encrypt part of the stream then you still have the problem of man-in-the-middle and replay attacks. SSL is the only way to prevent these. It doesn't really matter if the session ID is encrypted. If a man-in-the-middle can capture it, he can reuse it in it's encrypted form, and the server wouldn't know the difference.

Here's a blog post about Google's experience since the GMail switch to 100% SSL.


HTTPS is all or nothing. If not all elements on a page are secured with HTTPS then users will get usually get a "broken lock" in the upper left corner. This is because an attacker could use this to inject an attack similar to xss and obtain the document.cookie value.

Further more if 1 request is sent with a session id then an attacker can obtain the value and authenticate as you.

0

精彩评论

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