Hawkynt

Blum Blum Shub

Blum Blum Shub (BBS) is a cryptographically secure pseudo-random number generator based on the difficulty of factoring and the quadratic residuosity problem. It generates random bits by repeatedly squaring a value modulo a Blum integer (product of two primes ≑ 3 mod 4).

Properties

Property Value
Category Random Number Generators
Sub-category Cryptographic PRNG
Security status πŸ§ͺ Experimental
Complexity Advanced
Inventor Lenore Blum, Manuel Blum, Michael Shub
Year 1986
Origin πŸ‡ΊπŸ‡Έ United States
Source algorithms/random/blumblumshub.js

Parameters

Parameter Supported values
Seed sizes 1 byte (8 bits) to 1024 bytes (8192 bits)

Capabilities

Flag Value
IsDeterministic Yes
IsCryptographicallySecure Yes

Security

Status: πŸ§ͺ Experimental

No vulnerabilities are recorded for this implementation.

Documentation

References

Test vectors

3 vectors ship with this algorithm and run in the test suite. Byte values are hexadecimal.

Vector 1 β€” Classic example: p=11, q=23, seed=3 (commonly cited)

Field Value
p 11
q 23
seed 03
outputSize 2
input null
expected 43b8

Vector 2 β€” Smaller example: p=7, q=11, seed=5

Field Value
p 7
q 11
seed 05
outputSize 2
input null
expected 9999

Vector 3 β€” Larger primes: p=499, q=547 (both ≑ 3 mod 4), seed=42

Field Value
p 499
q 547
seed 2a
outputSize 4
input null
expected a280777a

← All algorithms