Random Number Generation
• Random numbers play an important role in the use of encryption for various
network security applications.
❖The Use of Random Numbers
1. The use of random numbers for the nonces frustrates opponents' efforts to
determine or guess the nonce.
2. Session key generation.
3. Generation of keys for the RSA public-key encryption algorithm.
• 2 distinct and not necessarily compatible requirements for a sequence of random
numbers:
I. randomness
II. unpredictability.
I. Randomness
• Sequence of numbers be random in some well-defined statistical sense.
• The following two criteria are used to validate that a sequence of numbers is random:
➢Uniform distribution: The distribution of numbers in the sequence should be
uniform; that is, the frequency of occurrence of each of the numbers should be
approximately the same.
➢Independence: No one value in the sequence can be inferred from the others.
II. Unpredictability
• The successive members of the sequence are unpredictable.
Pseudorandom Number Generators (PRNGs)
• Cryptographic applications typically make use of algorithmic techniques (deterministic) for
random number generation.
• Produce sequences of numbers that are not statistically random.
• However, if the algorithm is good, the resulting sequences will pass many reasonable tests of
randomness.
• Such numbers are referred to as pseudorandom numbers.
Linear Congruential Generators
• The algorithm is parameterized with four numbers, as follows:
• The selection of values for a, c, and m is critical in developing a good
random number generator.
• For example, consider a, = c = 1.
• The sequence produced is obviously not satisfactory.
• Now consider the values a = 7, c = 0, m = 32, and X0 = 1.
• This generates the sequence {7, 17, 23, 1, 7, etc.
• Of the 32 possible values, only 4 are used; thus, the sequence is said to have
a period of 4.
• For a=5, then the sequence is {5, 25, 29, 17, 21, 9, 13, 1, 5, etc.}, which
increases the period to 8.
• m to be very large (desirable).
• A value of m near to or equal to 231 is typically chosen.
• Three tests to be used in evaluating a random number generator:
1. T1: The function should be a full-period generating function. That is, the function
should generate all the numbers between 0 and m before repeating.
2. T2: The generated sequence should appear random.
3. T3: The function should implement efficiently with 32-bit arithmetic.
• If an opponent knows that the linear congruential algorithm is being used and if the
parameters are known (e.g., a =75, c = 0, m = 231 −1), then once a single number is
discovered, all subsequent numbers are known.
• Even if the opponent knows only that a linear congruential algorithm is being used,
knowledge of a small part of the sequence is sufficient to determine the parameters of the
algorithm.
• Suppose that the opponent is able to determine values for X0, X1, X2 and X3.
Cryptographically Generated Random Numbers
• Encryption logic available to produce random numbers.
• Three representative examples.
1. Cyclic Encryption (used to generate session keys from a master key)
• If 56-bit DES keys are to be produced, then a counter with period 256
can be used.
• After each key is produced, the counter is incremented by one.
• Because the master key is protected, it is not computationally feasible
to deduce any of the session keys (random numbers) through
knowledge of one or more earlier session keys.
• To strengthen the algorithm further, the input could be the output of a
full-period PRNG rather than a simple counter.
❖DES Output Feedback Mode
• The output feedback (OFB) mode of DES can be used for key
generation as well as for stream encryption.
2. ANSI X9.17 PRNG (makes use of triple DES for encryption)
• One of the strongest (cryptographically speaking) PRNGs is specified
in ANSI X9.17.
• A number of applications employ this technique, including financial
security applications and PGP.
• Input: Two pseudorandom inputs drive the generator.
• One is a 64-bit representation of the current date and time.
• The other is a 64-bit seed value.
• Keys: The generator makes use of three triple DES encryption
modules. All three make use of the same pair of 56-bit keys.
• Output: The output consists of:-
• a 64-bit pseudorandom number
• a 64-bit seed value.
3. Blum Blum Shub Generator
• A popular approach to generating secure pseudorandom number is known as the Blum,
Blum, Shub (BBS) generator, named for its developers.
• First, choose two large prime numbers, p and q, that both have a remainder of 3 when
divided by 4. That is,
• For example, the prime numbers 7 and 11.
• Let n = p x q.
• Next, choose a random number s, such that s is relatively prime to n; this is equivalent to
saying that neither p nor q is a factor of s.
• X₀ = s² mod n
• For i = 1, 2, 3, …:
• 𝑥𝑖 = (𝑥𝑖−1 )² mod n
• 𝐵𝑖 = 𝑥𝑖 mod 2
• BBS generator produces a sequence of bits Bi
• The BBS is referred to as a cryptographically secure pseudorandom
bit generator (CSPRBG).
• A CSPRBG is defined as one that passes the next-bit test.
• A pseudorandom bit generator is said to pass the next-bit test if there is not a
polynomial-time algorithm.
• Given the first k bits of the sequence, there is not a practical algorithm that can
even allow you to state that the next bit will be 1 (or 0) with probability greater
than 1/2.
• The security of BBS is based on the difficulty of factoring n.
True Random Number Generators
• A true random number generator (TRNG) uses a nondeterministic
source to produce randomness.
• Most operate by measuring unpredictable natural processes, such as
pulse detectors of ionizing radiation events, gas discharge tubes, and
leaky capacitors.
• Intel has developed a commercially available chip that samples
thermal noise by amplifying the voltage measured across undriven
resistors.
• A group at Bell Labs has developed a technique that uses the
variations in the response time of raw read requests for one disk sector
of a hard disk.