Git Product home page Git Product logo

sgx-server-client's Introduction

SGX-server-client

Introduction

This is a project designed to be an example for SGX program to behave differently according to command line parameters.

There's a server and a client connected with socket. Upon the connection sucessfully built, they agree with a session key with Diffie–Hellman Protocol. After that, the server acts as a echo server and repeats whatever the client says. Users can type in any message from keyboard to the client side, and see server's reply on the screen.

Usage

  1. Build
    # Build in Hardware Mode
    $ make
    
    # Build in Simulation Mode
    $ make SGX_MODE=SIM
    Note: If failed due to SDK location problem, build with this command
    # Build by specifiying SDK directory
    $ make SGX_SDK=<path_to_sgxsdk_directory>
  2. Run a server
    $ ./app s 5000
    Note: If failed due to library path issue, execute this command before run the server
    $ export LD_LIBRARY_PATH=<path_to_linux-sgx/build/linux>:$LD_LIBRARY_PATH
  3. Run a client
    $ ./app c localhost 5000
    Note: If failed due to library path issue, execute this command before run the client
    $ export LD_LIBRARY_PATH=<path_to_linux-sgx/build/linux>:$LD_LIBRARY_PATH

Known issues

There's a significant flaw in the program. In the project, client and server agree with a shared key using the simplest version of Diffie-Hellman Key Exchange Protocol. Document suggests that we should always hold dh_msg buffer in enclave space, but we didn't. So it will be trivial for malicious Operating System to conduct a MiTM attack.

Thanks

To excellent code base from http://csapp.cs.cmu.edu/3e/code.html. I used it to build socket server and client.

sgx-server-client's People

Contributors

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