BB84
BB84 is a quantum key distribution scheme developed by Charles Bennett and Gilles Brassard in 1984. It is the first quantum cryptography protocol. The protocol is provably secure, relying on two conditions: (1) the quantum property that information gain is only possible at the expense of disturbing the signal if the two states one is trying to distinguish are not orthogonal (see no-cloning theorem); and (2) the existence of an authenticated public classical channel. It is usually explained as a method of securely communicating a private key from one party to another for use in one-time pad  encryption. Description. In the BB84 scheme, Alice wishes to send a private key to Bob. She begins with two strings of bits, formula_1 and formula_2, each formula_3 bits long. She then encodes these two strings as a tensor product of formula_3 qubits: where formula_6 and formula_7 are the formula_8-th bits of formula_1 and formula_2 respectively. Together, formula_11 give us an index into the following four qubit states: Note that the bit formula_7 is what decides which basis formula_6 is encoded in (either in the computational basis or the Hadamard basis). The qubits are now in states that are not  mutually orthogonal, and thus it is impossible to distinguish all of them with certainty without knowing formula_2. Alice sends formula_19 over a public and authenticated quantum channel formula_20 to Bob. Bob receives a state formula_21, where formula_20 represents both the effects of noise in the channel and eavesdropping by a third party we'll call Eve. After Bob receives the string of qubits, both Bob and Eve have their own states. However, since only Alice knows formula_2, it makes it virtually impossible for either Bob or Eve to distinguish the states of the qubits. Also, after Bob has received the  qubits, we know that Eve cannot be in possession of a copy of the qubits sent to Bob, by the no-cloning theorem, unless she has made measurements. Her measurements, however, risk disturbing a particular qubit with probability ½ if she guesses the wrong basis. Bob proceeds to generate a string of random bits formula_24 of the same length as formula_2 and then measures the qubits he has received from Alice, obtaining a bit string formula_26. At this point, Bob announces publicly that he has received Alice's transmission. Alice then knows she can now safely announce formula_2, i.e. , the bases in which the qubits were prepared. Bob communicates over a public channel with Alice to determine which formula_7 and formula_29 are not equal. Both Alice and Bob now discard the bits in formula_1 and formula_26 where formula_2 and formula_24 do not match. From the remaining formula_34 bits where both Alice and Bob measured in the same basis, Alice randomly chooses formula_35 bits and discloses her choices over the public channel. Both Alice and Bob announce these bits publicly and run a check to see whether more than a certain number of them agree. If this check passes, Alice  and Bob proceed to use information reconciliation and privacy amplification techniques to create some number of shared secret keys. Otherwise, they cancel and start over.