<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="http://benmedicke.com/feed.xml" rel="self" type="application/atom+xml" /><link href="http://benmedicke.com/" rel="alternate" type="text/html" /><updated>2025-11-22T13:55:51+00:00</updated><id>http://benmedicke.com/feed.xml</id><title type="html">Benjamin Medicke</title><subtitle>porfolio of Benjamin Medicke, collection of projects</subtitle><author><name>Ben   🚀</name></author><entry><title type="html">quantum cryptography</title><link href="http://benmedicke.com/project/quantum-cryptography/" rel="alternate" type="text/html" title="quantum cryptography" /><published>2021-05-11T00:00:00+00:00</published><updated>2021-05-11T13:01:00+00:00</updated><id>http://benmedicke.com/project/quantum-cryptography</id><content type="html" xml:base="http://benmedicke.com/project/quantum-cryptography/"><![CDATA[<p>The goal of this project is to demonstrate quantum-cryptography-based one-time pad communication via
the BB84 protocol using a non-single photon source.</p>

<p>Check out the <a href="https://github.com/bmedicke/quantum_cryptography">git repository</a> for more details, code, printable 3D models, and instructions.</p>

<figure class=" ">
  
    
      <a href="/assets/images/IMG_0571.jpg" title="ThorLabs filter wheel">
          <img src="/assets/images/IMG_0571.jpg" alt="ThorLabs filter wheel" />
      </a>
    
  
  
</figure>

<h2 id="key-distribution">key distribution</h2>

<p>The basic order of events for the BB84 protocol are the following two steps:</p>

<ol>
  <li>generate a one time pad between Alice and Bob</li>
  <li>check if anybody was eavesdropping</li>
</ol>

<hr />

<p>After sharing the key a test is performed: if anybody was listening the key is discarded,
if not they now have a new key to communicate with.  The reason why this works is because <strong>any measurement on a quantum object leaves a trace</strong>.
It is impossible to read information traveling over a quantum channel without perturbing it.</p>

<h3 id="bb84-protocol">BB84 protocol</h3>

<p>The BB84 scheme can use any quantum object with a two value observable.
In practice the quantum object is the <strong>polarization of a photon</strong> (quantum optics).</p>

<h4 id="prerequisites-alice">prerequisites Alice</h4>

<p>Alice has a source to generate photons with four possible polarizations:</p>

<ol>
  <li><strong>H</strong>, horizontal</li>
  <li><strong>V</strong>, vertical</li>
  <li><strong>L</strong>, left</li>
  <li><strong>R</strong>, right</li>
</ol>

<p>The four polarizations can be grouped into two sets.
The <strong>HV set</strong> is located along the X and Y axis. The <strong>LR set</strong> 45 degrees rotated from that.</p>

<h4 id="prerequisites-bob">prerequisites Bob</h4>

<p>Bob has two polarization beam splitters with which he analyzes photons sent by Alice. One oriented at 0 degrees (vertical) and one at 45 degrees (diagonal).
The <strong>vertical beam splitter</strong> can analyze photons of the HV set. The <strong>diagonal beam splitter</strong> can analyze photons of the LR set.</p>

<p>Each beam splitter can produce two values.</p>
<ul>
  <li>Vertical beam splitter:
    <ol>
      <li><strong>H</strong>, horizontal</li>
      <li><strong>V</strong>, vertical</li>
    </ol>
  </li>
  <li>Diagonal beam splitter:
    <ol>
      <li><strong>L</strong>, left</li>
      <li><strong>R</strong>, right</li>
    </ol>
  </li>
</ul>

<p>To obtain the original value of a photon (without fail) the orientations of Alice and Bob have to match up. Some examples:</p>

<ul>
  <li>inputting H into the vertical beam splitter will always return H (match)</li>
  <li>inputting V into the vertical beam splitter will always return V (match)</li>
  <li><strong>inputting L or R into the vertical beam splitter will return a random value (H or V, mismatch)</strong></li>
</ul>

<h4 id="procedure-of-events">procedure of events</h4>

<p>For each (potential) bit of the key the following happens:</p>

<ul>
  <li>Alice generates a randomly polarized photon (H, V, L or R) and publicly sends it to Bob</li>
  <li>Bob choses a random beam splitter to analyze the photon with
    <ul>
      <li>if Bob chose the correct beam splitter: he obtains the original value</li>
      <li>if Bob chose the wrong beam splitter: he obtains a random value</li>
    </ul>
  </li>
  <li>Bob saves the orientation of the beam splitter and the resulting value
    <ul>
      <li>of which he still does not know if it’s meaningful</li>
      <li>there’s a 50% chance it’s just a random value due to orientation mismatch</li>
    </ul>
  </li>
</ul>

<p>After sending a bunch of photons we move on to the next step: <strong>reconciliation</strong>.</p>

<ul>
  <li>Bob publicly announces all his chosen beam splitter orientations</li>
  <li>Alice publicly replies which were correct</li>
  <li>They both drop all the values where Bob chose wrong</li>
  <li>They now hold the key (which consists of all values where Bob chose correctly)</li>
</ul>

<h4 id="consequences-of-eavesdropping">consequences of eavesdropping</h4>

<p>If Eve intercepts a photon to measure it, Bob will not receive it and thus will not use it in the key.
Alternatively, Eve can retransmit a photon, but <strong>Bob can detect this by sacrifing some
Bits of the key and publicly sending them back to Alice!</strong></p>

<p><em>This is where the quantum nature of the transmission medium kicks in:</em></p>

<ul>
  <li>Eve does not know the correct orientation (vertical or diagonal) and thus has to guess
    <ul>
      <li>if Eve guesses correctly she has no problem
        <ul>
          <li>the orientations match up and Bob will get the correct value</li>
        </ul>
      </li>
      <li>if Eve guesses wrong there is a 50% chance that Bob will receive the wrong value
        <ul>
          <li>if Bob randomly chooses this Bit to sacrifice (and send it back to Alice) she has a problem indeed</li>
        </ul>
      </li>
    </ul>
  </li>
  <li><strong>Alice sees that Bob sent back a wrong value despite the correct orientation! The key cannot be trusted!</strong>
    <ul>
      <li>any one Bit being wrong when eavesdropped will happen in about 25% of the cases
        <ul>
          <li>50% chance that Eve chooses the wrong orientation set and 50% chance of that for a wrong value</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>]]></content><author><name>Ben   🚀</name></author><category term="project" /><category term="Python" /><category term="JupyterLab" /><category term="hardware" /><category term="Docker" /><category term="MQTT" /><category term="cryptography" /><category term="data science" /><category term="security" /><category term="quantum optics" /><summary type="html"><![CDATA[The goal of this project is to demonstrate quantum-cryptography-based one-time pad communication via the BB84 protocol using a non-single photon source.]]></summary></entry></feed>