3 ms·
Any stream cipher? If you use the same symmetric key and nonce, the output bit stream should be the same every time. This is how OpenBSD's arc4random(3) start
by throw0101a 7y ago
Any stream cipher?
If you use the same symmetric key and nonce, the output bit stream should be the same every time.
This is how OpenBSD's arc4random(3) started out: using the output of RC4 and stirring the entropy pool regularly to ensure forward security. (They've since switched to ChaCha20.)
* https://man.openbsd.org/arc4random.3 https://man.openbsd.org/arc4random.3
Remove the stirring and you've got deterministic output. Security comes from the entropy of the initial conditions.
- enriquto 7y agoYes, something like that would be great! But does it come packaged nicely? So that I can compile it out of the box on windows, linux, macos, android?
- jedisct1 7y agoThe `randombytes_deterministic()` function from libsodium or libhydrogen does exactly what the name suggests.
- SAI_Peregrinus 7y agoMonocypher is a decent fit here. Just run its ChaCha20 with (a hash of) your seed as the key. Larger libraries (libsodium, NaCl, etc) are decent too, but bigger.
- tptacek 7y agoAlternative opinion: Don't use Monocypher. Much less safe than libsodium.
- slrz 7y agoLibbsd includes it. https://libbsd.freedesktop.org/ https://libbsd.freedesktop.org/