Two parties can use X25519 to derive a shared secret from their public and private keys without directly sending that secret. It combines elliptic-curve Diffie–Hellman with Curve25519. section 5.3.3
Keep the mechanism and its defensive checks distinct:
- Curve25519 supplies the elliptic curve, base point, and approximately 128-bit security level. section 5.3.3
- X25519 performs the key exchange using Curve25519 and produces the shared result used by the surrounding protocol. section 5.3.3
- Implementations should check for an all-zero shared secret, because a small-subgroup public key can force that outcome. section 5.4
A dangerous public key
An attacker sends a point from Curve25519’s small subgroup as a public key. Without appropriate handling, X25519 can produce an all-zero shared secret; conservative implementations check for that result. 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.
A diagram illustrates how choosing generators from small subgroups can leak bits of a private key through repeated exchanges. section 5.4
