This repository contains the proof-of-concept implementation, benchmark data, and analysis code accompanying the paper:
I-(OT)²: A Client-optimal OT Protocol for IoT Devices
Elia Onofri, Andrea Ciccotelli, Roberto Di Pietro.Cybersecurity Research and Innovation Laboratory (CRI-Lab)
Computer, Electrical and Mathematical Sciences and Engineering (CEMSE) Division
King Abdullah University of Science and Technology (KAUST)
I-(OT)² is a base 1-out-of-2 Oblivious Transfer (OT) protocol grounded in the Quadratic Residuosity problem, designed to minimise receiver-side computation and interaction. Through a lightweight offline pre-computation phase, it shifts the on-transfer computational burden almost entirely onto the Sender, reducing the online exchange to six messages and four digests. This makes it particularly suited to client–server settings where the receiver runs on low-power hardware, such as IoT devices.
For 128-bit security with a 3072-bit RSA modulus, the receiver online cost per OT is as low as ~2.80 µs on a desktop platform and ~39.90 µs on a Raspberry Pi Zero 2W.
- Repository Layout
- Building the proof of concept
- Networked Python implementation
- Reproducing the analysis
- System used in the paper
- Citation
- License
.
├── IOT2_PoC/ # C proof-of-concept implementation
│ ├── iot2_poc.c # Main source (single-process benchmark)
│ └── Makefile # Portable build (release / debug targets)
├── analysis/ # Reproduce the figures and tables in the paper
│ ├── displayStatistics.py # Summary statistics for one performance file
│ ├── Plots_analysis.ipynb # Receiver-performance and SimplestOT comparison plots
│ ├── Plots_probDistr.ipynb # Probability-distribution / security-analysis figures
│ └── requirements.txt # Python dependencies for the notebooks
├── python/ # Networked (client/server) Python implementation
│ ├── src/iot2/ # Package: protocol primitives, server, sync/async clients
│ ├── runners/ # run_server.py, run_client.py, run_profiling.py
│ └── README.md # Python-specific build and usage instructions
├── performances/ # Benchmark results
│ ├── linux/ # Desktop platform (Intel Core i9-13900H)
│ │ ├── cycles_<ks>.csv # CPU cycles, I-(OT)² with RSA modulus size <ks> bits
│ │ ├── cycles_sOT.csv # CPU cycles, SimplestOT
│ │ ├── timings_<ks>.csv # Wall-clock timings [ns], I-(OT)²
│ │ └── timings_sOT.csv # Wall-clock timings [ns], SimplestOT
│ └── raspberry/ # IoT platform (Raspberry Pi Zero 2W) — same layout
├── SimplestOT_porting/ # Our C language porting (with online-offline separation) of SimplestOT
├── pyproject.toml # Project metadata (Python implementation, forthcoming)
├── LICENSE # CC BY-NC-SA 4.0
└── README.md # This file
Note. Two implementations of I-(OT)² are provided: the single-process C benchmark under
IOT2_PoC/and a networked client/server Python implementation underpython/.
The C porting of SimplestOT used for the comparison benchmarks is included as well inSimplestOT_porting/.
- A C compiler (tested with GCC 15.1.1)
- OpenSSL
libcryptodevelopment files (BIGNUM, RSA, EVP/SHA, SHAKE-256)- Debian/Ubuntu:
sudo apt install libssl-dev - Fedora:
sudo dnf install openssl-devel - macOS (Homebrew):
brew install openssl
- Debian/Ubuntu:
The build resolves OpenSSL through pkg-config when available, and otherwise falls back to common install locations (including Homebrew on macOS).
cd IOT2_PoC
make # optimised benchmark build (-O3 -march=native)
make debug # debug/test build (-O0 -g -DDEBUG, single iteration)
make clean # remove the binary and generated CSV files./iot2_pocThe benchmark binary runs the protocol over many iterations and writes cycles.csv and timings.csv in the working directory.
The debug build (-DDEBUG) runs a single iteration with verbose output for correctness checking.
A client/server implementation over Socket.IO lives under python/.
Install it (from the repository root) and launch a server and a client:
pip install -e .
python python/runners/run_server.py -p 5555 # in one shell
python python/runners/run_client.py -p 5555 -l 1024 -x 100 -y 200 -b 1See python/README.md for the package layout, the profiling runner, and the synchronous/asynchronous client options.
cd analysis
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # or `pip install -e ".[analysis]"` from root
jupyter lab-
Plots_analysis.ipynbreads the CSV files underperformances/and produces the receiver-performance figure (performance_receiver.pdf) and the SimplestOT comparison figure (comparison_sOT.pdf), together with the corresponding summary table. -
Plots_probDistr.ipynbproduces the probability-distribution and security-analysis figures (PDF-Sl.png,ERR-Sl.png,bayesian.png). -
displayStatistics.pyprints mean / standard deviation / 5th and 95th percentiles (in microseconds) for a single performance file:python displayStatistics.py ../performances/raspberry/timings_3072.csv
| Role | Platform |
|---|---|
| Desktop | Intel Core i9-13900H (~3 GHz), 32 GB RAM, 2 TB SSD |
| IoT | Raspberry Pi Zero 2W |
Performance is reported both in CPU cycles and in wall-clock timings.
If you use this code or data, please cite the paper.
BibTeX
@misc{onofri2026iot2,
title = {{I-(OT)\textsuperscript{2}}: A Client-optimal OT Protocol for IoT Devices},
author = {Onofri, Elia and Ciccotelli, Andrea and Di Pietro, Roberto},
year = {2026},
eprint = {2606.02344},
archivePrefix = {arXiv},
primaryClass = {cs.CR},
url = {https://arxiv.org/abs/2606.02344}
}Plain text
E. Onofri, A. Ciccotelli, and R. Di Pietro. I-(OT)²: A Client-optimal OT Protocol for IoT Devices. arXiv:2606.02344, 2026.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
You are free to share and adapt the material for non-commercial purposes, provided appropriate credit is given and any derivatives are distributed under the same license.
For bug reports, questions about the datasets, or collaboration enquiries, please contact:
Elia Onofri — elia[dot]onofri[at]kaust[dot]edu[dot]sa
Cybersecurity Research and Innovation Laboratory (CRI-Lab)
King Abdullah University of Science and Technology (KAUST), Saudi Arabia