22.6 Random number generation
In ChapterĀ 3 A Secret to Share, we learned that the security of most protocols and mechanisms depends on the generation of random sequences of bits or numbers. These sequences must have a sufficient length and be random in a very specific sense: We do not want an attacker to be able to guess part of or the whole sequence.
Why? Recall the example from ChapterĀ 3 A Secret to Share: The size of the key space of the AES-256 encryption algorithm is 2256. If the AES-256 key was selected using a truly random source, Eve would have to try on average 2255 candidate keys before she found the correct key.
However, if Alice generates the key by first choosing a 32-bit random number and then turning it into a 256-bit key using some complicated but deterministic expansion algorithm E, then Eve needs to try only 231 possible keys on average (obtained by running every possible 32-bit random number through E). To prevent this, Alice and Bob must generate the keys...