# BB84 Quantum key distribution A method for key distribution between two quantum clients with quantum connection. It utilize [[The no-cloning Theory]] to verify that eavesdropper did not "see" the key during transmission. Alice prepare a list of random bits and a list of random string of basis Z and X. She sends Bob qubits according to this table: | Bit | Basis | State sent | | --- | ----- | ------------------------------ | | 0 | Z | $\ket 0$ | | 1 | Z | $\ket1$ | | 0 | X | $\frac{\ket0+\ket1}{\sqrt{2}}$ | | 1 | X | $\frac{\ket0-\ket1}{\sqrt{2}}$ | note: X and Z are not gate but a name of a basis. measuring in Z-basis is the same as measuring in the computational basis. measuring in X-basis is the same as applying Hadamard gate and measure. Bob prepare a random string of labels Z and X (independent of Alice string) and measure the qubits Alice sent him according to the basis in his string. The results are as in the table below: | Alice bit | Alice basis | State received | Bob basis | Bob bit | | --------- | ----------- | -------------------------------------------------------------- | --------- | ------- | | 0 | Z | $\ket 0$ | Z | 0 | | 1 | Z | $\ket1$ | Z | 1 | | 0,1 | Z | $\ket0,\ket1$ | X | random | | 0 | X | $\frac{\ket0+\ket1}{\sqrt{2}}$ | X | 0 | | 1 | X | $\frac{\ket0-\ket1}{\sqrt{2}}$ | X | 1 | | 0,1 | X | $\frac{\ket0+\ket1}{\sqrt{2}}$, $\frac{\ket0-\ket1}{\sqrt{2}}$ | Z | random | note: the principle idea here is that Alice produce qubits so measuring later will be the same as her bits. Alice guess how Bob will measure and produce qubits accordingly. Bob and Alice share their basis string and keep the bits where basis agree. note: the list of basis string can be public after Bob measure. Bob and Alice share a small partial of their agreed bits and check if they are identical in order to verify there were no eavesdropper during transmission that tampered with the qubits. Eve can intercept the qubits, measure with either basis Z or X (she will be correct 0.5 of the times) . Her measurement might changed the qubit. If she send it to Bob there is 50% chance that she changed the qubit. If she did then Bob has 50% to measure it wrong so there is a total of 25% to get a bit wrong. Eve can't measure and send a copy of the original qubit due to the [[The no-cloning Theory]]. She can't clone qubits during transmission and store them for later decryption according to the matching basis in the strings of Bob and Alice. ## Created 2025-12-15 14:13