Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypt Cookie in browser

I want to encrypt cookie in browser

Please tell me the different ways to do this

Thanks

like image 829
Tushar Ahirrao Avatar asked Feb 25 '23 23:02

Tushar Ahirrao


1 Answers

Your question isn't very clear. You should use HTTPS for the connection and set the secure flag to make sure that the cookie is always sent encrypted. I assume that is what you want to do.

If you're thinking about doing your own encryption in JavaScript then don't do it because you won't get the level of neither security nor performance anywhere near that of SSL/TLS that the browser has already built in.

If you're serious about cookies security then I recommend reading the Secure Cookie Protocol paper by Liu, Kovacs, Huang and Gouda (PDF).

like image 165
Zed Avatar answered Mar 08 '23 08:03

Zed