justinas/nosurf

Use only crypto/rand for token generation.

justinas opened this issue · 1 comments

math/rand is cryptographically insecure and thus isn't suitable for token generation. We should switch to only using crypto/rand.

This should be an easy, non-breaking change.

The new token algorithm is up on master. It utilizes crypto/rand, acquiring 32 bytes from it and encoding them in base64. SHA256 has been removed out of the equation, as it's usefulness in this is questionable.