Quantum key distribution
Quantum cryptography is a recent field of study that involves, so far, generating one-time pads and sending messages as photons of various polarizations. Alice and Bob have devices that can generate pulses of light in any of four different polarizations (pick any two of orthogonal, diagonal, and circular, each of which has two kinds) and devices that detect the polarization of light (the basis (orthogonal, diagonal, circular) must be specified, and if you specify the wrong one you get a random bit). The procedure for generating a pad is as follows:
- Alice generates two random bits B1 and B2 and sends a pulse of light. B1 selects the basis and B2 the polarization within that basis.
- Bob generates a random bit B3 and sets his polarization detector to that basis. He reads bit B4.
- Bob and Alice tell each other B3 and B1. If they agree, they add B2 and B4 to their pads, knowing that they are the same unless Eve is listening (Eve doesn't know B1, so she might mess up the bit).
To send a message, Alice and Bob do this:
- Alice takes a message bit and two pad bits. She uses one pad bit to set the basis, xors the other with the message, and uses it to select the polarization. She sends a light pulse.
- Bob takes the two pad bits, sets the basis according to the first, receives the light pulse, and xors it with the second to get the data bit.
The number of photons in each pulse should be slightly larger than the logarithm of the number of bits in a message. Fewer, and a pulse may be absent; more, and Eve can easier detect the polarization of a pulse without altering it.