Skip to content

Machine learning methods to evaluate information leakage via radio-frequency electromagnetic emissions from the electronics of a quantum key distribution module.

License

Notifications You must be signed in to change notification settings

XQP-Munich/EmissionSecurityQKD

Repository files navigation

QKD Emission Security Evaluation

DOI

Quantum Key Distribution (QKD) is a method of sharing secret keys between parties. This repository is a supplement to our paper that analyzes the information leakage about the secret key from a QKD module's electronics through radio-frequency electromagnetic emissions.

It contains

  • Python Code (Tensorflow) to train and evaluate a Convolutional Neural Network on recorded EM-Emissions. Results are stored in JSON files.
  • JSON files containing the results of evaluating the neural networks.
  • Jupyter notebooks for analyzing and plotting results, which produce all figures in the paper.
  • Python code to remotely control a Teledyne Lecroy WavePro 604HD Oscilloscope, which we used for our measurements
  • Python code for interfacing with our QKD sender (this is not directly useful and only illustrates the measurement procedure. It can be adapted to other devices)

The results are obtained by applying the machine learning methods in this repository to the raw data hosted on Zenodo:

How the results were produced

Pre-requisites

Hardware

the datasets were collected using the following hardware

  • Magnetic near-field probe: Langer EMV XFR400-1
  • RF Amplifier (Texas Instruments TRF37C73) for the probe
  • UHF Log-periodic antenna: Creative Design Corp. CLP5130-2.
  • Oscilloscope (Teledyne Lecroy WavePro 604HD)
  • Target of evaluation: Our home-built QKD sender electronics (by Michael Auer) Adapt the interfaces to your electronics to repeat the measurements. Our raw measured data is available at Zenodo. The notebooks assume the data is inside a directory named DownloadedData. Download and extract the data into the root directory or create a link.

Software

The datasets were created and analyzed using the following software

  • Python (v3.10) and standard libraries (see requirements.txt)
  • Tensorflow 2 installation with GPU support, if you want to train the neural network. The neural network takes only a few minutes to train (on GPU) so we do not include the trained network weights.
  • The hyperparameter optimization needs an additional library keras_tuner.
  • For interfacing with Oscilloscope, additional Python libraries (pyvisa)

Data evaluation

The measurement procedure and results are explained in the paper (in preparation TODO LINK). The python files contain the neural network, function to load the data from disk and store results. Note that the .npy files are cached versions of the raw data that are faster to load. These are automatically generated by, e.g., the TEMPEST_ATTACK_* notebooks.

To evaluate the data and reproduce result files, use the following Jupyter notebooks:

  • TEMPEST_ATTACK.ipynb trains and evaluates the neural network.
  • TEMPEST_ATTACK_VARY_TRAINING_DATA.ipynb trains and evaluates the neural network with different amounts of training data. This is only applied to the datasets that have 30 measurements.
  • TEMPEST_ATTACK_MOST_CERTAIN_SELECTION.ipynb trains and evaluates the neural network under the assumption that the attacker can pre-select the symbols and restrict to some fraction where the neural network's predictions are most confident. This slightly increases performance and is discussed in the appendix of the paper.
  • get_raw_data_RMS_amplitude.ipynb analyzes the raw amplitude of emissions. It is used to analyze the distance measurements.
  • hyperparameter_optimization.ipynb performs the hyperparameter optimization for both versions of the electronics. This is used on the datasets containing 30 measurements.
  • Comparing_KeyNokey_Measurements.ipynb analyzes the data collected with the log-periodic dipole antenna at a larger distance. It shows that we can detect whether the device is currently sending a key given the spectrum of the emissions.
  • All notebooks called Visualize_*.ipynb input JSON files containing results and produce plots. Some of these notebooks also directly access the raw data to perform low-level analysis. In particular,
    • Visualize_Results_Rotation.ipynb visualizes effect of rotating probe orientation. This is not mentioned in the paper because the result is not very interesting. Apart from the rotation measurements, the orientation of the probe is always kept fixed.
    • Visualize_single_spectrum.ipynb Analyzes the spectra collected using the near-field probe and compare signal to the noisy background of the room where the measurement was performed.
    • Visualize_trace_analysis.ipynb creates a plot of (synchronized) raw measured traces and illustrates the dependence on the symbol sequence. This is useful to get intuition about the data but is not required for the further, quantitative analysis performed using neural networks.

References

paper

@article{PhysRevApplied.20.054040,
  title = {Deep-learning-based radio-frequency side-channel attack on quantum key distribution},
  author = {Baliuka, Adomas and St\"ocker, Markus and Auer, Michael and Freiwang, Peter and Weinfurter, Harald and Knips, Lukas},
  journal = {Phys. Rev. Appl.},
  volume = {20},
  issue = {5},
  pages = {054040},
  numpages = {13},
  year = {2023},
  month = {Nov},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevApplied.20.054040},
  url = {https://link.aps.org/doi/10.1103/PhysRevApplied.20.054040}
}

Datasets

@dataset{baliuka_adomas_2023_7956055,
  author       = {Baliuka, Adomas and
                  Stöcker, Markus and
                  Auer, Michael and
                  Freiwang, Peter and
                  Weinfurter, Harald and
                  Knips, Lukas},
  title        = {{Datasets for Deep Learning Based Radio Frequency 
                   Side-Channel Attack on Quantum Key Distribution}},
  month        = may,
  year         = 2023,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.7956055},
  url          = {https://doi.org/10.5281/zenodo.7956055}
}

About

Machine learning methods to evaluate information leakage via radio-frequency electromagnetic emissions from the electronics of a quantum key distribution module.

Resources

License

Stars

Watchers

Forks

Packages

No packages published