Git Product home page Git Product logo

jjjsy / securenn-public Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snwagh/securenn-public

0.0 1.0 0.0 4.37 MB

Implementation of protocols in SecureNN.

CMake 2.18% C++ 73.67% C 13.34% Shell 0.13% Cuda 0.89% Fortran 8.94% Python 0.06% JavaScript 0.05% CSS 0.04% Makefile 0.11% Objective-C 0.02% Batchfile 0.21% AGS Script 0.01% Jolie 0.01% Roff 0.01% Smarty 0.35% Assembly 0.01%

securenn-public's Introduction

SecureNN: 3-Party Secure Computation for Neural Network Training

Sameer Wagh, Divya Gupta, and Nishanth Chandran

Secure multi-party computation (SMC/MPC) provides a cryptographically secure framework for computations where the privacy of data is a requirement. MPC protocols enable computations over this shared data while providing strong privacy guarantees โ€“ the parties only learn output of the computation while learning nothing about the individual inputs. Here we develop a framework for efficient 3-party protocols tailored for state-of-the-art neural networks. SecureNN builds on novel modular arithmetic to implement exact non-linear functions while avoiding the use of interconversion protocols as well as general purpose number theoretic libraries.

We develop and implement efficient protocols for the above set of functionalities. This work is published in Privacy Enhancing Technologies Symposium (PETS) 2019. Paper available here.

Table of Contents

Requirements


  • The code should work on any Linux distribution of your choice (It has been developed and tested with Ubuntu 16.04 and 18.04).

  • Required packages for SecureNN:

    Install these packages with your favorite package manager, e.g, sudo apt-get install <package-name>.

SecureNN Source Code


Repository Structure

  • files/ - Shared keys, IP addresses and data files.
  • lib_eigen/ - Eigen library for faster matrix multiplication.
  • mnist/ - Parsing code for converting MNIST data into SecureNN format data.
  • src/ - Source code for SecureNN.
  • utils/ - Dependencies for AES randomness.

Building SecureNN

To build SecureNN, run the following commands:

git clone https://github.com/snwagh/SecureNN.git
cd SecureNN
make

Running SecureNN

SecureNN can be run either as a single party (to verify correctness) or as a 3 (or 4) party protocol. It can be run on a single machine (localhost) or over a network. Finally, the output can be written to the terminal or to a file (from Party P_0). The makefile contains the promts for each. To run SecureNN, run the appropriate command after building (a few examples given below).

make standalone
make abcTerminal
make abcFile

Additional Resources


Neural Networks

SecureNN currently supports three types of layers, fully connected, convolutional (without padding), and convolutional layers (with zero padding). The network can be specified in src/main.cpp. The core protocols from SecureNN are implemented in src/Functionalities.cpp. The code supports both training and testing.

Debugging

A number of debugging friendly functions are implemented in the library. For memory bugs, use valgrind, install using sudo apt-get install valgrind. Then run a single party in debug mode:

* Set makefile flags to -g -O0 (instead of -O3)
* make clean; make
* valgrind --tool=memcheck --leak-check=full --track-origins=yes --dsymutil=yes <executable-file-command>

libmiracl.a is compiled locally, if it throws errors, download the source files from https://github.com/miracl/MIRACL.git and compile miracl.a yourself and copy into this repo.

Matrix multiplication assembly code only works for Intel C/C++ compiler. Use the non-assembly code from src/tools.cpp if needed (might have correctness issues).

Citation

You can cite the paper using the following bibtex entry:

@article{wagh2019securenn,
  title={{S}ecure{NN}: 3-{P}arty {S}ecure {C}omputation for {N}eural {N}etwork {T}raining},
  author={Wagh, Sameer and Gupta, Divya and Chandran, Nishanth},
  journal={Proceedings on Privacy Enhancing Technologies},
  year={2019}
}

Report any bugs to [email protected]

securenn-public's People

Contributors

snwagh avatar zzz130981 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.