| Step1: Communication over the quantum channel |
| King: Generate multi-stream of bits a, b, and c, and each bitstream length of n |
| FOR every bit from a multi-bit source S |
| select randomly from (a,b,c) resulting base S {a[i], b[i], c[i]} |
| END FOR |
| FOR every bit from a multi-bit source S |
| Produce a photon |
| IF S[aibici] = 000 and base[i] = RL1 polarize the photon state is either 0° or 180° |
| IF S[aibici] = 001 and base[i] = RL2 polarize the photon state is either 30° or 210° |
| IF S[aibici] = 010 and base[i] = SRL1 polarize the photon state is either 45° or 225° |
| IF S[aibici] = 011 and base[i] = SRL2 polarize the photon state is either 60° or 240° |
| IF S[aibici] = 100 and base[i] = LOG1 polarize the photon state is either 90° or 270° |
| IF S[aibici] = 101 and base[i] = SLOG1 polarize the photon state is either 120° or 300° |
| IF S[aibici] = 110 and base[i] = ROG2 polarize the photon state is either 135° or 315° |
| IF S[aibici] = 111 and base[i] = SROG2 polarize the photon state is either 150° or 330° |
| transmit raw bit stream raw[aibici] to Sing |
| END FOR |
| Sing: |
| FOR every raw bit stream raw[aibici] obtained |
| generate RANDOM (raw[aibici]) results base1[i] |
| measure raw bit stream raw1[aibici] with corresponding base1[i] |
| finally obtained bit stream is result 1[i] |
| END FOR |
| Step 2: Communication over the classical channel |
| 2.1: Transmission |
| FOR every bit stream of result 1[i] |
| transmit base 1[i] to King |
| END FOR |
| 2.2: Key generation from raw bit stream |
| King: |
| FOR each bit result 1[i] |
| IF base[i] != base1[i] |
| discard bit result[i] from string S |
| END IF |
| END FOR |
| Sing: |
| FOR each bit result 1[i] |
| IF base 1[i] != base[i] |
| discard bit result 1[i] from string S |
| END IF |
| END FOR |
| Step 3: Fault-tolerant valuation to predict the level of security |
| King and Sing: |
| FOR a group of bits selected randomly from the bit stream S |
| IF result 1[i] = result[i] and base[i] = base 1[i] |
| No or less error rate and snooping |
| discard result1[i] and result[i] |
| END IF |
| ELSE |
| Major error rate and snooping |
| discard the entire bit stream and retransmit |
| END ELSE |
| END FOR |
| Step 4: Final key production |
| Finally filtered bits from the bit streams result 1[i] and result[i] after successful execution of IF block of Fault-tolerant valuation is our resultant key. |