A small subgroup attack targets a Diffie–Hellman key exchange with malicious public keys. Each key comes from a small subgroup, forcing the shared secret into a few predictable values and gradually revealing bits of the victim’s private key. section 5.4
The −1 public key
An attacker sends −1, the generator of a subgroup of size 2. Raising it to the victim’s private key produces 1 when that key is even and −1 when it is odd. Repeating the process can leak the private key incrementally. section 5.4
Reduce the attack surface by choosing groups carefully:
- Use standards that specify safe-prime moduli of the form p = 2q + 1, where q is also prime. section 5.4
- Safe-prime groups have only subgroups of order 2 and q, leaving too few small subgroups for this attack. section 5.4
Figure 5.15 A small subgroup attack impacts DH groups that have many subgroups. By choosing generators of small subgroups as public keys, an attacker can leak bits of someone’s private key little by little.
Visualize how malicious small-subgroup generators turn DH public keys into gradual private-key leakage. section 5.4
