An Emulator and SDK for Intel SGX extension
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
lib New libraries Feb 7, 2017
src openssl-sha1 added Mar 3, 2016
.gitignore demo explained Apr 4, 2016
Makefile openssl-sha1 added Mar 3, 2016
README.md Update README.md Oct 7, 2016
contrib.md Rename contrib to contrib.md Mar 8, 2016
sgx.ko New libraries Feb 7, 2017

README.md

SGX-emulator and SDK

Use the emulator with the following specific setting only!

64-bit Ubuntu 14.04.3 LTS guest OS in VirtualBox

(This is the setting we have tested so far, and we can ensure the working of our emulator! We may relieve the requirement on VirtualBox in the future release.)

Before execution, make sure about the right Linux version

uname -r
3.19.0-25-generic

Here's a prebuilt VirtualBox image. The username and password to login the system are both "sgx"

https://www.dropbox.com/s/z18a12m09ajw6ry/sgx-env.vdi?dl=0

Demo

sudo insmod sgx.ko
make sha
#sudo dmesg -c
make r # view the standard output
dmesg # view kernel output
sudo rmmod sgx

(alternative, you can also run make in the second line).

Explanation

This demo will show you a simple Enclave program that computes sha1 (cryptographic hash from openssl) inside Enclave.

  • In user-space code, it appears to be a simple function call into a dynamically loaded library.
  • In dmesg, you can see that the function call is "captured" in the kernel space (triggered by an illegal instruction, verified through the following "experiment"). We use this kernel-space hooking to emulate the SGX ENCLU instructions (EENTER and EEXIT).
sudo rmmod sgx
make r #you should be able to see the "illegal instruction" exception