pseudo-random generators random number generating there are three types of generators table look-up...

Post on 02-Jan-2016

255 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Pseudo-random generators

Random Number Generating

There are three types of generatorstable look-up generatorshardware generatorsalgorithmic (software) generatorsThe third category is the one most often used in cryptography. It does not produce a truly random number but rather a pseudo random number.

Is a given PRNG good enough?•The German Federal Office for Information Security (BSI) has established four criteria for quality of random number generators:• K1 A sequence of random numbers with a low probability of containing identical

consecutive elements.• K2 A sequence of numbers which is indistinguishable from 'true random' numbers

according to specified statistical tests..• K3 It should be impossible for any attacker to calculate, or otherwise guess, from any

given sub-sequence, any previous or future values in the sequence.• K4 It should be impossible for an attacker to calculate, or guess from an inner state of

the generator, any previous numbers in the sequence or any previous inner generator states.

•To be suitable for cryptography any PRNG should meet K3 and K4 standards

Mersenne Twister

Linear congruential generator

A linear congruential generator is determined by the following four integer values m the modulus m > 0a the multiplier 0 , 0 < a < mc the increment 0, 0 < c< mX0 the starting value 0, 0 <X0 < m

The algorithm is

Xn + 1 = (aXn + c)mod m Where n>0

Lehmer random number generator

Lehmer random number generator

The basic algorithm is

Xi + 1 = (aXi + c) mod m , with 0 ≤ Xi ≤ m

X0, a, and c are known as the seed, multiplier, and the increment respectivelyM is 2p-1 where p is the CPU bits (32 bit, 64 bit, etc.)If we pick small numbers to make the math easy like this

For example, consider m = 31, a = 7, c = 0 and begin with X0 = 19. The next integers in the sequence are9, 1, 7, 18, 2, 14, 5, 4, 28, 10, 8, 25, 20, 16

If the multiplier and seed are chosen properly, a Lehmer generator is statistically indistinguishable from drawing from with replacement.

You can see a code implementation of this PRNG at http://www.seas.gwu.edu/~simhaweb/java/lectures/appendix/random.html

Lagged Fibonacci Generator

Naor-Reingold Pseudorandom Function

top related