Use and Testing of Pseudo-random Number Generators (PRNGs) A. Matthew Amthor Senior Project 2003.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security
Advertisements

Generating Random Numbers
Random Number Generation Graham Netherton Logan Stelly.
Digital Kommunikationselektroink TNE027 Lecture 6 (Cryptography) 1 Cryptography Algorithms Symmetric and Asymmetric Cryptography Algorithms Data Stream.
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
CS 202 Epp section ?? Aaron Bloomfield
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Random Numbers. Two Types of Random Numbers 1.True random numbers: True random numbers are generated in non- deterministic ways. They are not predictable.
Random number generation Algorithms and Transforms to Univariate Distributions.
Session 4 Asymmetric ciphers.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
© 2003 School of Computing, University of Leeds SY32 Secure Computing, Lecture 15 Implementation Flaws Part 3: Randomness and Timing Issues.
Cryptography and Network Security, resuming some notes Dr. M. Sakalli.
Stream cipher diagram + + Recall: One-time pad in Chap. 2.
Pseudorandom Number Generators
Distinguishing Features of Simulation Time (CLK)  DYNAMIC focused on this aspect during the modeling section of the course Pseudorandom variables (RND)
Stream Ciphers 1 Stream Ciphers. Stream Ciphers 2 Stream Ciphers  Generalization of one-time pad  Trade provable security for practicality  Stream.
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
Session 6: Introduction to cryptanalysis part 1. Contents Problem definition Symmetric systems cryptanalysis Particularities of block ciphers cryptanalysis.
Session 2: Secret key cryptography – stream ciphers – part 1.
Computer Security CS 426 Lecture 3
APPENDIX D RANDOM NUMBER GENERATION
15-853Page :Algorithms in the Real World Generating Random and Pseudorandom Numbers.
Random Number Generation Fall 2013
Pseudo-random Number Generation Qiuliang Tang. Random Numbers in Cryptography ► The keystream in the one-time pad ► The secret key in the DES encryption.
ETM 607 – Random Number and Random Variates
Random Number Generators CISC/QCSE 810. What is random? Flip 10 coins: how many do you expect will be heads? Measure 100 people: how are their heights.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
CPE 619 Random-Number Generation Aleksandar Milenković The LaCASA Laboratory Electrical and Computer Engineering Department The University of Alabama in.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
Network Security Lecture 19 Presented by: Dr. Munam Ali Shah.
Information Security Lab. Dept. of Computer Engineering 182/203 PART I Symmetric Ciphers CHAPTER 7 Confidentiality Using Symmetric Encryption 7.1 Placement.
Basic Concepts in Number Theory Background for Random Number Generation 1.For any pair of integers n and m, m  0, there exists a unique pair of integers.
Stream Cipher July 2011.
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Monte Carlo Methods.
Session 1 Stream ciphers 1.
PRBG Based on Couple Chaotic Systems & its Applications in Stream- Cipher Cryptography Li Shujun, Mou Xuanqin, Cai Yuanlong School of Electronics & Information.
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Linear Feedback Shift Register. 2 Linear Feedback Shift Registers (LFSRs) These are n-bit counters exhibiting pseudo-random behavior. Built from simple.
Introduction to Modern Symmetric-key Ciphers
Attacks on PRNGs - By Nupura Neurgaonkar CS-265 (Prof. Mark Stamp)
Validating a Random Number Generator Based on: A Test of Randomness Based on the Consecutive Distance Between Random Number Pairs By: Matthew J. Duggan,
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
PRNGs Pseudo-random number generation. Randomness and Cryptography Randomness and pseudo-randomness are useful in cryptography: –To generate random and.
Pseudo-random-number generators. Random numbers: the numbers generated by a stochastic process They are indispensible in any simulations based on radom.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
Key Wrap Algorithm.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 2 – Stream Ciphers These slides were.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-5 Mathematical Background:
Generating Random Numbers
A cryptographically secure pseudorandom number generator for Julia
Background: Lattices and the Learning-with-Errors problem
Cryptography Lecture 15.
Random-Number Generation
Chapter 7 Random Number Generation
Chapter 7 Random-Number Generation
Introduction to Modern Symmetric-key Ciphers
Cryptography and Network Security Chapter 7
Validating a Random Number Generator
Computer Simulation Techniques Generating Pseudo-Random Numbers
Generating Random and Pseudorandom Numbers
Generating Random and Pseudorandom Numbers
Cryptography Lecture 15.
Mathematical Background: Extension Finite Fields
Presentation transcript:

Use and Testing of Pseudo-random Number Generators (PRNGs) A. Matthew Amthor Senior Project 2003

Topical Summary PRNGs, Linear Congruential Generators to Combined Hybrid Generators Tests for Randomness, Knuth to Marsaglia Applications for PRNGs

Definition of Generator From L’Ecuyer A structure,, with A finite number of states An initial state or seed (The transition function) (The output function) A finite number of outputs

Definition of Period The Period, p, for a given generator is the minimum value of k for which the n th state of the generator is equal to the (n+k) th state of the generator. A finite period is required by the finite number of states and the function T.

Linear Congruential Generator (LCG) Some Popular/Infamous LCGs Maple RANDU Mathematica > x:=rand();

defines a function, T, such that a state, s, uniquely determines the following state, we can easily say that. Properties of the LCG Because and In fact, it has been shown that the maximum is p=m-1 only if m is prime, the multiplier a is a primitive root mod M and.

Extended Linear Congruential Generator (ELCG aka RG) Also referred to as Recursive Generator (RG). Note that but rather: And therefore it is no longer true that:, or that NOT TRUE!

Combined Linear Congruential Generator (cLCG) As before, Methods of Combination L’EcuyerWichmann & Hill Bit wise XOR

Wichman and Hill cLCG Combined Linear Congruential Generators are equivalent to generators with larger moduli.

Multiple Recursive Generator (MRG) Produced by a combination of RGs of the form: MRG designed by Grube for. Note: definition of indices for coefficients, a, is off by one from my definition. Uses 3 generators

Shuffling Outputs, The Bays-Durham Shuffle Time to Use the Whiteboard

Feedback Shift Register (FSR or LFSR) Output is a stream of bits. The period is limited by the number of states. Note:

Full Period LFSR For Example, <-monic irreducable? is monic irreducable for this n. The period then is the smallest m so that f(x) divides x m + 1. In this case m=15. Hmm…

That Doesn’t Look Random Source: pLab website Lattice structure exhibited by any generator based on multiplicative linear- congruential methods. (LCG, cLCG, ELCG, MRG, as well as FSR, and Fibonacci) Lattice structure exists in all dimensions. (3-d lattice at right)

Inverse Congruential Generator (ICG) The ICG shows no lattice structure, though some symmetries are evident. with such that,

Tests for Randomness Uniform distribution in k-dim space Monte Carlo value for pi Rank permutation distribution Characteristics of spectral lattice Selected tests from DIEHARD by Marsaglia GCD, value and iterations necessary Birthday spacings repeated

Uniform Distribution in k-dimensions Divide the space into N bins of equal size. Form a number, P, of k-tuples from the random numbers. Count the number, n, of k-dimensional vectors in each bin. ?

Rank Permutation Distribution Generate n sets with m random numbers in each set Replace the numbers in each set with their rank within that set (1..m). Check for a uniform distribution of each of the m! possible orderings

Monte Carlo Value for Pi See Maple worksheet: MonteCPi.mws

Spectral Test in s-Dimensions Considers the maximal distance between adjacent parallel hyperplanes in the s-dimensional lattice. The maximum of these values over all families is d s Images from pLab website; K. Entacher, P. Hallekalek (poor 2-d lattice structures)

GCD Test from DIEHARD a b 366 = 1* = 4* = 3* = 3* = 2*3 + 0 (k=5 iterations) GCD(a,b) = 6 Applying Euclid’s algorithm to two integers will produce several quantities to examine. The distributions of k and GCD(a,b) have been studied extensively.

Results from GCD Test For, The distribution of GCD(a,b) was found by extensive simulation.

Birthday Spacings Test from DIEHARD Generate m birthdays in a year of length n using PRNG outputs. Poisson distribution approximates the number of duplicated values among ordered birthday spacings asymptotically with. Diehard uses an especially rigerous n=2 32 and m=2 12, such that.

Results from B’day Test KISS Generator

Selected Applications Monte Carlo simulations Cryptography Computational number theory

Monte Carlo Simulations For Radioactive Decay Simulation See Maple worksheet: MonteCDecay.mws

Cryptography PRNGs are used to generate secret keys. Emphasis is on unpredictability. Private Key: Decrypts info encrypted with the public key Public Key: Used to encrypt info sent to you

What to Look for in a Cryptographic PRNG Assume attackers will know your generator algorithm. Very large number of states Strong separation between the state value and the output value Reseeding process or other means of adding entropy continuously to the state

Cryptographic Generator: DSA PRNG Optional Input (least states used in DSA) (state is “hidden” in output) (new state incorporates optional input)

Computational Number Theory Additional properties of purely random numbers are required beyond uniform distribution. Outputs should have prime factorizations and relative GCDs consistent with a purely random generator.

References J. Woods, personal communication. E. Green, personal communication. P. Patten personal communication. G. Marsaglia and W. Tsang, 2002, Some Difficult-to-pass Tests of Randomness, Journal of Statistical Software, Volume 7, Issue 3. C. C. Klimasauskas, 2002, Not Knowing Your Random Number Generator Could Be Costly: Random Generators – Why Are They Important, PCAI, Volume 16, Number 3. Pierre L’Ecuyer, 1994, Uniform Random Number Generators, Annals of Operations Research. J. Kelsey, B. Schneier, D. Wagner, and C. Hall, Cryptanalytic Attacks on Pseudorandom Number Generators,

References (cont.) Diehard Program and Associated Documentation by G. Marsaglia, D. M. Ceperley, 2000, Random Number Generation, Spectral Test Server, K. Entacher, P. Hellekalek, W. Cherowitzo, Linear Feedback Shift Registers, 2000, math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html Sieve of Eritosthenes,

References (cont.) C. E. Praeger, Linear Feedback Shift Registers, 2001, pter4.html pter4.html Unknown Author, Statistical Tests, Unknown Author, Teaching Notes for the Probabilistic Number Theory Problem, pNumberTheory_teach.asp pNumberTheory_teach.asp Unknown Author, Linear Feedback Shift Registers, And a very special thanks goes to Mr.&Mrs.