How do you stop the client from changing the state into one it shouldn't?
It's easy: cryptographically sign the state.
| [reply] |
Then you switch from needing to store a session ID in a database to needing to store and manage a private key. Not only that, but I can't imagine the ending size being less than the 160-bits needed for SHA1 (or 256 or 512 bits, if you want more secure hashes).
I'll continue looking for a solution that's better than cookies + secure ID + database.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
| [reply] |
Why do you think it is so difficult?
All you need is a single secret on the server. Then you can compute a signature as the hash of the secret plus the outgoing state plus a random salt. The signature, salt, and state are emitted in the response. When a request comes in, verify its signature by comparing it to the hash of the server's secret plus the client's salt and state.
Easy as pie.
If you're paranoid, you can add timestamps, rotate secrets, and use public-key signatures, none of which makes the job much more difficult. And, even if you do consider it more difficult, why does it matter for the day-to-day web programmer? This stuff is part of the web-app framework and invisible to end programmers.
Cheers, Tom
| [reply] |
| [reply] [d/l] |
People who talk about using one-time pads in practice are generally either military or idiots.
It takes a lot of work to generate (and in many cases to communicate) a one-time pad. Any reuse of data (or use of low-entropy random number generators) ruins the entire concept entirely, resulting in something that cryptographers assure me is easily broken. The required effort is fine for the military. But very few commercial applications find it feasible.
| [reply] |
resulting in something that cryptographers assure me is easily broken
Yup. When you implement an OTP with a cyclic key, it's called a Vigenere Cipher. The attack looks at letter frequencies and their distributions within the ciphertext.
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
| [reply] |
| [reply] |