GithubHelp home page GithubHelp logo

cs174's Introduction

CS 174 Final Project

Eric Swenson, Evgeny Chistyakov

System Setup

  1. Install requred packages:
    • sudo apt-get install mysql-server (MySQL server)
    • sudo apt-get install libmysqlclient-dev (MySQL header files)
    • sudo apt-get install m4 (gmp library dependens on it)
    • sudo apt-get install make (needed for compilation)
    • sudo apt-get install gcc (needed for compilation)
  2. Download/clone this repo
  3. Extract the libraries (paillier/libs)
    • tar xvfz libpaillier-0.8.tar.gz
    • tar xvfj gmp-6.1.0.tar.bz2
  4. Install the gmp library (depends on m4)
    • Navigate to extracted library folder
    • ./configure
    • make
    • sudo make install
  5. Install the paillier library (depends on gmp)
    • Navigate to extracted library folder
    • ./configure
    • make
    • Open generated Makefile in text editor and add -fPIC flag to the list of CFLAGS
    • sudo make install

MySQL Setup

  1. Compile the C code
    • Navigate to paillier/src
    • make
    • Output binaries are: encrypt, decrypt, key_factory, sum_he.so
  2. Copy sum_he.so to MySQL plugins folder:
    • sudo cp sum_he.so /usr/lib/mysql/plugin
  3. Register SUM_HE with MySQL:
    • CREATE AGGREGATE FUNCTION sum_he RETURNS STRING SONAME 'sum_he.so';
    • To deregister: DROP FUNCTION sum_he;

Client Setup

  1. Install required packages:
    • sudo apt-get install python-pip
    • sudo apt-get install python-dev
    • sudo pip install mysql-connector-python --allow-external mysql-connector-python
    • sudo pip install tabulate
  2. Copy encrypt and decrypt binaries into the /client folder:
    • cp encrypt ../../client
    • cp decrypt ../../client
  3. Update the config dictionary in client.py (user, password, host, etc.)
  4. Launch the client:
    • python client.py cc0b753172e2f753226965e9bb85d4f3 6605ba98b9717ba8ac482a7be12840a8 (public key is hardcoded into sum_he.so)

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.