4 ms·
As alright2565 already mentioned, sticking rand() in there doesn't add any benefit over a key + counter. Without rand() it would be something like SHA3-CTR --
by tczajka 3y ago
As alright2565 already mentioned, sticking rand() in there doesn't add any benefit over a key + counter.
Without rand() it would be something like SHA3-CTR -- it's not standardized which is why I would prefer ChaCha20, but it has been proposed for standardization and yes it's probably a fine algorithm.
- josephg 3y ago> it's probably a fine algorithm. Yeah. I'm nervous about inventing my own RNG. It seems like one of those things thats much more difficult than it appears on the surface. Especially an RNG thats aiming to be crypto-secure.
- tatersolid 3y ago> I'm nervous about inventing my own RNG. You should be, but in this case you’re actually not inventing your own CSPRNG. NIST SP 800-90A defines HASH_DRBG as hashing a seed (aka key) plus a counter and it is defined for basically any cryptographic hash function.