Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:crypto.strong_rand_bytes/1 can throw a low_entropy exception #1

Open
igalic opened this issue Jan 7, 2018 · 0 comments
Open

:crypto.strong_rand_bytes/1 can throw a low_entropy exception #1

igalic opened this issue Jan 7, 2018 · 0 comments

Comments

@igalic
Copy link

igalic commented Jan 7, 2018

according to its documentation, :crypto.strong_rand_bytes/1 can throw an exception:

May throw exception low_entropy in case the random generator failed due to lack of secure "randomness".

we should at least document that this can happen

there's some options beyond that:

  • do/try around :crypto.strong_rand_bytes(16) to optionally return an error
  • have an weak_entropy_init/1 helper that can be used on potentially low entropy systems

this kind of issue will generally happens early after startup when not enough entropy hasn't been gathered, or if the system doesn't implement a sensible PRNG (a CSPRNG, that is;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant