Quantum Crypto Pipeline

Circuit Builder → BB84 Key Distribution → XOR Encryption

Step 1
Circuit Builder
Waiting
Step 2
BB84 Protocol
Waiting
Step 3
XOR Encryption
Waiting
1
Quantum Circuit Builder

Apply Hadamard (H) gates to put qubits in superposition, then measure to collapse them into random classical bits. Click any gate slot to toggle H on/off. Qubits without H always measure |0⟩; qubits with H measure |0⟩ or |1⟩ with equal probability.

H gates: 0/8 Entropy: 0 bits State: not measured
Random bits feed into BB84 key exchange
2
BB84 Key Distribution

Alice uses the random bits from Step 1 as her raw key material. She randomly selects a basis (rectilinear + or diagonal x) for each bit. Bob independently picks random bases to measure. After transmission, they publicly compare bases -- only bits where both chose the same basis are kept as the shared secret key.

BB84 is provably secure against eavesdropping. Any interception disturbs the quantum state, introducing detectable errors in the key.
Shared key feeds into encryption
3
XOR Cipher Encryption

The quantum-derived shared key encrypts a plaintext message using XOR cipher. Each bit of the message is XORed with the corresponding key bit (repeating the key as needed). The same operation decrypts, proving correctness.

Shared Key (from BB84)
Run steps 1 & 2 first...
Plaintext Message