How random is Random? Pitfalls of Random in .NET 6
summary
Legacy System.Random shows concrete failures: copy‑paste bug (21 vs 31), sign‑insensitive seeds, multithread runs collapsing to zeros, and a reproducible outlier at chain length 54. .NET 6 replaces new Random with a fast xoshiro256* variant and adds Random.Shared (thread‑safe) seeded from RNG, but seeded ctor stays the old broken algorithm. A drop‑in crypto‑random* implementation is built with 256‑bit seed, achieves ~3 GB/s single‑thread, ~8 GB/s multi‑thread and ~6× call throughput over old Random+lock.
AI-written summary · about
chapters (12)
- 0:00Introduction and welcome
- 2:22History of System.Random
- 5:05Pitfalls of System.Random
- 15:08Analyzing random algorithms
- 18:21Randomness in .NET 6
- 21:19How Xoshiro works
- 24:41Cryptographic requirements
- 29:00Why predictability is risky
- 33:20Building a better provider
- 37:41Performance benchmarks
- 43:02Summary and conclusions
- 47:25Q&A session
related talks
01h 30mRandom
45mInside the Linux Kernel Random Number Generator
14mlol im so random!
28mRandomness in Python: Controlled Chaos in an Ordered Machine
41mCybersecurity and random number generators
19mRNG and Me: A Peek Behind The Random Number Generator Curtain
52mPredicting Random Numbers in Ethereum Smart Contracts
51mCybersecurity and Random Number Generators
