How to use
Home Click the 'Home' button to go to the home screen.
Settings: Click the 'Settings' button to edit traits of the simulation.
Research: Click the 'Research' button to open Dr. Younghoun Chae's paper.
Start / Stop: Click the 'Start / Stop' to start or stop the simulation at will.
Info Slides: Click the 'Info Slides' button for an animated explanation of the protocol.
Prev: Click the 'Prev' button during the animated explanation of the protocol to go to previous slide or during the simulation to go to previous photon.
Next: Click the 'Next' button during the animated explanation of the protocol to go to next slide or during the simulatino to go to next photon.
What is a Quantum Key Distribution?
BB84 is a Quantum Key Distribution, or QKD.
The purpose of QKDs is to allow people to share keys with each other in confidence.
These keys are used in classical encryption algorithms (e.g. RSA).
Users of BB84 can be certain that the keys they generate and encrypt data with are not known by
anybody other than the sender and receiver.
How BB84 works
BB84 is a Quantum Key Distribution (QKD) Protocol.
It was created in 1984 by Charles Bennet and Gilles Brassard.
The purpose of BB84 is to create secure one time pads or keys to use with classical encryption algorithms.
There are three individuals involved in this protocol.
Alice - Sender
Bob - Receiver
Eve - Eavesdropper
Each "qubit" has three values: bit, basis, polarization.
Basis determines what polarizations one can measure and send.
+ basis for 0° and 90°
x basis for 45° and 135°
Each basis has two degree measures, one measure for 0 bit value, one measure for 1 bit value.
Bit and polarization are locked, and determine each other.
0° = 1 (+ basis)
45° = 0 (x basis)
90° = 0 (+ basis)
135° = 1 (x basis)
Alice sends Bob a predetermined amount of qubits to build their one time pad with.
If the receiver guesses the correct basis, they can infer the bit even if they guess the incorrect polarization.
This means any receiver, Bob or Eve, has a 50% chance of measuring the qubit correctly.

BB84 relies on the "No-Cloning" theorem.
The No-Cloning Theorem states that Eve cannot measure a qubit in the wrong basis and send a clone of this qubit to Bob.
In practice, this means Eve has a 50% chance of guessing the correct basis.
If Eve guesses correctly, Eve can resend the same qubit to Bob with no issues.
If Eve guesses incorrectly, this is where the No-Cloning Theorem takes effect.
By the No-Cloning Theorem, Eve cannot measure a qubit on the incorrect basis and send an exact copy to Bob.
While Eve knows the correct basis, Eve cannot deduce the polarization.
Therefore Eve is forced to guess the correct polarization and will have 50% of sending Bob the correct qubit.
Bob then has a 50% chance of measuring this new qubit on the correct basis.
This means if Eve intercepts the qubit, Bob has a 25% chance of measuring it correctly.
50% * 50% = 25%
To recap:
If Eve if present, Bob has a 25% chance of measuring each qubit correctly.
If Eve is absent, Bob has a 50% chance of measuring each qubit correctly.
BB84 takes advantage of the probability of correct measurement to ensure secure communication.
Alice and Bob compare the qubits sent to the qubits measured and select congruent bit measurements for the key.
If Eve is absent, as key size increases, the error rate will approach 0%.
If Eve is present, as key size increases, the error rate will approach 50%.
Acceptable error rate is 20%.
They need to account for noise over the medium or other distubances, the theoretical 0% error rate is not always achievable.
When Eve is present, the 20% threshold should be easily attainable, at any reasonable key size.
If the error rate is above this threshold, Alice and Bob will determine there is an eavesdropper (Eve) and will cease communication.
If Alice and Bob determine there is no eavesdropper, they can build and use their keys.
For privacy amplification, it is recommended that Alice and Bob hash their keys.
At this point, the protocol is over. Alice and Bob can now be certain the key they generated is not known by anybody else.
Animation Key
People

Alice
Bob
Eve
Photons

(+, 0°, 1)
(x, 45°, 0)
(x, 90°, 0)
(+, 135°, 1)
Basis

+ basis x basis
Vocabulary
Basis: Alignment of photon. Either + for 0° / 90° or x for 45° / 135°.
Polarization: Degree measure of photon within basis. Determines bit value.
Bit: 1 or 0. Each basis has two polarizations, one for 1 bit value the other for 0 bit value.
Alice: Original sender of qubits. Initiates transmission, and compares sent key with Bob's received key.
Bob: Inteded receiver of qubits. Measures qubits and stores bit values. Compares recieved key with Alice's sent key.
Eve: Eavesdropper, or intercepter of qubits. Measures qubits Alice sends and retransmits qubits to Bob.
OTP / Key: One Time Pad (OTP) and Key are synonyms. These are used as keys in classical encryption algorithms.
No-Cloning Theorem: No-Cloning Theorem states a qubit cannot be observed in the incorrect basis and be resent as an exact copy.
Error Rate: Percent of qubits that Bob measures incorrectly.
Key Size: Amount of photons Alice sends to Bob.
FAQ
How are quantum mechanics used in BB84?
BB84 uses the No-Cloning Theorem. Due to entanglement, Eve cannot observe
a photon on the wrong basis and send a copy of that photon to Bob.
What are qubits and photons?
Qubits and photons are synonyms when it pertains to this QKD.
Qubits, or photons, are the quantumly entangled elements that Alice sends bit values to Bob with.
Can we use this protocol right now?
Technically yes, but there's a catch. Currently quantum computing is extremely expensive and reserved for large companies or research institutions.
Quantum computers require precise conditions to work. They must be cooled to near absolute zero. This is highly impractical for personal computers.
What research did this project use?
This project uses research from Dr. Younghoun Chae, a professor at Kent State Stark.
You can view the research paper here.
What did you use to animate the website?
The animation is done using p5.js. You can find their website here.