Random Number Generation Graham Netherton Logan Stelly.

Slides:



Advertisements
Similar presentations
Generating Random Numbers
Advertisements

Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
History of Random Number Generators Bob De Vivo Probability and Statistics Summer 2005.
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.
© 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.
Random Numbers Dick Steflik. Pseudo Random Numbers In most cases we do not want truly random numbers –most applications need the idea of repeatability.
Pseudorandom Number Generators
CSCE Monte Carlo Methods When you can’t do the math, simulate the process with random numbers Numerical integration to get areas/volumes Particle.
Random numbers in Python Nobody knows what’s next...
Computer Security CS 426 Lecture 3
Random Thoughts 2012 (COMP 066) Jan-Michael Frahm Jared Heinly.
Pseudorandom Number Generators. Randomness and Security Many cryptographic protocols require the parties to generate random numbers. All the hashing algorithms.
ETM 607 – Random Number and Random Variates
Section 5.1 What is Probability? 5.1 / 1. Probability Probability is a numerical measurement of likelihood of an event. The probability of any event is.
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.
Cryptography and Network Security (CS435)
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.
The Shrinking Rule 30 Cellular Automata Pseudorandom Number Generator University of the Philippines Cebu Department of Computer Science Cmsc142, Cmsc190,
Random Number Generators Tamer ÖZ. Random Number Generators OUTLINE Randomness And Random Number Usefulness Of Random Numbers Random Number Generators.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.

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.
Modeling and Simulation Random Number Generators
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
Chapter 7 – Confidentiality Using Symmetric Encryption.
Chapter 7 Confidentiality Using Symmetric Encryption.
Attacks on PRNGs - By Nupura Neurgaonkar CS-265 (Prof. Mark Stamp)
M ONTE C ARLO SIMULATION Modeling and Simulation CS
Random Number Generator. Random number Random number: Uniform distribution on [0,1] Random device: dice, coin -> cannot generate the equal sequence.
Network Security Lecture 18 Presented by: Dr. Munam Ali Shah.
PRNGs Pseudo-random number generation. Randomness and Cryptography Randomness and pseudo-randomness are useful in cryptography: –To generate random and.
Inference: Probabilities and Distributions Feb , 2012.
Fall 2006CS 395: Computer Security1 Confidentiality Using Symmetric Encryption.
Pseudo Randomness (in digital system) PRESENTED BY GROUP 8 SHU-YU HUANG, FONG-JHENG LIN
Random numbers in C++ Nobody knows what’s next....
CSci 162 Lecture 7 Martin van Bommel. Random Numbers Until now, all programs have behaved deterministically - completely predictable and repeatable based.
Random Numbers RANDOM VS PSEUDO RANDOM. Truly Random numbers  From Wolfram: “A random number is a number chosen as if by chance from some specified distribution.
Chapter 10 Understanding Randomness. Why Be Random? What is it about chance outcomes being random that makes random selection seem fair? Two things: –
R ANDOM N UMBER G ENERATORS Modeling and Simulation CS
G. Cowan Lectures on Statistical Data Analysis Lecture 5 page 1 Statistical Data Analysis: Lecture 5 1Probability, Bayes’ theorem 2Random variables and.
Chapter 7 – Confidentiality Using Symmetric Encryption.
0 Simulation Modeling and Analysis: Input Analysis 7 Random Numbers Ref: Law & Kelton, Chapter 7.
Statistics 11 Understanding Randomness. Example If you had a coin from someone, that they said ended up heads more often than tails, how would you test.
Chapter 3 Generating Uniform Random Variables. In any kind of simulation, we need data, or we have to produce them. Especially in Monte Marco simulation.
UNIFORM RANDOM NUMBER GENERATION Chapter 7 (first half) The goal is to generate a sequence of The goal is to generate a sequence of Uniformly distributed.
Key Wrap Algorithm.
Understanding Cryptography – A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl Chapter 2 – Stream Ciphers These slides were.
10.Deterministic Randomness 1.Random Sequences Random Sequences A sequence of numbers r 1, r 2,... is random if there are no discernible patterns.
Why they aren't really random
Generating Random Numbers
A cryptographically secure pseudorandom number generator for Julia
Random numbers Taken from notes by Dr. Neil Moore
Random Number Generation
Random vs pseudo random
Chapter 7 Random Number Generation
Chapter 7 Random-Number Generation
Lecture 2 – Monte Carlo method in finance
Computer Simulation Techniques Generating Pseudo-Random Numbers
Generating Random and Pseudorandom Numbers
Generating Random and Pseudorandom Numbers
Pseudorandom Numbers Network Security.
Presentation transcript:

Random Number Generation Graham Netherton Logan Stelly

What is RNG? RNG = Random Number Generation Random Number Generators simulate random outputs, such as dice rolls or coin tosses

Traits of random numbers Random numbers should have a uniform distribution across a range of values o Every result should be equally possible Each random number in a set should be statistically independent of the others

Why are random numbers useful? Random numbers are useful for a variety of purposes, such as Generating data encryption keys Simulating and modeling Selecting random samples from large data sets Gambling Video games

Algorithms in RNG Computers can’t be truly random Rely on inputs Algorithms can mask inputs and make outputs seem random

Pseudo-Random Number Generators Called PRNGs for short The numbers produced are not truly random Use algorithms to produce a sequence of numbers which appear random Efficient: fast Deterministic: a given sequence of numbers can be reproduced if the starting values are known Periodic: the sequence will eventually repeat

How PRNG Works Uses a “seed” to determine values and a function to interpret the seed The same seed always generates the same values in the same order o Deterministic Flaw: If the seed and function are known, results can be predicted

Seeds in Action Say we have a seed x and a PRNG function f: f(x) = y, for all x ∈ {x} It’s clear that this always generates the same number PRNG functions may base the seed on a changing value, e.g. the computer clock

Linear Congruential Generator X n+1 = (aX n + c) mod m modulus m, 0 < m multiplier a, 0 < a < m increment c, 0 < c < m seed value X 0, 0 < X 0 < m Used by java.util.Random, among others

PRNG in Cryptography PRNG can be used to encrypt/decrypt data Pro: Unique encryption can be performed each time Con: If both the seed and random function are known, third parties can intercept/interfere with messages

Examples of PRNG applications Simulation and Modeling applications o it is useful that the same sequence of numbers can be generated so simulations can be recreated with only one aspect modified each time Video Games o it is useful that the numbers can be generated very quickly and it is not as important that the data be truly random o Diablo 1 Speedruns

Chi-Square Test A method often used to compare the randomness of random number generators Involves producing sequences of 1000 random integers between 1 and 100 For a perfectly random distribution one would expect to have 10 occurrences of each integer (1-100), so the expected frequency is 10 The actual frequency for the generator is then calculated and the difference between the two can be used calculate the chi- square value A value of 100 indicates uniform distribution

Chi-Square Test Formula: o R = possible number of different random integers o O = observed frequency of integer i o E = expected Frequency of integer i Can be reduced to:

A Comparison of Four PRNGs 1.WICHMANN AND HILL o Combines 3 linear congruential generators with c = 0 2.MITCHELL AND MOORE o Generates numbers based on the last 55 numbers 3.MARSAGLIA o Uses the last 2 numbers to generate the next; long period 4.L’ECUYER o Combines 2 linear congruential generators with c = 0

Results for Chi-Square

Timing Results

Periods For a small (personal) computer: Marsaglia has been used on supercomputers (ETA Supercomputer) and has a period long enough for use in supercomputer applications

True RNG There are ways to get around the predictability of PRNG These involve generating the numbers outside of the computer o Usually use special equipment Significantly slower than PRNG o Limit to how fast numbers can be “harvested”

Traits of True RNG Inefficient: slow - must “harvest” numbers Non-deterministic: numbers cannot be predicted by knowing certain values Aperiodic: sequence of numbers does not repeat after a certain amount of time

Examples of True RNG random.org: uses space noise to generate unpredictable random numbers HotBits: times radioactive decay and reports back random numbers based on it

TRNG Applications Lotteries and Draws Gambling Security Some applications which require true randomness substitute pseudo randomness, occasionally to disastrous results

PRNG Failures PHP for Microsoft Windows o study conducted by Bo Allen in 2008 to test randomness of the rand() function in PHP on Microsoft Windows o Same issue not found on Linux rand() function on windows: true RNG:

PRNG Failures Cracking the lottery o Mohan Srivastava  Geological Statistician  In 2003 he cracked the number generation pattern on tic-tac-toe scratch off games  Could predict winning tickets correctly with 95% accuracy  Also able to break super bingo scratch off game and predict winners with 70% accuracy  Reported findings to Ontario Lottery and Gaming Corporation

PRNG Failures o Joan Ginther  Math professor with PhD from Stanford University  Won lottery scratchcard jackpots four times  Total winnings total more than $20 million  Does not admit to breaking code

References Allen, B. (2012, February 26). Pseudo-Random vs. True Random.. Retrieved April 26, 2014, from Graham, W. (). A Comparison of Four Pseudo Random Number Generators. ACM SIGSIM Simulation Digest, 22, Haahr, M. (n.d.). Introduction to Randomness and Random Numbers. Random.org. Retrieved April 26, 2014, from Lanyado, B. (2011, August 10). Want to win millions on scratchcards?. The Guardian. Retrieved April 26, 2014, from scratchcards Midgley, J. (2011, January 31). Cracking the Scratch Lottery Code. Wired. Retrieved April 26, 2014, from

The End