How long the period of the Erlang crypto random number?

I need a cryptographically secure random number generator that the period is equal or larger than 2^256. I don’t know if the random number generator provided by Erlang crypto module meets the needs.

1 Like

I don’t know about the period, but the strongest random number generator in the Erlang / Otp library is strong_rand_bytes in the crypto module. This function uses OpenSSL’s RAND_bytes function, and OpenSSL claim that it is cryptographically secure.

2 Likes

The rand module provides such a generator (exs1024s). Make sure to seed it with strong_rand_bytes if needed, though. This page has an example of seeding:

2 Likes