1 of 4

Your RightSignal

Cryptography from zero · 4 of 111 / 3

Diffie–Hellman key exchange

The concept

Why mixing paint is a one-way street

Some actions are easy to do but hard to undo. Mixing yellow and blue paint takes seconds, but given the green result, you can't work out exactly how much of each color went in.

This trick, called a key exchange, uses a math version of that idea. Both people start with the same public color, each stirs in their own private secret color, and they swap the mixed results in full view of anyone listening.

Each person stirs their own secret into the mix they got back. The maths works out so both land on the exact same final color, a shared secret only they know, even though every step happened in public.