2

A headless server can suffer from a lack of entropy, which is a problem given that encryption needs random numbers. In the absence of a hardware random number generator (RNG) the numbers must be generated by software.

And a busy Tor server can consume a lot of those numbers.

Which software RNG is the "best" (i.e. least deterministic) at providing the random numbers needed for secure cryptography on Linux?

Mike Ounsworth
  • 57,707
  • 21
  • 150
  • 207

2 Answers2

3

If you have some entropy to work with, then use /dev/urandom. Either the kernel has it, or you can inject it in /dev/urandom (e.g. with "cat file > /dev/urandom").

If you do not have such entropy, then you lose.

Note that being headless is not the major issue, since even without a keyboard and mouse, the machine still has disks and network, and get a lot of entropy-bearing hardware events from these. If the machine got "enough" entropy at any point in its life since the OS was installed, then, by the magic of cryptography, it still has it, and /dev/urandom is how you access it. The one remaining issue is when you begin to clone virtual machines.

/dev/urandom is always preferable over /dev/random.

Thomas Pornin
  • 320,799
  • 57
  • 780
  • 949
0

This is a Linux question not really a Tor question but the standard for secure Linux environments is /dev/urandom. The difference between /dev/urandom and /dev/random is discussed in this article. On modern machines, this choice is less consequential than decades ago.

https://stackoverflow.com/questions/3690273/did-i-understand-dev-urandom

Lizbeth
  • 757
  • 6
  • 14