3 ms·
Security is more important. Storing anything in the cookie apart from a simple identifying token increases the attack surface. If you use encryption and an HMA
by jacques_chester 14y ago
Security is more important. Storing anything in the cookie apart from a simple identifying token increases the attack surface.
If you use encryption and an HMAC to harden up said cookie, you need to a) not bugger up your scheme and b) pay the overhead the calculations. For the HMAC it's trivial, but ciphers are a bit more involved.
- moe 14y agoI agree there's a small risk of buggering up. But it's a one-time effort to get it right and reviewed, encrypting a string is not exactly rocket science. AES overhead is a non-issue for all but the very largest sites. A modern CPU can pipe north of 100MB/sec through AES - it's very unlikely to become the bottleneck in a python web-app.