Random Numbers - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Random Numbers

Description:

Blum-Blum-Shub (BBS) method, named after the authors who ... BBS involves choosing two primes p and q that both have a reminder of 3 when divided by 4 ... – PowerPoint PPT presentation

Number of Views:194
Avg rating:3.0/5.0
Slides: 18
Provided by: lakshmisr
Category:
Tags: bbs | numbers | random

less

Transcript and Presenter's Notes

Title: Random Numbers


1
Random Numbers
2
Random Numbers
  • Random number
  • Pseudo random number
  • Uses for random number in cryptography

3
Random Numbers
  • Random number should not be predictable
  • The numbers should not be uniform
  • Measure of randomness is entropy
  • A 32-bit key that is generated completely
    randomly has entropy of 32 bits
  • A 32-bit key that has only 4 different values has
    entropy of 2 bits ( Entropy comes from the
    exponent value of 22 4)

4
Random Numbers
  • Many programming languages support random number
    generators. User provides the seed value
  • Random numbers are in the range 0 to 1. To get a
    random number between 1 and 100 the user
    multiplies the random value by 100, takes the
    integer value and then add the value 1.
  • Rule is to multiply the random value by the upper
    limit of the range, get the integer value of the
    product and then add the lower limit to the result

5
Random Numbers
  • E.g., Find a random number between 1 and 100.
    Your Java or C program produces a random value
    using the random number generator as 0.520647
  • INT(0.520647 100) 52
  • Add 1
  • So the random number is 1 52 53

6
Random Numbers
  • Randomness is measured in a statistical sense
  • Criteria for randomness
  • Uniform distribution, i.e., the frequency of
    occurrence of the numbers is approximately the
    same
  • Independence, i.e., one value in the sequence has
    no relation to any other value in the sequence

7
Pseudorandom Numbers
  • Pseudorandom numbers are predictable
  • Generated by deterministic methods
  • Common abbreviation for Pseudorandom Number
    Generator is PRNG
  • John Kelsey developed a PRNG called Yarrow in
    1999
  • Yarrow has an internal state that can be updated
    using a block cipher

8
Pseudorandom Numbers
  • Ferguson and Schneier have developed another PRNG
    method called Fortuna
  • Fortuna has three parts
  • Fixed size seed
  • An accumulator collects and pools the entropy
  • Seed file control ensures randomness
  • Fortunas generator is a block cipher in CTR
    mode. Recall that CTR generates a stream of data.

9
Pseudorandom Numbers
  • PRNGs are generated using a method known as
    linear congruence
  • m 0 is the modulus
  • n is the multiplier
  • c is the increment
  • s0 is the seed
  • Linear congruence methods generates random
    numbers iteratively

10
Pseudorandom Numbers
  • si1 (nsi c) mod m
  • 0 ? si
  • Choice of n, c and m are critical
  • n c s0 1 and m 8 produces random numbers
    2, 3, 4, 5, 6, 7, 0, 1. This set is not random
    at all.
  • n 7, c 0, m 32 and s0 1 produces the set
    7, 17, 23, 1, 7, 17, 23, 1, . This set has a
    period 4, meaning that after the 4th number there
    is repetition in the sequence

11
Pseudorandom Numbers
  • Suggested rules to follow for a PRNG
  • The function should generate all numbers between
    0 and m-1 (both inclusive) before repeating
  • The sequence generated must be random
  • The function should be efficient when implemented
    with 32-bit arithmetic (Recall that CTR method
    was more efficient than CBC method)

12
Pseudorandom Numbers
  • For a 56-bit DES key, a counter with period 256
    is used
  • Another popular PRNG is ANSI X9.17
  • X9.17 is a very strong PRNG
  • It is used in PGP and financial security
    applications
  • X9.17 uses two inputs one is the 64-bit
    representation of current date and time and the
    other is a 64-bit arbitrary seed value

13
Pseudorandom Numbers
  • Keys are generated using three 3DES modules.
    Each of the three modules use the same pair of
    56-bit keys. Recall that in 3DES (all three
    keys could be distinct or two of the keys could
    be the same)
  • first key encrypts plaintext producing cipher1
  • second key decrypts cipher1 producing cipher2
  • first key encrypts cipher2 producing the
    ciphertext

14
Pseudorandom Numbers
  • Output of X9.17 is a 64-bit pseudorandom number
    and a 64-bit seed value
  • Another popular PRNG is
  • Blum-Blum-Shub (BBS) method, named after the
    authors who developed this in 1986
  • BBS is a secure PRNG method
  • BBS involves choosing two primes p and q that
    both have a reminder of 3 when divided by 4
  • E.g., 7 and 11 have this property

15
BBS method
  • Take large primes p and q that have a reminder of
    3 upon division by 4
  • Let n p q
  • Choose a seed s relatively prime with n
  • Algorithm
  • X0 s2 mod n
  • For i 1 to ?
  • Xi (Xi-1)2 mod n
  • Bi Xi mod 2

16
BBS method
  • Bi denotes the least significant bit in each
    iteration
  • The algorithm generates the bits continuously
  • User decides how many of the bits to choose to
    form the number, e.g., 64-bits chosen to form a
    key

17
Uses for Random Numbers
  • Where is a random number used?
  • Key generation in RSA
  • Key generation by a CA
  • Authentication schemes (use of nonce is common
    with the random numbers)
Write a Comment
User Comments (0)
About PowerShow.com