~/talk

How random is Random? Pitfalls of Random in .NET 6

Talkat DotNext 2021 Moscow · 2021-10-21..10-22· [dotnet, security]
links:none on file
slides:none on file

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

  1. 0:00Introduction and welcome
  2. 2:22History of System.Random
  3. 5:05Pitfalls of System.Random
  4. 15:08Analyzing random algorithms
  5. 18:21Randomness in .NET 6
  6. 21:19How Xoshiro works
  7. 24:41Cryptographic requirements
  8. 29:00Why predictability is risky
  9. 33:20Building a better provider
  10. 37:41Performance benchmarks
  11. 43:02Summary and conclusions
  12. 47:25Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.