CryptoSPN
ECAI'20 - pre-print available here)
Implementation of "CryptoSPN: Privacy-preserving Sum-Product Network Inference" (Accepted atENCRYPTO, TU Darmstadt), Alejandro Molina (AI & ML Lab, TU Darmstadt), Christian Weinert (ENCRYPTO, TU Darmstadt), Thomas Schneider (ENCRYPTO, TU Darmstadt), and Kristian Kersting (AI & ML Lab, TU Darmstadt).
by Amos Treiber (In this repository, we provide the code for CryptoSPN, an extension of SPFlow to allow for privacy-preserving SPN inference.
About
This code provides an interface between SPFlow and the ABY secure computation framework. Details can be found in our paper. Essentially, it works like SPFlow's C++ functionality, but with an automatic compilation of the exported ABY C++ files into private executables. This is an experimental research prototype to evaluate benchmarks and not intended for real-world deployment. We make no guarantees about its security and correctness.
Requirements
This code requires all SPFlow and ABY requirements.
Installation
- Install SPFlow and download and build ABY.
- Enter the paths to your CryptoSPN and ABY instances in
CryptoSPN/Constants.py
- In your CryptoSPN directory, add executable permission to the compile script:
chmod +x CryptoSPN/compiling/compile.sh
Usage
- Call
spn_to_aby_file(spn)
on a SPFlowspn
to create an ABY.cpp
file. CryptoSPN also provides an interface to automatically compile your SPN into an ABY executable by callingspn_to_aby_exec
. You can specify filenames, precision, and whether to obliviously select client RVs via an oblivious selection network. - The created executable can be called like, e.g.,
./example -r 0 -a 127.0.0.1 -b 64 -i 50 -f "all_data.txt"
. The following parameters can be set:
-r [Role: 0/1, required]
-n [Number of parallel operation elements, optional]
-b [Bit-length, default 32, optional]
-s [Symmetric Security Bits, default: 128, optional]
-a [IP-address, default: localhost, optional]
-p [Port, default: 7766, optional]
-t [Single test (leave out for all operations), default: off, optional]
-y [Type of Sharing used, 0: S_BOOL, 1: S_YAO, default: 1, optional]
-i [Number of iterations for evaluation, default: 1, optional]
-f [Input file of user RVs, default: all_data.txt, optional]
- See
example.py
for more details.
Restrictions
- Supported leave types as of now are:
Bernoulli, Histogram, Gaussian, Poisson
. Note that for Histogram the domain size is leaked. - Utility is currently restricted to one bottom-up pass of the network.
Acknowledgements
This code includes the oblivious selection network ABY implementation of https://github.com/encryptogroup/PDTE by Masoud Naderpour.