Skip to content

encryptogroup/CryptoSPN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoSPN

Implementation of "CryptoSPN: Privacy-preserving Sum-Product Network Inference" (Accepted at ECAI'20 - pre-print available here)

by Amos Treiber (ENCRYPTO, 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).


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

  1. Install SPFlow and download and build ABY.
  2. Enter the paths to your CryptoSPN and ABY instances in CryptoSPN/Constants.py
  3. In your CryptoSPN directory, add executable permission to the compile script: chmod +x CryptoSPN/compiling/compile.sh

Usage

  1. Call spn_to_aby_file(spn) on a SPFlow spn to create an ABY .cpp file. CryptoSPN also provides an interface to automatically compile your SPN into an ABY executable by calling spn_to_aby_exec. You can specify filenames, precision, and whether to obliviously select client RVs via an oblivious selection network.
  2. 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]
  1. See example.py for more details.

Restrictions

  1. Supported leave types as of now are: Bernoulli, Histogram, Gaussian, Poisson. Note that for Histogram the domain size is leaked.
  2. 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published