Get the latest tech news

Secure Randomness in Go 1.22


ChaCha8Rand is a new cryptographically secure pseudorandom number generator used in Go 1.22.

Essentially all programming environments provide a mechanism for generating statistical random numbers that traces back through C to Research Unix Third Edition (V3), which added a pair of functions: srand and rand. See S. K. Park and K. W. Miller’s 1988 CACM paper “ Random number generators: good ones are hard to find ” for a short analysis and the first chapter of Knuth Volume 2 for a longer one.) Instead, we hope that eventually all programming languages will move to cryptographically strong pseudorandom generators even for “mathematical” randomness, eliminating this kind of mistake, or at least greatly reducing its blast radius.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Secure Randomness

Secure Randomness