├── README.md ├── art ├── logo-full-doxygen.png ├── logo-full.jpg ├── logo-full.psd ├── logo-small.jpg └── logo-small.psd └── scripts ├── check_aws.py ├── install.py ├── throttle.py └── throttle.sh /README.md: -------------------------------------------------------------------------------- 1 | # EMP Toolkit Readme Page 2 | 3 | 4 | ## Installation 5 | 6 | 1. Go the the folder you want to install everything 7 | 8 | 2. `curl https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.py -O` 9 | 10 | 3. `python install.py --deps --tool --ot` to install code dependency, and master branch of emp-tool and emp-ot. More flags can be added including `--sh2pc`, `--ag2pc`, `--agmpc`, `--zk`. 11 | - You can also install a branch using `python install.py --[repo1]=[branch1] --[repo2]=[branch2]`, e.g., `python install.py --deps --tool=0.2.1 --ot=master` 12 | 13 | 14 | ## Citation 15 | ```latex 16 | @misc{emp-toolkit, 17 | author = {Xiao Wang and Alex J. Malozemoff and Jonathan Katz}, 18 | title = {{EMP-toolkit: Efficient MultiParty computation toolkit}}, 19 | howpublished = {\url{https://github.com/emp-toolkit}}, 20 | year={2016} 21 | } 22 | ``` 23 | ## Acknowledgement 24 | This work was supported in part by the National Science Foundation under Awards #1111599 and #1563722. 25 | 26 | The authors would like to thank everyone who contributed to this project, including but not limited to 27 | - [Fabrice Benhamouda](http://www.normalesup.org/~fbenhamo/), 28 | - [Weikeng Chen](https://www.chenweikeng.com/), 29 | - [Shai Halevi](https://shaih.github.io/), 30 | - [Brett Hemenway](http://www.cis.upenn.edu/~fbrett/), 31 | - [Zhicong Huang](https://acs6610987.github.io/), 32 | - [Wen-jie Lu](http://fionser.github.io/), 33 | - [Ivan Oliveira Nunes](https://sites.google.com/site/ivandeoliveiranunes/), 34 | - [David Cerezo Sánchez](http://cerezo.name/blog/about/), 35 | - [Phillipp Schoppmann](https://hu.berlin/schoppmp), 36 | - [Chenkai Weng](https://github.com/carlweng), 37 | - [Ruiyu Zhu](https://github.com/RuiyuZhu), 38 | - and others. 39 | 40 | 41 | ## Question 42 | Please send emails to wangxiao@cs.northwestern.edu 43 | -------------------------------------------------------------------------------- /art/logo-full-doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emp-toolkit/emp-readme/28ed3ab07be2edda6d7841692be2c552d22d7cf5/art/logo-full-doxygen.png -------------------------------------------------------------------------------- /art/logo-full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emp-toolkit/emp-readme/28ed3ab07be2edda6d7841692be2c552d22d7cf5/art/logo-full.jpg -------------------------------------------------------------------------------- /art/logo-full.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emp-toolkit/emp-readme/28ed3ab07be2edda6d7841692be2c552d22d7cf5/art/logo-full.psd -------------------------------------------------------------------------------- /art/logo-small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emp-toolkit/emp-readme/28ed3ab07be2edda6d7841692be2c552d22d7cf5/art/logo-small.jpg -------------------------------------------------------------------------------- /art/logo-small.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emp-toolkit/emp-readme/28ed3ab07be2edda6d7841692be2c552d22d7cf5/art/logo-small.psd -------------------------------------------------------------------------------- /scripts/check_aws.py: -------------------------------------------------------------------------------- 1 | #output all running AWS machines. 2 | import json, sys, subprocess 3 | 4 | # requires AWS CLI 5 | all_region = subprocess.check_output("aws ec2 describe-regions --region us-east-1 --output text | cut -f4", shell=True).decode().strip() 6 | 7 | for reg in all_region.split("\n"): 8 | res = subprocess.check_output("aws ec2 describe-instances --region "+reg, shell=True) 9 | obj = json.loads(res) 10 | if(len(obj['Reservations']) != 0): 11 | for i in obj['Reservations']: 12 | for j in i['Instances']: 13 | if j['State']['Name'] == 'running': 14 | print(reg, j['KeyName'], j['InstanceType'],j['State']['Name']) 15 | -------------------------------------------------------------------------------- /scripts/install.py: -------------------------------------------------------------------------------- 1 | #!/usr/python 2 | import subprocess 3 | install_packages = ''' 4 | if [ "$(uname)" == "Darwin" ]; then 5 | brew list openssl || brew install openssl 6 | brew list pkg-config || brew install pkg-config 7 | brew list cmake || brew install cmake 8 | else 9 | if command -v apt-get >/dev/null; then 10 | sudo apt-get install -y software-properties-common 11 | sudo apt-get update 12 | sudo apt-get install -y cmake git build-essential libssl-dev 13 | elif command -v yum >/dev/null; then 14 | sudo yum install -y python3 gcc make git cmake gcc-c++ openssl-devel 15 | else 16 | echo "System not supported yet!" 17 | fi 18 | fi 19 | ''' 20 | 21 | install_template = ''' 22 | git clone https://github.com/emp-toolkit/X.git --branch Y 23 | cd X 24 | cmake . 25 | make -j4 26 | sudo make install 27 | cd .. 28 | ''' 29 | 30 | import argparse 31 | parser = argparse.ArgumentParser() 32 | parser.add_argument('-install', '--install', action='store_true') 33 | parser.add_argument('-deps', '--deps', action='store_true') 34 | parser.add_argument('--tool', nargs='?', const='master') 35 | parser.add_argument('--ot', nargs='?', const='master') 36 | parser.add_argument('--sh2pc', nargs='?', const='master') 37 | parser.add_argument('--ag2pc', nargs='?', const='master') 38 | parser.add_argument('--agmpc', nargs='?', const='master') 39 | parser.add_argument('--zk', nargs='?', const='master') 40 | args = parser.parse_args() 41 | 42 | if vars(args)['install'] or vars(args)['deps']: 43 | subprocess.call(["bash", "-c", install_packages]) 44 | 45 | for k in ['tool', 'ot', 'zk', 'sh2pc', 'ag2pc', 'agmpc']: 46 | if vars(args)[k]: 47 | template = install_template.replace("X", "emp-"+k).replace("Y", vars(args)[k]) 48 | print(template) 49 | subprocess.call(["bash", "-c", template]) 50 | -------------------------------------------------------------------------------- /scripts/throttle.py: -------------------------------------------------------------------------------- 1 | #!/usr/python 2 | import subprocess 3 | def find_dev(): 4 | l = [] 5 | o = subprocess.check_output(['ifconfig']) 6 | for i in o.split("\n"): 7 | if "flags" in i: 8 | l.append(i.split(":")[0]) 9 | res = "" 10 | for i in l: 11 | if i != "lo": 12 | res = i 13 | if len(l) > 2: 14 | print("More than two candidates!") 15 | return res 16 | remove_throttle = ''' 17 | sudo tc qdisc del dev DEV root 18 | ''' 19 | 20 | add_throttle = ''' 21 | sudo tc qdisc del dev DEV root 22 | sudo tc qdisc add dev DEV root handle 1: tbf rate BANDWIDTHmbit burst 100000 limit 10000 23 | sudo tc qdisc add dev DEV parent 1:1 handle 10: netem delay DELAYmsec 24 | ''' 25 | import argparse 26 | parser = argparse.ArgumentParser() 27 | parser.add_argument('-i', '--interface', action='store', dest='i', type = str, required = True) 28 | parser.add_argument('-b', '--bandwith', action='store', dest = 'b', type = int) 29 | parser.add_argument('-l', '--latency', action='store', dest = 'l', type = int) 30 | parser.add_argument('-d', '--delete', action='store_true') 31 | args = parser.parse_args() 32 | DEV = "" 33 | if args.i == "auto": 34 | DEV = find_dev() 35 | else: 36 | DEV = args.i 37 | print(vars(args)) 38 | if vars(args)['delete']: 39 | subprocess.call(["bash", "-c", remove_throttle.replace("DEV", DEV)]) 40 | else: 41 | if vars(args)['b']!=None and vars(args)['l'] != None : 42 | cmd = add_throttle.replace("DEV", DEV).replace("BANDWIDTH", str(vars(args)['b']))\ 43 | .replace("DELAY", str(vars(args)['l'])) 44 | print(cmd) 45 | subprocess.call(["bash", "-c", cmd]) 46 | elif vars(args)['b']!=None and vars(args)['l'] == None : 47 | cmd = add_throttle.replace("DEV", DEV).replace("BANDWIDTH", str(vars(args)['b']))\ 48 | .replace("DELAY", "0") 49 | print(cmd) 50 | subprocess.call(["bash", "-c", cmd]) 51 | else: 52 | print("error!") 53 | -------------------------------------------------------------------------------- /scripts/throttle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DEV=lo 3 | if [ "$1" == "del" ] 4 | then 5 | sudo tc qdisc del dev $DEV root 6 | fi 7 | 8 | if [ "$1" == "lan" ] 9 | then 10 | sudo tc qdisc del dev $DEV root 11 | sudo tc qdisc add dev $DEV root handle 1: tbf rate 2320mbit burst 100000 limit 10000 12 | sudo tc qdisc add dev $DEV parent 1:1 handle 10: netem delay 0msec 13 | fi 14 | if [ "$1" == "wan" ] 15 | then 16 | sudo tc qdisc del dev $DEV root 17 | sudo tc qdisc add dev $DEV root handle 1: tbf rate 200mbit burst 100000 limit 10000 18 | sudo tc qdisc add dev $DEV parent 1:1 handle 10: netem delay 10msec 19 | fi --------------------------------------------------------------------------------