SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Because "use urandom" isn’t everything: a deep dive into
CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner
azet@azet.org
lambda.co.at:
Highly-Available, Scalable & Secure Distributed Systems
SHA2017 - 06/08/2017
Why do we need Random Numbers?
randomize stuff in your operating system / language
man rand
Python: os.urandom
TLS session cookies
Key generation (e.g. RSA / Diffie-Hellman)
TCP SYN cookies
Bash: ${RANDOM} :)
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 1/1
CSPRNG i
“Cryptographically Secure Pseudo Random Number Generator”
aka “RNG”, “Random number generator”..
Crypto nerds tend to call them “CSPRNGs” you may call them RNG or whatever, I don’t
care that much as long as it’s secure!
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 2/1
CSPRNG ii
Widely implemented in OS kernels
Linux: /dev/urandom
1. manpage man random has been wrong for years
2. many myths about kernel entropy
FreeBSD: /dev/*random
1.
2. Replace the RC4 algorithm for generating in-kernel secure random numbers with Chacha20. Keep
the API, though, as that is what the other *BSD’s have done. Use the boot-time entropy stash (if
present) to bootstrap the in-kernel entropy source.
(https://svnweb.freebsd.org/base?view=revision&revision=317015 - Sun Apr 16 09:11:02 2017 UTC)
Windows: RtlGenRandom()
..and in programming languages
(i.e. Python os.urandom, PHP rand(),..)
some had really bad bugs for a long time (i.e. debian predictable SSH keys: CVE-2008-0166)
many use the kernel provided CSPRNG, others use OpenSSL or custom RNGs - which is BAD!
OpenSSL provides a user-space RNG many link to or make use of (don’t!)
Whoops: CVE-2017-11671: GCC generates incorrect code for RDRAND/RDSEED
intrinsics (recent)SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 3/1
Some History
the /dev/random and /dev/urandom devices used to be really old code (mid-90ties)
originated from Ted Tso and a few others
the manpage for them was wrong until fixed in late last december!
you don’t have to worry about kernel entropy - this is a myth!
HAVEGE won’t save you! it can make things worse (See:
https://blog.cr.yp.to/20140205-entropy.html)
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 4/1
Old Linux Kernel implementation 0.x>4.x
mixing different pools of interrupts
quite complicated to understand even for well versed C programmers
it worked without larger incidents - probably pure luck and researchers unable to read
char device code
old design described well here:
Blog Post: https://pthree.org/2014/07/21/the-linux-random-number-generator/
Academic: https://eprint.iacr.org/2012/251.pdf
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 5/1
curiosities in (drivers/char/random.c)
Splevin ARX
fast_mix implemented by George Splevin - never explained and no crypto experience -
homebrewed ARX
that code is still around - even in the upstream kernel git repo:
Code here: https://tinyurl.com/fastmix
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 6/1
Current implementation i
after long discussions and advice by crytographers the old design in random.c was
changed in 4.2
based on the old pools, AES-NI (if available - modern Intel/AMD CPUs have those),
ChaCha20 XOR RdSEED (via Google’s BoringSSL / Adam Langley -
https://marc.info/?l=linux-crypto-vger&m=146584488030185&w=2)
neat design, backtracking resistant, pretty fast, too:
azet@nd01 ~ % dd if=/dev/urandom of=/dev/null bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 11.8289 s, 90.8 MB/s
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 7/1
Current implementation ii
major work overhauling crypto-code in the kernel started with Linux 4.2
Backtracking protection
(https://marc.info/?l=linux-crypto-vger&m=146583297126471&w=2)
Ted Tso (Jun 13, 2016): With /dev/urandom we were always emitting more bytes
than we had entropy available, because not blocking was considered more
important. Previously we were relying on the security of SHA-1. With
AES CTR-DRBG, you rely on the security with AES.
(https://marc.info/?l=linux-crypto-vger&m=146584488030185&w=2)
Doesn’t track entropy anymore because the “CRNG” (terminology,..) is faster
(https://marc.info/?l=linux-crypto-vger&m=146458684806389&w=2)
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 8/1
Current implementation iii
random: replace urandom pool with a CRNG
(https://marc.info/?l=linux-crypto-vger&m=146217043829396&w=2)
Nikos Mavrogiannopoulos
(https://marc.info/?l=linux-crypto-vger&m=146229250001030&w=2):
I know, and I share this opinion. To their defense they will have to
provide a call which doesn‚t make applications fail in the following
scenario:
1. crypto/ssl libraries are compiled to use getrandom() because it is
available in libc and and in kernel
2. everything works fine
3. the administrator downgrades the kernel to a version without
getrandom() because his network card works better with that version
4. Mayhem as applications fail
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 9/1
Current implementation iv
random: make /dev/urandom scalable for silly userspace programs
(https://marc.info/?l=linux-crypto-vger&m=146583311726544&w=2):
On a system with a 4 socket (NUMA) system where a large number of
application threads were all trying to read from /dev/urandom, this
can result in the system spending 80% of its time contending on the
global urandom spinlock. The application should have used its own
PRNG, but let‚s try to help it from running, lemming-like, straight
over the locking cliff.
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 10/1
Current implementation v
Myths and lies in man 4 random finally corrected:
https://bugzilla.kernel.org/show_bug.cgi?id=71211&utm_content=buffer1d02b
this took years of convincing the original upstream authors etc.
had a huge impact on use of RNGs in programming languages etc.
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 11/1
Language issues: Ruby
using OpenSSL RNG designed for fast TLS use, not general purpose
multiple security engineers and cryptographers tried to convince them to switch to
/dev/urandom
took more than a year but finally they implemented a similar design to libsodium (I’ve
made a T-Shirt!)
SecureRandom without OpenSSL (or compatible alternatives) is nonsense.
Please don't rude.
Legendary bug: https://bugs.ruby-lang.org/issues/9569
Tony Arcieri (@bascule) wrote a wrapper for the time being:
https://github.com/cryptosphere/sysrandom
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 12/1
Language issues: Node.js
similar story to Ruby
lots of input from normal users (useless)
https://github.com/nodejs/node/issues/5798 (endless thread)
Latest comment: ‘Note that OpenSSL has just landed a commit to use DRGB with
AES-CTR of NIST SP 800-90A as openssl/openssl@75e2c87. We can use it with the
os-specific seeding source (e.g. /dev/urandom) by a default define flag of
OPENSSL_RAND_SEED_OS. I think it is best for us to wait for the next release of
OpenSSL-1.1.1.“
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 13/1
Language issues: Erlang
same as Ruby and Node.js
https://github.com/erlang/otp/blob/maint/lib/crypto/c_src/crypto.c
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 14/1
Python imrprovement
warns if there’re insecure values: https://bugs.python.org/issue27292
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 15/1
OpenSSL
Not thread safe - userspace - prone to bugs
https://github.com/openssl/openssl/issues/898
https://wiki.openssl.org/index.php/Random_Numbers
Not even recommended by OpenSSL to use it as non-TLS CSPRNG
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 16/1
‘ HAVEGE
dangerous to use!
not maintained in more than 10yrs
no current contacts / security audits except by the original authors
doesn’t improve security!
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 17/1
Parting words
...
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 18/1
THANKS FOR YOUR PATIENCE. ARE THERE ANY QUESTIONS?
Twitter:
@a_z_e_t
E-Mail:
azet@azet.org
XMPP:
azet@jabber.ccc.de
GitHub:
https://github.com/azet
GPG Fingerprint:
7CB6 197E 385A 02DC 15D8 E223 E4DB 6492 FDB9 B5D5
SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages
Aaron Zauner 19/1

Contenu connexe

Tendances

Media Files : Android's New Nightmare
Media Files :  Android's New NightmareMedia Files :  Android's New Nightmare
Media Files : Android's New NightmareOguzhan Topgul
 
Python for pentesters
Python for pentestersPython for pentesters
Python for pentestersRashid feroz
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...Shakacon
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceJason Choi
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisChong-Kuan Chen
 
2017 DevSecCon ZAP Scripting Workshop
2017 DevSecCon ZAP Scripting Workshop2017 DevSecCon ZAP Scripting Workshop
2017 DevSecCon ZAP Scripting WorkshopSimon Bennetts
 
Automatic tool for static analysis
Automatic tool for static analysisAutomatic tool for static analysis
Automatic tool for static analysisChong-Kuan Chen
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesenSilo
 
Remotely Compromising iOS via Wi-Fi and Escaping the Sandbox
Remotely Compromising iOS via Wi-Fi and Escaping the SandboxRemotely Compromising iOS via Wi-Fi and Escaping the Sandbox
Remotely Compromising iOS via Wi-Fi and Escaping the Sandboxmark-smith
 
How Your DRAM Becomes a Security Problem
How Your DRAM Becomes a Security ProblemHow Your DRAM Becomes a Security Problem
How Your DRAM Becomes a Security Problemmark-smith
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Maksim Shudrak
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelPeter Hlavaty
 
Nozzle: A Defense Against Heap-spraying Code Injection Attacks
Nozzle: A Defense Against Heap-spraying Code Injection AttacksNozzle: A Defense Against Heap-spraying Code Injection Attacks
Nozzle: A Defense Against Heap-spraying Code Injection Attacksguest101353
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
Sysdig Tokyo Meetup 2018 02-27
Sysdig Tokyo Meetup 2018 02-27Sysdig Tokyo Meetup 2018 02-27
Sysdig Tokyo Meetup 2018 02-27Michael Ducy
 
Metasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeMetasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeE Hacking
 
Defcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomDefcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomPriyanka Aash
 
securing_syslog_onFreeBSD
securing_syslog_onFreeBSDsecuring_syslog_onFreeBSD
securing_syslog_onFreeBSDwebuploader
 

Tendances (18)

Media Files : Android's New Nightmare
Media Files :  Android's New NightmareMedia Files :  Android's New Nightmare
Media Files : Android's New Nightmare
 
Python for pentesters
Python for pentestersPython for pentesters
Python for pentesters
 
Dock ir incident response in a containerized, immutable, continually deploy...
Dock ir   incident response in a containerized, immutable, continually deploy...Dock ir   incident response in a containerized, immutable, continually deploy...
Dock ir incident response in a containerized, immutable, continually deploy...
 
Automated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security IntelligenceAutomated Malware Analysis and Cyber Security Intelligence
Automated Malware Analysis and Cyber Security Intelligence
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
 
2017 DevSecCon ZAP Scripting Workshop
2017 DevSecCon ZAP Scripting Workshop2017 DevSecCon ZAP Scripting Workshop
2017 DevSecCon ZAP Scripting Workshop
 
Automatic tool for static analysis
Automatic tool for static analysisAutomatic tool for static analysis
Automatic tool for static analysis
 
Injection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniquesInjection on Steroids: Codeless code injection and 0-day techniques
Injection on Steroids: Codeless code injection and 0-day techniques
 
Remotely Compromising iOS via Wi-Fi and Escaping the Sandbox
Remotely Compromising iOS via Wi-Fi and Escaping the SandboxRemotely Compromising iOS via Wi-Fi and Escaping the Sandbox
Remotely Compromising iOS via Wi-Fi and Escaping the Sandbox
 
How Your DRAM Becomes a Security Problem
How Your DRAM Becomes a Security ProblemHow Your DRAM Becomes a Security Problem
How Your DRAM Becomes a Security Problem
 
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
Fuzzing malware for fun & profit. Applying Coverage-Guided Fuzzing to Find Bu...
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
Nozzle: A Defense Against Heap-spraying Code Injection Attacks
Nozzle: A Defense Against Heap-spraying Code Injection AttacksNozzle: A Defense Against Heap-spraying Code Injection Attacks
Nozzle: A Defense Against Heap-spraying Code Injection Attacks
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Sysdig Tokyo Meetup 2018 02-27
Sysdig Tokyo Meetup 2018 02-27Sysdig Tokyo Meetup 2018 02-27
Sysdig Tokyo Meetup 2018 02-27
 
Metasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning TreeMetasploit - The Exploit Learning Tree
Metasploit - The Exploit Learning Tree
 
Defcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-roomDefcon 22-jesus-molina-learn-how-to-control-every-room
Defcon 22-jesus-molina-learn-how-to-control-every-room
 
securing_syslog_onFreeBSD
securing_syslog_onFreeBSDsecuring_syslog_onFreeBSD
securing_syslog_onFreeBSD
 

Similaire à Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages

Gluster Cloud Night in Tokyo 2013 -- Tips for getting started
Gluster Cloud Night in Tokyo 2013 -- Tips for getting startedGluster Cloud Night in Tokyo 2013 -- Tips for getting started
Gluster Cloud Night in Tokyo 2013 -- Tips for getting startedKeisuke Takahashi
 
Introduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptxIntroduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptxKnoldus Inc.
 
Snyk Intro - Developer Security Essentials 2022
Snyk Intro - Developer Security Essentials 2022Snyk Intro - Developer Security Essentials 2022
Snyk Intro - Developer Security Essentials 2022Liran Tal
 
Containers - Portable, repeatable user-oriented application delivery. Build, ...
Containers - Portable, repeatable user-oriented application delivery. Build, ...Containers - Portable, repeatable user-oriented application delivery. Build, ...
Containers - Portable, repeatable user-oriented application delivery. Build, ...Walid Shaari
 
Hadoop Meetup Jan 2019 - Overview of Ozone
Hadoop Meetup Jan 2019 - Overview of OzoneHadoop Meetup Jan 2019 - Overview of Ozone
Hadoop Meetup Jan 2019 - Overview of OzoneErik Krogen
 
Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019James Bromberger
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Ron Munitz
 
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono..."The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...Edge AI and Vision Alliance
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Ron Munitz
 
Logs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to GrokLogs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to GrokPhil Hagen
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTJoshua Thijssen
 
How to debug machine learning call stacks
How to debug machine learning call stacksHow to debug machine learning call stacks
How to debug machine learning call stacksRogue Wave Software
 
Docker app armor_usecase
Docker app armor_usecaseDocker app armor_usecase
Docker app armor_usecaseKazuki Omo
 
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024Clark Everetts
 
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]Websec México, S.C.
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package managerTimur Safin
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko3D
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBScyllaDB
 
Pacemaker+DRBD
Pacemaker+DRBDPacemaker+DRBD
Pacemaker+DRBDDan Frincu
 

Similaire à Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages (20)

Rust
RustRust
Rust
 
Gluster Cloud Night in Tokyo 2013 -- Tips for getting started
Gluster Cloud Night in Tokyo 2013 -- Tips for getting startedGluster Cloud Night in Tokyo 2013 -- Tips for getting started
Gluster Cloud Night in Tokyo 2013 -- Tips for getting started
 
Introduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptxIntroduction to Rust (Presentation).pptx
Introduction to Rust (Presentation).pptx
 
Snyk Intro - Developer Security Essentials 2022
Snyk Intro - Developer Security Essentials 2022Snyk Intro - Developer Security Essentials 2022
Snyk Intro - Developer Security Essentials 2022
 
Containers - Portable, repeatable user-oriented application delivery. Build, ...
Containers - Portable, repeatable user-oriented application delivery. Build, ...Containers - Portable, repeatable user-oriented application delivery. Build, ...
Containers - Portable, repeatable user-oriented application delivery. Build, ...
 
Hadoop Meetup Jan 2019 - Overview of Ozone
Hadoop Meetup Jan 2019 - Overview of OzoneHadoop Meetup Jan 2019 - Overview of Ozone
Hadoop Meetup Jan 2019 - Overview of Ozone
 
Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019Linux confau 2019: Web Security 2019
Linux confau 2019: Web Security 2019
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
 
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono..."The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
"The Vision API Maze: Options and Trade-offs," a Presentation from the Khrono...
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
 
Logs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to GrokLogs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to Grok
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APT
 
How to debug machine learning call stacks
How to debug machine learning call stacksHow to debug machine learning call stacks
How to debug machine learning call stacks
 
Docker app armor_usecase
Docker app armor_usecaseDocker app armor_usecase
Docker app armor_usecase
 
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
 
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]
Echidna, sistema de respuesta a incidentes open source [GuadalajaraCON 2013]
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
 
Pacemaker+DRBD
Pacemaker+DRBDPacemaker+DRBD
Pacemaker+DRBD
 

Plus de Aaron Zauner

[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...Aaron Zauner
 
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...Aaron Zauner
 
State of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeState of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeAaron Zauner
 
Javascript Object Signing & Encryption
Javascript Object Signing & EncryptionJavascript Object Signing & Encryption
Javascript Object Signing & EncryptionAaron Zauner
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Aaron Zauner
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Aaron Zauner
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014Aaron Zauner
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 Aaron Zauner
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
BetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningBetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningAaron Zauner
 
How to save the environment
How to save the environmentHow to save the environment
How to save the environmentAaron Zauner
 
Sc12 workshop-writeup
Sc12 workshop-writeupSc12 workshop-writeup
Sc12 workshop-writeupAaron Zauner
 

Plus de Aaron Zauner (13)

[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
[BlackHat USA 2016] Nonce-Disrespecting Adversaries: Practical Forgery Attack...
 
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
No need for Black Chambers: Testing TLS in the E-Mail Ecosystem at Large (hac...
 
State of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at LargeState of Transport Security in the E-Mail Ecosystem at Large
State of Transport Security in the E-Mail Ecosystem at Large
 
Javascript Object Signing & Encryption
Javascript Object Signing & EncryptionJavascript Object Signing & Encryption
Javascript Object Signing & Encryption
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
[IETF Part] BetterCrypto Workshop @ Hack.lu 2014
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
BetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto HardeningBetterCrypto: Applied Crypto Hardening
BetterCrypto: Applied Crypto Hardening
 
How to save the environment
How to save the environmentHow to save the environment
How to save the environment
 
Sc12 workshop-writeup
Sc12 workshop-writeupSc12 workshop-writeup
Sc12 workshop-writeup
 

Dernier

DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Roomdivyansh0kumar0
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 

Dernier (20)

DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Samaira 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Samaira 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With RoomVIP Kolkata Call Girl Dum Dum 👉 8250192130  Available With Room
VIP Kolkata Call Girl Dum Dum 👉 8250192130 Available With Room
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 

Because "use urandom" isn't everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages

  • 1. Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner azet@azet.org lambda.co.at: Highly-Available, Scalable & Secure Distributed Systems SHA2017 - 06/08/2017
  • 2.
  • 3. Why do we need Random Numbers? randomize stuff in your operating system / language man rand Python: os.urandom TLS session cookies Key generation (e.g. RSA / Diffie-Hellman) TCP SYN cookies Bash: ${RANDOM} :) SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 1/1
  • 4. CSPRNG i “Cryptographically Secure Pseudo Random Number Generator” aka “RNG”, “Random number generator”.. Crypto nerds tend to call them “CSPRNGs” you may call them RNG or whatever, I don’t care that much as long as it’s secure! SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 2/1
  • 5. CSPRNG ii Widely implemented in OS kernels Linux: /dev/urandom 1. manpage man random has been wrong for years 2. many myths about kernel entropy FreeBSD: /dev/*random 1. 2. Replace the RC4 algorithm for generating in-kernel secure random numbers with Chacha20. Keep the API, though, as that is what the other *BSD’s have done. Use the boot-time entropy stash (if present) to bootstrap the in-kernel entropy source. (https://svnweb.freebsd.org/base?view=revision&revision=317015 - Sun Apr 16 09:11:02 2017 UTC) Windows: RtlGenRandom() ..and in programming languages (i.e. Python os.urandom, PHP rand(),..) some had really bad bugs for a long time (i.e. debian predictable SSH keys: CVE-2008-0166) many use the kernel provided CSPRNG, others use OpenSSL or custom RNGs - which is BAD! OpenSSL provides a user-space RNG many link to or make use of (don’t!) Whoops: CVE-2017-11671: GCC generates incorrect code for RDRAND/RDSEED intrinsics (recent)SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 3/1
  • 6. Some History the /dev/random and /dev/urandom devices used to be really old code (mid-90ties) originated from Ted Tso and a few others the manpage for them was wrong until fixed in late last december! you don’t have to worry about kernel entropy - this is a myth! HAVEGE won’t save you! it can make things worse (See: https://blog.cr.yp.to/20140205-entropy.html) SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 4/1
  • 7. Old Linux Kernel implementation 0.x>4.x mixing different pools of interrupts quite complicated to understand even for well versed C programmers it worked without larger incidents - probably pure luck and researchers unable to read char device code old design described well here: Blog Post: https://pthree.org/2014/07/21/the-linux-random-number-generator/ Academic: https://eprint.iacr.org/2012/251.pdf SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 5/1
  • 8. curiosities in (drivers/char/random.c) Splevin ARX fast_mix implemented by George Splevin - never explained and no crypto experience - homebrewed ARX that code is still around - even in the upstream kernel git repo: Code here: https://tinyurl.com/fastmix SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 6/1
  • 9. Current implementation i after long discussions and advice by crytographers the old design in random.c was changed in 4.2 based on the old pools, AES-NI (if available - modern Intel/AMD CPUs have those), ChaCha20 XOR RdSEED (via Google’s BoringSSL / Adam Langley - https://marc.info/?l=linux-crypto-vger&m=146584488030185&w=2) neat design, backtracking resistant, pretty fast, too: azet@nd01 ~ % dd if=/dev/urandom of=/dev/null bs=1M count=1024 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 11.8289 s, 90.8 MB/s SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 7/1
  • 10. Current implementation ii major work overhauling crypto-code in the kernel started with Linux 4.2 Backtracking protection (https://marc.info/?l=linux-crypto-vger&m=146583297126471&w=2) Ted Tso (Jun 13, 2016): With /dev/urandom we were always emitting more bytes than we had entropy available, because not blocking was considered more important. Previously we were relying on the security of SHA-1. With AES CTR-DRBG, you rely on the security with AES. (https://marc.info/?l=linux-crypto-vger&m=146584488030185&w=2) Doesn’t track entropy anymore because the “CRNG” (terminology,..) is faster (https://marc.info/?l=linux-crypto-vger&m=146458684806389&w=2) SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 8/1
  • 11. Current implementation iii random: replace urandom pool with a CRNG (https://marc.info/?l=linux-crypto-vger&m=146217043829396&w=2) Nikos Mavrogiannopoulos (https://marc.info/?l=linux-crypto-vger&m=146229250001030&w=2): I know, and I share this opinion. To their defense they will have to provide a call which doesn‚t make applications fail in the following scenario: 1. crypto/ssl libraries are compiled to use getrandom() because it is available in libc and and in kernel 2. everything works fine 3. the administrator downgrades the kernel to a version without getrandom() because his network card works better with that version 4. Mayhem as applications fail SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 9/1
  • 12. Current implementation iv random: make /dev/urandom scalable for silly userspace programs (https://marc.info/?l=linux-crypto-vger&m=146583311726544&w=2): On a system with a 4 socket (NUMA) system where a large number of application threads were all trying to read from /dev/urandom, this can result in the system spending 80% of its time contending on the global urandom spinlock. The application should have used its own PRNG, but let‚s try to help it from running, lemming-like, straight over the locking cliff. SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 10/1
  • 13. Current implementation v Myths and lies in man 4 random finally corrected: https://bugzilla.kernel.org/show_bug.cgi?id=71211&utm_content=buffer1d02b this took years of convincing the original upstream authors etc. had a huge impact on use of RNGs in programming languages etc. SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 11/1
  • 14. Language issues: Ruby using OpenSSL RNG designed for fast TLS use, not general purpose multiple security engineers and cryptographers tried to convince them to switch to /dev/urandom took more than a year but finally they implemented a similar design to libsodium (I’ve made a T-Shirt!) SecureRandom without OpenSSL (or compatible alternatives) is nonsense. Please don't rude. Legendary bug: https://bugs.ruby-lang.org/issues/9569 Tony Arcieri (@bascule) wrote a wrapper for the time being: https://github.com/cryptosphere/sysrandom SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 12/1
  • 15. Language issues: Node.js similar story to Ruby lots of input from normal users (useless) https://github.com/nodejs/node/issues/5798 (endless thread) Latest comment: ‘Note that OpenSSL has just landed a commit to use DRGB with AES-CTR of NIST SP 800-90A as openssl/openssl@75e2c87. We can use it with the os-specific seeding source (e.g. /dev/urandom) by a default define flag of OPENSSL_RAND_SEED_OS. I think it is best for us to wait for the next release of OpenSSL-1.1.1.“ SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 13/1
  • 16. Language issues: Erlang same as Ruby and Node.js https://github.com/erlang/otp/blob/maint/lib/crypto/c_src/crypto.c SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 14/1
  • 17. Python imrprovement warns if there’re insecure values: https://bugs.python.org/issue27292 SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 15/1
  • 18. OpenSSL Not thread safe - userspace - prone to bugs https://github.com/openssl/openssl/issues/898 https://wiki.openssl.org/index.php/Random_Numbers Not even recommended by OpenSSL to use it as non-TLS CSPRNG SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 16/1
  • 19. ‘ HAVEGE dangerous to use! not maintained in more than 10yrs no current contacts / security audits except by the original authors doesn’t improve security! SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 17/1
  • 20. Parting words ... SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 18/1
  • 21. THANKS FOR YOUR PATIENCE. ARE THERE ANY QUESTIONS? Twitter: @a_z_e_t E-Mail: azet@azet.org XMPP: azet@jabber.ccc.de GitHub: https://github.com/azet GPG Fingerprint: 7CB6 197E 385A 02DC 15D8 E223 E4DB 6492 FDB9 B5D5 SHA2017 - 06/08/2017 Because "use urandom" isn’t everything: a deep dive into CSPRNGs in Operating Systems & Programming Languages Aaron Zauner 19/1