https://github.com/alan-turing-institute/sheep

SHEEP is a Homomorphic Encryption Evaluation Platform

https://github.com/alan-turing-institute/sheep

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    4 of 11 committers (36.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

homomorphic-encryption hut23 hut23-172 hut23-205
Last synced: 9 months ago · JSON representation

Repository

SHEEP is a Homomorphic Encryption Evaluation Platform

Basic Info
  • Host: GitHub
  • Owner: alan-turing-institute
  • License: mit
  • Language: C++
  • Default Branch: master
  • Size: 6.92 MB
Statistics
  • Stars: 51
  • Watchers: 11
  • Forks: 12
  • Open Issues: 24
  • Releases: 0
Archived
Topics
homomorphic-encryption hut23 hut23-172 hut23-205
Created over 8 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

README.md

SHEEP is a Homomorphic Encryption Evaluation Platform

Disclaimer

SHEEP is development code. We strongly recommend that you do not deploy this prototype application in a production setting. SHEEP is intended to be an academic research framework to explore the homomorphic encryption (HE) space, and the characteristics of some HE libraries. However, we are not responsible for the content of these external libraries, and we offer no guarantees regarding their use.

Summary

The overall aim of the SHEEP project is to provide a platform for practitioners to evaluate the state-of-the-art of (fully) homomorphic encryption technology in the context of their concrete application. SHEEP enables this evaluation to be done across libraries implementing different HE schemes (with in some cases incomparable security).

Components of the SHEEP platform. These include an interpreter for the SHEEP language, an abstraction layer to incorporate HE libraries via their corresponding wrappers, and a reporting component. The user can either provide a program written in the high-level SHEEP language, or run a set of predefined benchmarks. Different aspects of the results can be visualized through a web interface.

To achieve this goal, the SHEEP platform includes an library agnostic language so that computations can be described generically. One can think of it as an assembly language.

To incorporate a library into the platform, all that needs to be done is write a wrapper for it, implementing the operations in the SHEEP instruction set. These corresponds to common operations in a HE scheme such as encryption, decryption, homomorphic addition, multiplication, comparison, etc.

Besides allowing the user to execute their own programs via either a web interface or programatically, the library incorporates a set of native benchmarks. These are classified in three categories according to their complexity, ranging from low-level microbenchmarks of the basic homomorphic arithmetic operations, to data analysis tasks.

Either on a native benchmark or a user-defined input, the platform evaluates the corresponding program on all the HE libraries that support the instructions of the program. The result is checked for correctness, and metrics such as running time (encryption, decryption, and evaluation) and ciphertext size are reported to a web interface and stored in a database. The web interface also allows convenient plotting of the results for easy visualisation.

The platform hence enables two main use cases: 1. It allows users to evaluate a concrete custom computation across libraries (and thus encryption schemes) by simply describing it in a high-level language. This allows to set up a easily reproducible baseline when trying to optimize a given primitive based on HE, e.g. Private Information Retrieval, secure inner product, etc. For example, addition of two numbers in SHEEP looks like this: INPUTS a b res OUTPUTS res a b ADD res 2. The set of predefined benchmarks allows performance snapshots of the state-of-the-art of (fully) homomorphic encryption implementations to be continually produced, as new schemes are invented and their implementations are updated and optimized.

In summary, the general problem addressed by SHEEP is that of getting a satisfying answer, from the practitioner's point of view, to the following questions:

"What is the current state of the implementations of homomorphic encryption?"

"What homomorphic encryption scheme (and implementation) should I use in my application, given some functional and non-functional, e.g. security, latency or bandwidth constraints?"

In its current state, the SHEEP platform does not provide a complete solution to these problems, as we believe this requires a community effort. This is why SHEEP's code is open source.

Installation - docker (recommended)

Assuming you have docker installed, from this directory, do: docker-compose build This will build three Docker images: one for the "server", one for a web-based frontend, and one for some Jupyter notebooks containing examples of SHEEP usage.

To run the web frontend, do: docker-compose run -p 5000:5000 sheep-frontend If you point your browser to 0.0.0.0:5000 you should get the SHEEP frontend.

To run the notebooks, do: docker-compose run -p 8888:8888 sheep-notebook Now if you paste the URL given in the terminal for "sheep-notebook_1" into your browser, but with localhost instead of the hex string immediately after the "http://", you can access the Jupyter notebook examples.

Installation - local

Clone this repository onto your local machine. There are a few packages which the SHEEP platform itself uses, and then there are the HE libraries that we want to evaluate. Instructions for both follow:

Core SHEEP dependencies

SHEEP uses the cpprestsdk library to provide a RESTful API for the sheep server. On OSX, this can be installed with homebrew: brew install cpprestsdk For Linux (Ubuntu 16.04), see the relevant section of Dockerfile for a working recipe.

For parallel evaluation of circuits, SHEEP uses Intel's tbb library. This can be installed on OSX using homebrew: brew install tbb or for apt-based Linux installations: apt-get -y install libtbb-dev

There are a few Python packages that are needed for the web front-end and/or the Jupyter notebooks. Install these with: pip install flask pip install wtforms pip install pytest pip install sqlalchemy pip install python-nvd3 pip install requests pip install jupyter pip install matplotlib pip install pandas

Example HE libraries

After cloning the SHEEP repo, change to the SHEEP directory then do: git submodule update --init --recursive This will checkout the HElib and TFHE submodules in the lib/ directory.

TFHE

To build TFHE, first install the fftw library (download source from http://www.fftw.org/download.html then follow the instructions on that page)

Then build TFHE as follows: cd lib/tfhe mkdir build cd build cmake ../src -DENABLE_TESTS=on -DENABLE_FFTW=on -DCMAKE_BUILD_TYPE=optim -DENABLE_NAYUKI_PORTABLE=off -DENABLE_SPQLIOS_AVX=off -DENABLE_SPQLIOS_FMA=off -DENABLE_NAYUKI_AVX=off make sudo make install

HElib

HElib depends on the GMP and NTL libraries. To install gmp on OSX do: brew install gmp (this will install into /usr/local/Cellar/gmp - this location is needed when building ntl.) For Linux, gmp can be installed from source - see the relevant section of Dockerfile.

For ntl, download and follow instructions from here. At the ./configure step, add the argument GMP_PREFIX=/usr/local/Cellar/gmp if you installed gmp using homebrew, or the relevant location if you used another method.

Then build HElib as follows: cd ../../HElib/src make mkdir build cd build cmake .. make all

SEAL

Download and follow the instructions here.

libpaillier

Download the tar.gz file from here, unpack the archive, cd to the directory, then do ./configure make make install Note that libpaillier depends on gmp - follow the instructions for installing this from the "HElib" section if you haven't already.

Building SHEEP

And finally build SHEEP: cd <base SHEEP dir> mkdir build cd build cmake ../ make all This builds the examples in build/bin.

Run the tests with: make test

Circuit language and input files

The inputs to SHEEP are circuit files, which have the extension .sheep and the following format: INPUTS <circuit_input_0> ... OUTPUTS <circuit_output_0> ... <gate_input_0> ... <GATE> <gate_output> ...

Owner

  • Name: The Alan Turing Institute
  • Login: alan-turing-institute
  • Kind: organization
  • Email: info@turing.ac.uk

The UK's national institute for data science and artificial intelligence.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 3
Last Year
  • Issues event: 1
  • Watch event: 3

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 792
  • Total Committers: 11
  • Avg Commits per committer: 72.0
  • Development Distribution Score (DDS): 0.269
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Nick Barlow n****w@t****k 579
Oliver Strickson o****n@t****k 112
Tomas Lazauskas t****s@t****k 43
Adria Gascon a****n@g****m 25
Oliver Strickson o****2 19
Tomas Lazauskas 1****z 6
Miguel Oleo o****l@g****m 4
nitincic n****c@g****m 1
Ubuntu n****n@d****t 1
Oliver Strickson o****2@c****k 1
Amartya Sanyal a****x@g****m 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 59
  • Total pull requests: 41
  • Average time to close issues: 3 months
  • Average time to close pull requests: about 15 hours
  • Total issue authors: 7
  • Total pull request authors: 4
  • Average comments per issue: 0.41
  • Average comments per pull request: 0.15
  • Merged pull requests: 35
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nbarlowATI (32)
  • ots22 (11)
  • tomaslaz (11)
  • miguelob (2)
  • martintoreilly (1)
  • knighan (1)
  • adriagascon (1)
  • mhauru (1)
Pull Request Authors
  • nbarlowATI (26)
  • tomaslaz (8)
  • ots22 (5)
  • miguelob (2)
Top Labels
Issue Labels
bug (6) enhancement (2) good first issue (2)
Pull Request Labels