5

It want to use a random number generator in security application such cryptography.

I know that srand(time(NULL)) can be used to generate random numbers at run time.

Is there a more secure implementation of a secure random number generator in the C standard library?

jwpfox
  • 5,124
  • 11
  • 45
  • 42
Elhaw
  • 325
  • 3
  • 18
  • 1
    On recent Linux distributions, the `getrandom` system call can be used to get crypto-secure random numbers. http://stackoverflow.com/a/2572373/646887 – Klas Lindbäck Dec 13 '16 at 08:19
  • 2
    http://stackoverflow.com/a/39475626/6850771 – MD XF Dec 13 '16 at 08:35
  • 1
    http://stackoverflow.com/a/822368/6850771 – MD XF Dec 13 '16 at 08:37
  • 1
    Note that you could use any *external* secure random number generator to **seed** an *internal* DRBG (or CSPRNG), i.e. a deterministic random number generator. That's often very secure *and* very speedy. You may want to use a library routine or open source implementation for that though. – Maarten Bodewes Dec 13 '16 at 21:33

0 Answers0