The BB84 protocol encodes random classical bits in independently chosen computational and Hadamard bases. Sender and receiver publicly compare bases and retain only positions where their bases agree; disturbance of a test sample detects eavesdropping.
Codex Wiki