Quantcast
Channel: Magnus K Karlsson
Viewing all articles
Browse latest Browse all 526

RNG/DRBG/PRNG Cheat Sheet

$
0
0
  • RNG (Random Number Generator) produces random bits
    • non-deterministic
    • uses external analog source
  • DRBG (Deterministic Random Bit Generator) produces pseudorandom bits
    • deterministic
    • from a seed (taken from RNG)
  • PRNG (Pseudo-Random Number Generator) produces pseudorandom bits
    • non-deterministic
    • from a seeds from an RNG to maintain entropy pool
    • produces output bits using a DRBG

Analog Source + seed --> RNG --> 010..10 --> PRNG (DRBG is a component of PRNG) --> 0101011100..01

Deterministic Random Bit Generator, DRBGINPUT: short fixed-length seed (e.g. 256 bit)OUTPUT: arbitrarily long

Bad, do not useGood, do use
rand(3)/dev/urandom
random(3)Linux getrandom()
PHP rand()Java SecureRandom
your own algorithmNode.js crypto.randomBytes
&nbrp;WINAPI BCryptGenRandom
&nbrp;openssl rand

Viewing all articles
Browse latest Browse all 526

Trending Articles