BEDBUG is a small, fast, cryptographically secure pseudo-random number generator (CSPRNG) and stream cipher. It exhibits uniform distribution, mixes rapidly (with worst-case avalanche better than 16-bits), has no detected bias, and comes in three variants: BEDBUG128, with an internal state array of 128+3 32-bit words; BEDBUG256, with an internal state of 256+3 words; and BEDBUG512 with a 512+3-word state. The former permit seeding with a key of up to 4096 or 8192 bits, the latter with a 16384-bit key.
The BEDBUG generator itself is a mere 5 lines of code: Three rotations; two pseudo-random lookups.
The default BEDBUG configuration alternates the rotation constants unpredictably. These four sets of three values differ between BEDBUG128, BEDBUG256 and BEDBUG512 and were selected, tuned and tested in each case for optimal avalanche, which is never less than 16.5 bits.
BEDBUG has passed stringent industry-standard tests for randomness, including NIST and DIEHARD.