Blum-Micali is a cryptographically secure pseudo-random bit generator based on the difficulty of computing discrete logarithms. It generates random bits by iteratively computing g^x mod p where g is a primitive root and p is a large prime, extracting one bit per iteration based on whether the result is in the lower or upper half of the range.
| Property | Value |
|---|---|
| Category | Random Number Generators |
| Sub-category | Cryptographic PRNG |
| Security status | π§ͺ Experimental |
| Complexity | Advanced |
| Inventor | Manuel Blum, Silvio Micali |
| Year | 1984 |
| Origin | πΊπΈ United States |
| Source | algorithms/random/blum-micali.js |
| Parameter | Supported values |
|---|---|
| Seed sizes | 1 byte (8 bits) to 128 bytes (1024 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 β Small parameters: p=23, g=5 (primitive root), seed=3
| Field | Value |
|---|---|
p |
23 |
g |
5 |
seed |
03 |
outputSize |
2 |
input |
null |
expected |
1390 |
Vector 2 β Medium parameters: p=47, g=5, seed=7
| Field | Value |
|---|---|
p |
47 |
g |
5 |
seed |
07 |
outputSize |
4 |
input |
null |
expected |
38e38e38 |
Vector 3 β Default C# parameters: p=6364136223846793005, g=2147483647, seed=42
| Field | Value |
|---|---|
p |
6364136223846793005 |
g |
2147483647 |
seed |
2a |
outputSize |
8 |
input |
null |
expected |
a72d9f96f3d03622 |