Entropy measures how much randomness a byte string contains. High-entropy values are uniformly random and difficult to guess; low-entropy values are predictable. Cryptographic systems need enough entropy to create secrets such as keys. section 8.9
A typical operating system gathers noise from multiple sources, mixes that entropy, and uses it to seed a long-term pseudorandom number generator (PRNG). The PRNG can then produce a practical supply of random-looking values. section 8.3
Treat entropy as a security dependency, not merely a property of an API:
- Prefer a programming language’s standard library or a recognized cryptographic randomness library. section 8.3
- Avoid predictable general-purpose generators, such as PHP rand or a non-cryptographic random package. section 8.3
- Handle early boot carefully: /dev/urandom may be predictable before sufficient entropy has accumulated, while getrandom can wait for proper seeding. section 8.3 section 8.4
- Check forked processes, cloned virtual machines, and embedded devices for reused PRNG state or repeated seeds. section 8.4
Choosing a random-byte source
Reading 16 bytes from /dev/urandom can produce a secret on Unix-like systems, while C can call getrandom and PHP can use random_bytes(16). The similarly convenient rand function is not suitable for cryptographic secrets. section 8.3
Figure 8.4 Generating random numbers on a system usually means that entropy was mixed together from different noise sources and used to seed a long-term PRNG.
A system-level diagram shows how noise sources are combined into entropy and used to seed a long-term PRNG. section 8.3












