15-853Page1 15-853:Algorithms in the Real World Generating Random and Pseudorandom Numbers.

Slides:



Advertisements
Similar presentations
Foundations of Cryptography Lecture 10 Lecturer: Moni Naor.
Advertisements

What we learn with pleasure we never forget. Alfred Mercier Smitha N Pai.
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
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.
Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Random Sources.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
© 2003 School of Computing, University of Leeds SY32 Secure Computing, Lecture 15 Implementation Flaws Part 3: Randomness and Timing Issues.
Stream cipher diagram + + Recall: One-time pad in Chap. 2.
Using random numbers Simulation: accounts for uncertainty: biology (large number of individuals), physics (large number of particles, quantum mechanics),
ACT1 Slides by Vera Asodi & Tomer Naveh. Updated by : Avi Ben-Aroya & Alon Brook Adapted from Oded Goldreich’s course lecture notes by Sergey Benditkis,
Genetic Algorithms Can Be Used To Obtain Good Linear Congruential Generators Presented by Ben Sproat.
Pseudorandom Number Generators
Statistics.
Pseudorandom Bit Generation Artur Gadomski Piero Giammarino Henrik Goldman Massimo Giulio Caterino.
Random Number Generation
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
Cryptography and Network Security Chapter 7
Random Number Generation Fall 2013
Efficient Pseudo-Random Number Generation for Monte-Carlo Simulations Using GPU Siddhant Mohanty, Subho Shankar Banerjee, Dushyant Goyal, Ajit Mohanty.
Pseudorandom Number Generators. Randomness and Security Many cryptographic protocols require the parties to generate random numbers. All the hashing algorithms.
Entropy of Keys and Password Generation Introduction to entropy Entropy and data compression Predictability of random number generation Entropy and system.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Pseudo-random Number Generation Qiuliang Tang. Random Numbers in Cryptography ► The keystream in the one-time pad ► The secret key in the DES encryption.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings.
Cryptography and Network Security (CS435)
Códigos y Criptografía Francisco Rodríguez Henríquez A Short Introduction to Stream Ciphers.
Random Numbers CSE 331 Section 2 James Daly. Randomness Most algorithms we’ve talked about have been deterministic The same inputs always give the same.
Random Number Generators Tamer ÖZ. Random Number Generators OUTLINE Randomness And Random Number Usefulness Of Random Numbers Random Number Generators.
Randomized Algorithms (Probabilistic algorithm) Flip a coin, when you do not know how to make a decision!
CS 521 Computational Science 1 Random Numbers and Monte Carlo Methods Charles Erwin and Jay Hatcher.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.
CPSC 531: RN Generation1 CPSC 531:Random-Number Generation Instructor: Anirban Mahanti Office: ICT Class Location:
Chapter 7 Random-Number Generation
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.
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
Pseudo-random generators Random Number Generating There are three types of generators table look-up generators hardware generators algorithmic (software)
Monte Carlo Methods.
Experimental Method and Data Process: “Monte Carlo Method” Presentation # 1 Nafisa Tasneem CHEP,KNU
LECTURE 14 TUESDAY, 13 OCTOBER STA 291 Fall
APPENDIX D R ANDOM N UMBER G ENERATION Organization of chapter in ISSO* – General description and linear congruential generators Criteria for “good” random.
Chapter 7 – Confidentiality Using Symmetric Encryption.
Chapter 7 Confidentiality Using Symmetric Encryption.
Outline Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) Receivers (Chapter 5) (week 3 and 4) Received Signal Synchronization.
Chapter 10 Hashing. The search time of each algorithm depend on the number n of elements of the collection S of the data. A searching technique called.
Pseudorandom numbers John von Neumann: Any one who considers
Fall 2006CS 395: Computer Security1 Confidentiality Using Symmetric Encryption.
Lecture 10. Paradigm #8: Randomized Algorithms Back to the “majority problem” (finding the majority element in an array A). FIND-MAJORITY(A, n) while (true)
The man who knew 28% of mathematics. John Von Neumann ( ) Hans Bethe: Academic seminars (10.
Unit 2 Modular Arithmetic and Cryptography IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 2 Modular Arithmetic and Cryptography.
Chapter 7 – Confidentiality Using Symmetric Encryption.
MONTE CARLO METHOD DISCRETE SIMULATION RANDOM NUMBER GENERATION Chapter 3 : Random Number Generation.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
1.  How does the computer generate observations from various distributions specified after input analysis?  There are two main components to the generation.
3. Random Number Generator
Generating Random Numbers
Network Traffic Randomness for Cryptographic Purposes
Random Number Generation
Random-Number Generation
Chapter 7 Random-Number Generation
Properties of Random Numbers
POINT ESTIMATOR OF PARAMETERS
Computing and Statistical Data Analysis Stat 3: The Monte Carlo Method
Pseudorandom number, Universal Hashing, Chaining and Linear-Probing
Computer Simulation Techniques Generating Pseudo-Random Numbers
Random Number Generation
Generating Random and Pseudorandom Numbers
Generating Random and Pseudorandom Numbers
Presentation transcript:

15-853Page :Algorithms in the Real World Generating Random and Pseudorandom Numbers

15-853Page2 Welch brings down McCarthy McCarthy: Jim, will you get the citation, one of the citations showing that this was the legal arm of the Communist Party, and the length of time that he belonged, and the fact that he was recommended by Mr. Welch. I think that should be in the record.... Welch: Senator, you won't need anything in the record when I finish telling you this. Until this moment, Senator, I think I never really gauged your cruelty, or your recklessness. … Welch: … Let us not assassinate this lad further, Senator. McCarthy: Let's, let's -- Welch: You've done enough. Have you no sense of decency, sir, at long last? Have you left no sense of decency?

15-853Page3 Random number sequence definitions Each element is chosen independently from a probability distribution [Knuth]. Randomness of a sequence is the Kolmogorov complexity of the sequence (size of smallest Turing machine that generates the sequence) – infinite sequence should require infinite size Turing machine.

15-853Page4 Outline Environmental sources of randomness Testing randomness Pseudorandom number generators Cryptographically secure random number generators

15-853Page5 Environmental Sources of Randomness Radioactive decay Radio frequency noise Noise generated by a resistor or diode. –Canada (find the data encryption section, then look under RBG1210. My device is an NM810 which is 2?8? RBG1210s on a PC card) –Colorado –Holland –Sweden Inter-keyboard timings (watch out for buffering) Inter-interrupt timings (for some interrupts)

15-853Page6 Combining Sources of Randomness Suppose r 1, r 2, …, r k are random numbers from different sources. E.g., r 1 = from JPEG file r 2 = sample of hip-hop music on radio r 3 = clock on computer b = r 1  r 2  …  r k If any one of r 1, r 2, …, r k is truly random, then so is b.

15-853Page7 Skew Correction Von Neumann’s algorithm – converts biased random bits to unbiased random bits: Collect two random bits. Discard if they are identical. Otherwise, use first bit. Efficiency?

15-853Page8 Analysis of random.org numbers John Walker’s Ent program Entropy = bits per character. Optimum compression would reduce the size of this character file by 0 percent. Chi square distribution for samples is , and randomly would exceed this value percent of the times. Arithmetic mean value of data bytes is (127.5 = random). Monte Carlo value for PI is (error 0.08 percent). Serial correlation coefficient is (totally uncorrelated = 0.0

15-853Page9 Analysis of JPEG file Entropy = bits per character. Optimum compression would reduce the size of this character file by 0 percent. Chi square distribution for samples is , and randomly would exceed this value 0.01 percent of the times. Arithmetic mean value of data bytes is (127.5 = random). Monte Carlo value for Pi is (error 0.90 percent). Serial correlation coefficient is (totally uncorrelated = 0.0).

15-853Page10 Chi Square Results The low-order 8 bits returned by the standard Unix rand() function: Chi square distribution for samples is 0.01, and randomly would exceed this value percent of the times. Improved generator due to [Park & Miller]: Chi square distribution for samples is , and randomly would exceed this value percent of the times. Random sequence created by timing radioactive decay events:timing radioactive decay events Chi square distribution for samples is , and randomly would exceed this value percent of the times.

15-853Page11 Chi Square Test Experiment with k outcomes, performed n times. p 1, …, p k denote probability of each outcome Y 1, …, Y k denote number of times each outcome occured Large X 2 indicates deviance from random chance Computed numerically. probability X 2 value calculated for an experiment with d degrees of freedom (where d=k-1, one less the number of possible outcomes) is due to chance

15-853Page12 Spectral Test Maximum distance d s between adjacent parallel hyperplanes, taken over all hyperplanes that cover the vectors x i (s) = (x i, x i+1, …, x i+s-1 ).

15-853Page13 A Different Spectral Test – Frequency Analysis One bit in a sequence of bytes, generated by hardware.

15-853Page14 Pseudorandom Number Generators Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin. John Von Neumann, 1951

15-853Page15 Linear Congruential Generator x 0 = given, x n+1 = P 1 x n + P 2 (mod N) n = 0,1,2,... (*) x 0 =79, N = 100, P 1 = 263, and P 2 = 71 x 1 = 79* (mod 100) = (mod 100) = 48, x 2 = 48* (mod 100) = (mod 100) = 95, x 3 = 95* (mod 100) = (mod 100) = 56, x 4 = 56* (mod 100) = (mod 100) = 99, Sequence: 79, 48, 95, 56, 99, 8, 75, 96, 68, 36, 39, 28, 35, 76, 59, 88, 15, 16, 79, 48, 95 Park and Miller: P 1 = 16807, P 2 = 0, N= = , x 0 = 1. ANSI C rand(): P 1 = , P 2 = 12345, N = 2 31, x 0 = 12345

15-853Page16 Plot (x i, x i+1 ) Park and Miller

15-853Page17 (x i, x i+1 ), (x i,x i+2 ), (x i, x i+2 )

15-853Page18 Matsumoto’s Marsenne Twister Considered one of the best linear congruential generators.

15-853Page19 Non-linear Generators

15-853Page20 Cryptographically Strong Pseudorandom Number Generator Next-bit test: Given a sequence of bits x 1, x 2, …, x k, there is no polynomial time algorithm to generate x k+1. Yao [1982]: A sequence that passes the next-bit test passes all other polynomial-time statistical tests for randomness.

15-853Page21 Hash Chains Hash or Encryption Function key xixi x i+1 Last bit of x i+1 (need a random seed x 0 or key value)

15-853Page22 BBS “secure” random bits BBS (Blum, Blum and Shub, 1984) –Based on difficulty of factoring, or finding square roots modulo n = pq. Fixed p and q are primes such that p = q = 3 (mod 4) n = pq (is called a Blum integer) For a particular bit seq. Seed: random x relatively prime to n. Initial state: x 0 = x 2 i th state: x i = (x i-1 ) 2 i th bit: lsb of x i Note that: Therefore knowing p and q allows us to find x 0 from x i