How random crypto # randomBytes?

How random is it crypto.randomBytes(20).toString('hex')?

Simple, all I need to know.

+4
source share
1 answer

How random is it crypto.randomBytes()? Usually arbitrary enough for any purpose you need .


crypto.randomBytes() Generates cryptographically secure random data:

crypto.randomBytes (size [, callback])

Generates cryptographically strong pseudo-random data . The size argument is a number indicating the number of bytes to create.

, . , OpenSSL RAND_bytes(). :

RAND_bytes . , . , ( ).

, - . , (/dev/urandom Unix- , CryptGenRandom Windows). , .

, :

. , STS ( ), NIST RANDOM NUMBER GENERATION. , :

  • (Monobit): , 0s 1s ,
  • Runs: ,
  • : ,

, . , , , , , .

+7

Source: https://habr.com/ru/post/1673246/


All Articles