4

Recently I found that Netscape used quite simple algorithm to generate random number for Message Authentication Code to establish an HTTPS connection (Netscape used time, process identification number, and parent-process identification number).

So now I wonder what source of seed do modern browsers use to guarantee true randomness?

2
  • You might find this article interesting. spectrum.ieee.org/computing/hardware/… It doesn't answer your question specifically, but it answers where we get our random numbers currently.. and where we'll get them in the near future. It's also not too dry.. good read.
    – user606723
    Commented Sep 19, 2011 at 21:34
  • Also, you'll notice they start out by talking about netscape.. so this article is, in fact, very relevant.
    – user606723
    Commented Sep 19, 2011 at 21:34

1 Answer 1

8

Modern browsers do the smart thing: they ask the operating system. The OS interacts with hardware all day long; that's its main purpose. So it is in the right place to gather randomness and mix it with a properly secure cryptographic random number generator. On Windows systems, this is made available to application though the CryptGenRandom() function. Linux has the special file /dev/urandom for that. Some programming languages offer their own API for that (which internally feeds on the OS), e.g. java.security.SecureRandom for Java.

The hardware sources that the OS may employ primarily includes the cycle-accurate time at which hardware events occur (e.g. the precise nanosecond at which you press a key, or a network packet is received). The OS can thus get "enough" true randomness to power a RNG, which will then yield good alea by the megabyte ("good" = "indistinguishable from true randomness, up to an overwhelming work factor" = "good for crypto").

1
  • 1
    And I would add that you can still do this without having to trust that the system source is adequate. It is not difficult at all to combine randomness from multiple sources such that the output is at least as strong as its strongest input. Commented Sep 20, 2011 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .