Assume I'm using the following code to generate pseudo-random sessionID's:
sessionID = SHA-512(GENERATE-GUID())
The GUIDs are pretty deterministic, i.e. I see lots of GUIDs with a lot of the same hexadecimals.
My simple question is: How deterministic are my resulting sessionID's?
The algorithms for SHA are supposed to create very different hashes even if a small number of bits are different due to its cascading effect, so how easily could you "guess" (within reasonable time) another sessionID from the resulting hashes?
/dev/urandom
on linux andCryptGenRandom
on windows. Most languages offer an easy to use wrapper on top of them. For example in C# you'd useRNGCryptoServiceProvider
. – CodesInChaos Nov 22 '13 at 16:20