tc39 / proposal-csprng

Cryptographically Secure Random Number Generation for ECMAScript
BSD 3-Clause "New" or "Revised" License
70 stars 9 forks source link

Consider defining "cryptographically secure" #9

Open peteroupc opened 4 years ago

peteroupc commented 4 years ago

This proposal should consider defining what "cryptographically secure" means, perhaps in terms of the effort an attacker needs to guess the random numbers produced. In this sense, this proposal could take inspiration from my definition of a "cryptographic" random number generator (RNG):

A cryptographic RNG generates random bits that behave like independent uniform random bits, such that an outside party has no more than negligible advantage in correctly guessing prior or future unseen output bits of that RNG even after knowing how the RNG works and/or extremely many outputs of the RNG, or prior unseen output bits of that RNG after compromising its security, such as reading its internal state.

As far as I know, the Linux RNG as well as RNGs that comply with NIST SP800-90A (such as BCryptGenRandom in recent versions of Windows), among many others, meet this definition. Thus, this definition should not add much of a burden for implementations where these RNGs are available.