A cryptographically secure pseudorandom number generator for Julia

Slides:



Advertisements
Similar presentations
CS470, A.SelcukStream Ciphers1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Advertisements

Random Number Generation Graham Netherton Logan Stelly.
Random Number Generation. Random Number Generators Without random numbers, we cannot do Stochastic Simulation Most computer languages have a subroutine,
Digital Kommunikationselektroink TNE027 Lecture 6 (Cryptography) 1 Cryptography Algorithms Symmetric and Asymmetric Cryptography Algorithms Data Stream.
Stream ciphers 2 Session 2. Contents PN generators with LFSRs Statistical testing of PN generator sequences Cryptanalysis of stream ciphers 2/75.
CIS 5371 Cryptography 3b. Pseudorandomness.
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
Random number generation Algorithms and Transforms to Univariate Distributions.
Random Number Generators. Why do we need random variables? random components in simulation → need for a method which generates numbers that are random.
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.
The Problem With The Linpack Benchmark 1.0 Matrix Generator Jack J. Dongarra and Julien Langou International Journal of High Performance Computing Applications.
Pseudorandom Number Generators
Computer Security CS 426 Lecture 3
APPENDIX D RANDOM NUMBER GENERATION
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Pseudorandom Number Generators. Randomness and Security Many cryptographic protocols require the parties to generate random numbers. All the hashing algorithms.
Cryptanalysis. The Speaker  Chuck Easttom  
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Random Number Generation Pseudo-random number Generating Discrete R.V. Generating Continuous R.V.
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
KAIS T A lightweight secure protocol for wireless sensor networks 윤주범 ELSEVIER Mar
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.
Chapter 20 Symmetric Encryption and Message Confidentiality.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
Random-Number Generation Andy Wang CIS Computer Systems Performance Analysis.

CS 450 – Modeling and Simulation Dr. X. Topics What Does Randomness Mean? Randomness in games Generating Random Values Random events in real life: measuring.
Information Security Lab. Dept. of Computer Engineering 182/203 PART I Symmetric Ciphers CHAPTER 7 Confidentiality Using Symmetric Encryption 7.1 Placement.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
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.
Pseudo-random generators Random Number Generating There are three types of generators table look-up generators hardware generators algorithmic (software)
CS555Spring 2012/Topic 111 Cryptography CS 555 Topic 11: Encryption Modes and CCA Security.
Chapter 7 Confidentiality Using Symmetric Encryption.
Attacks on PRNGs - By Nupura Neurgaonkar CS-265 (Prof. Mark Stamp)
PRNGs Pseudo-random number generation. Randomness and Cryptography Randomness and pseudo-randomness are useful in cryptography: –To generate random and.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
Pseudo Randomness (in digital system) PRESENTED BY GROUP 8 SHU-YU HUANG, FONG-JHENG LIN
Chapter 7 – Confidentiality Using Symmetric Encryption.
Slide 1 Vitaly Shmatikov CS 378 Stream Ciphers. slide 2 Stream Ciphers uRemember one-time pad? Ciphertext(Key,Message)=Message  Key Key must be a random.
CS 179: GPU Computing Lecture 16: Simulations and Randomness.
Key Wrap Algorithm.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
Issues of Random Numbers and Cryptography
Cryptography Lecture 5 Arpita Patra © Arpita Patra.
Generating Random Numbers
Modern symmetric-key Encryption
Random numbers Taken from notes by Dr. Neil Moore
Topic 5: Constructing Secure Encryption Schemes
Cryptography Lecture 5.
Random Number Generation
CMSC 414 Computer and Network Security Lecture 3
Cryptography Lecture 6.
Random-Number Generation
B504/I538: Introduction to Cryptography
STREAM CIPHERS by Jennifer Seberry.
Cryptography and Network Security Chapter 7
Cryptography Lecture 5.
Computer Simulation Techniques Generating Pseudo-Random Numbers
Randomness and Statistical Tests
Generating Random and Pseudorandom Numbers
Generating Random and Pseudorandom Numbers
Pseudorandom Numbers Network Security.
Cryptography Lecture 15.
Counter Mode, Output Feedback Mode
Stream Cipher Structure
Presentation transcript:

A cryptographically secure pseudorandom number generator for Julia JuliCha (ChaCha.jl): A cryptographically secure pseudorandom number generator for Julia Adam Sealfon

Random numbers in computing Modeling and simulation Optimization Randomized algorithms Approximation algorithms Primality testing Games, e.g. poker Cryptography

Pseudorandom number generators (PRNGs) True randomness is expensive or limited PRNGs take a short random seed and expand it to produce a long sequence of bits that “look random” Programs can use this instead of true randomness The sequence should have the same statistical properties as a random sequence, e.g.: Roughly equal number of 0s and 1s Short substrings are repeated with the expected probability Ascending and descending sequences should occur in the right pattern Random binary matrices should have high rank etc.

The need for better pseudorandomness For some applications it’s not enough for PRNG output to have the same statistical properties as a random string We want it to be impossible to distinguish from true randomness E.g. Poker, cryptography Poor design or buggy implementations of PRNGs has led to cryptographic breaks

Cryptographically secure PRNGs (CS-PRNGs) No efficient program should be able to tell whether it is given PRNG output or truly random bits Equivalently, having seen many bits of the output, no efficient program should be able to guess the next bit more than 50% of the time Indistinguishable from true randomness, so safe to use for cryptography More complicated than ordinary PRNGs, so they tend to be slower

PRNGs in Julia AbstractRNG MersenneTwister ChaCha CS-PRNG LCG is the old standard. Imperfect, but good enough for many practical purposes. MersenneTwister predictable after 624 iterations Linear Congruential Generator

PRNGs in Julia AbstractRNG MersenneTwister JuliCha LCG is the old standard. Imperfect, but good enough for many practical purposes. Linear Congruential Generator

The ChaCha CS-PRNG State consists of 16 32-bit words Constants State consists of 16 32-bit words From initial configuration, apply transformation via a sequence of additions, bit shifts, and xors For each counter value, extract 512 pseudorandom bits. Then increment counter. Key Counter Nonce

The ChaCha CS-PRNG Relatively fast Easy to parallelize Constants Relatively fast Easy to parallelize Can be used as a stream cipher for encryption Adopted by Google as the basis for MACs in OpenSSL Key Counter Nonce

The U01 Test suite Runs a series of statistical tests on PRNG output Implemented in Julia package RNGTest.jl JuliCha and MersenneTwister passed all smallCrush tests LCG behaved variably depending on parameters

Runtime of ChaCha vs. MersenneTwister

Runtime of ChaCha vs. C libcrypto wrapper Not shown: wrapper for system call to /dev/urandom

Runtime of ChaCha vs. C libcrypto wrapper

Median time to produce 1000 UInt32s Mersenne Twister ChaCha C libcrypto wrapper OS /dev/ urandom 3.19 μs 271.64 μs 1.4 ms 6.8 s 85x faster - 5x slower 25,000x slower

Encryption using JuliCha