Coder Social home page Coder Social logo

sampleyang / stealthdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cryptograph/stealthdb

0.0 0.0 0.0 19.91 MB

StealthDB: an encrypted database from intel sgx with small trusted computing base.

C++ 19.99% C 17.66% Assembly 0.19% Makefile 1.50% PLpgSQL 60.56% Dockerfile 0.09%

stealthdb's Introduction

StealthDB

StealthDB is an extension to PostgreSQL, leveraging Intel SGX, that endows it with encrypted database functionality (i.e. encrypted values can be persisted in tables, and queries with encrypted expressions and predicates can be specified). The database's integrity and confidentiality is guaranteed under a threat model in which only the CPU is trusted. Further information can be found here.

Status

StealthDB is a research project and is not suitable for production use.

Requirements

Quickstart

Installing on 64-bit Ubuntu Desktop-16.04

  1. Install PostgreSQL server and the PostgreSQL extension build tool:
sudo apt-get install postgresql postgresql-server-dev-all
  1. Run:
make
sudo make install

Creating a Debian-based Docker Container

  1. If you have a PostgreSQL service already running, be sure to stop it with sudo service postgresql stop.

  2. Run

make docker

Running Queries

  1. Run the PostgreSQL client.

  2. Load the extension into the database, generate the default master key, and load the key.

CREATE EXTENSION encdb;
SELECT generate_key();
SELECT load_key(0);
  1. Try some examples
SELECT pg_enc_int4_encrypt(1) + pg_enc_int4_encrypt(2);
SELECT pg_enc_int4_decrypt(pg_enc_int4_encrypt(1) + pg_enc_int4_encrypt(2));

pg_enc_int4_decrypt and pg_enc_int4_encrypt are wrappers around the enc_int4 data type, which in turn corresponds to the int4 type offered by PostgreSQL.

pg_enc_int4_encrypt(x) encrypts the number x and stores it as an enc_int4 value. pg_enc_int4_decrypt(x) takes an enc_int4 value x and decrypts it. Further information can be found here.

Consult the manual for further information.

stealthdb's People

Contributors

cryptograph avatar sampleyang avatar xvzcf 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.