Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

Remove the stirring and you've got deterministic output. Security comes from the entropy of the initial conditions.



Yes, 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?


The `randombytes_deterministic()` function from libsodium or libhydrogen does exactly what the name suggests.



Monocypher 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.


Alternative opinion: Don't use Monocypher. Much less safe than libsodium.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: