Code Monkey home page Code Monkey logo

obliv-c-ssl's Introduction

Obliv-C with TLS support

This repository contains a modified version of Obliv-C with TLS support.

The original Obliv-C can be found here: https://github.com/samee/obliv-c

In particular, two parties in the secure computation share a pre-shared secret key and use the TLS protocol for network communication.

Installation

Please follow the original Obliv-C installation instructions.

In addition, we require tcmalloc, which is part of Google's gperftools.

For Ubuntu, it can be installed using apt-get.

sudo apt-get install libgoogle-perftools-dev

The rest of the steps are similar with the original Obliv-C's.

Example

A toy, insecure example to set up the TLS connections is as follow:

void ocTestUtilTcpOrDieBuffered(ProtocolDesc* pd, bool isServer, const char* remote_host, const char* port, bool isProfiled, size_t first_party_send_buffer_size, size_t second_party_send_buffer_size) {
	const char key[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF};
	if(isServer) {
		int res;
		res = protocolAcceptTLS2P(pd, port, key, isProfiled, first_party_send_buffer_size);
		if(res!=0) {
			fprintf(stderr,"TLS accept failed\n");
			exit(1);
		}
	} else {
		int res;
		res = protocolConnectTLS2P(pd, remote_host, port, key, isProfiled, second_party_send_buffer_size);
		if (res!=0) {
			fprintf(stderr,"TLS connect failed\n");
			exit(1);
		}
	}
}	

Note that key is the pre-shared secret key. One should better not hard-code this key in the code.

Buffering is crucial for the performance since every TLS packet needs to carry additional payload. Thus, the buffer sizes need to be provided. Some of our experiments use 32768 and yield a good result.

Licenses

Note that this library is based on CIL and Obliv-C. They both use BSD licenses.

See LICENSE-cil and LICENSE-oblivcc for more information.

obliv-c-ssl's People

Contributors

ctshepherd avatar darioncassel avatar egrimley-arm avatar haihaoshen avatar jackdoerner avatar jim-grundy avatar justin1121 avatar kerneis avatar liblit avatar mark-i-m avatar mdh3hc avatar oblivious-app avatar omar-selo avatar pmundkur avatar samee avatar schoppmp avatar schwahn avatar stephenrkell avatar wangxiao1254 avatar weikengchen avatar yakobowski avatar

Watchers

 avatar  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.