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).
| 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 |
| Parameter | Supported values |
|---|---|
| Seed sizes | 1 byte (8 bits) to 1024 bytes (8192 bits) |
| Flag | Value |
|---|---|
IsDeterministic |
Yes |
IsCryptographicallySecure |
Yes |
Status: π§ͺ Experimental
No vulnerabilities are recorded for this implementation.
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 |