computes a pseudorandom 32-bit integer and returns that integer modulo
It returns 0 if
initializes the pseudorandom number generator, taking account of
the current process ID, and the current time.
Notes on DNS query security
A DNS client will accept any response that shows up at the right time, is
addressed from the IP address of the legitimate server, is addressed to the
UDP port used in the DNS query, repeats the query name and type used in the
DNS query, and repeats the 16-bit ID used in the DNS query.
An active sniffing attacker can easily forge responses by copying information
from queries. Blind attackers need to guess the time, UDP port, and ID for
the targeted query name.
to create query IDs and UDP ports. The
generator is designed to be extremely difficult to predict for an attacker
who cannot guess
Note, however, that there are only about a billion possible ID-port pairs,
so a prolonged blind attack will succeed eventually.