# Intel SGX SDK Setup

Getting the Intel SDK running on your computer is sometimes tricky. Check out the wiki for tutorials.

## Intel(R) Software Guard Extensions for Linux\* OS

### Ubuntu 20.04 LTS 64-bit Desktop

This documentation is a quick installation guide to run Intel(R) Software Guard Extensions on Ubuntu 20.04 LTS 64-bit Desktop with disabled Flexible Launch Control (FLC) support.

#### **Prerequisites**

To install the Intel® SGX PSW, first install the following tools&#x20;

`$ sudo apt-get install libssl-dev libcurl4-openssl-dev libprotobuf-dev`

To install the Intel® SGX SDK, install the following tools

`$ sudo apt-get install build-essential python-is-python3`

#### **Install Intel® SGX Driver Installation**

Download the DCAP [driver](https://app.gitbook.com/s/ZAOyClhisJhRvjIxLjXP/). You  find the DCAP version in the `driver_readme.txt` file.

Set the protections to allow for the .bin file execution&#x20;

`$ chmod 777 sgx_linux_x64_driver_<version>.bin`

Run the following command:

`$ sudo./sgx_linux_x64_driver_<version>.bin`

Reboot your system.

#### **Intel® SGX Platform Software (PSW) Installation**

Add the following repository to your sources

```
$ echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
```

Add the key to the list of trusted keys used by the apt to authenticate packages:&#x20;

```
$ wget https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key 
$ sudo apt-key add intel-sgx-deb.key
```

Update the apt and install the packages:&#x20;

`$ sudo apt-get update`

Install launch service:&#x20;

`$ sudo apt-get install libsgx-launch libsgx-urts`

Install EPID-based attestation service:&#x20;

`$ sudo apt-get install libsgx-epid`

Install algorithm agnostic attestation service&#x20;

`$ sudo apt-get install libsgx-quote-ex`

#### Install Intel® SGX SDK Installation

Download [Intel® SGX SDK package](https://app.gitbook.com/s/sGDt7oDAVwKSqYFvdscm/tutorials).&#x20;

Set the protections to allow for the .bin file execution

`$ chmod 777 sgx_linux_x64_sdk_<version>.bin`

Install the SDK using the following command:&#x20;

`$ sudo./sgx_linux_x64_sdk_<version>.bin`

Install the SDK in directory `/opt/intel/sgxsdk.`

Run the following command

`source /opt/intel/sgxsdk/environment`

#### **Find further Documentation**

[Intel(R) SGX for Linux\* OS](https://01.org/intel-softwareguard-extensions) project home page on [01.org](https://01.org/) [Intel(R) SGX Programming Reference](https://software.intel.com/sites/default/files/managed/7c/f1/332831-sdm-vol-3d.pdf)

## Intel(R) Software Guard Extensions for Win10 x64

### Windows 10 x64 version 20H2 (OS Build 19042.964)

#### **Prerequisites**

Update bios/uefi to the newest version. The new firmware can be found at the page of your manufactor or it can be updated through their distributed applications. To run with native Intel SGX support, enable SGX in your bios/uefi. Mostly found under **security**.

#### **Install Intel® SGX**

Download **Intel SGX SDK for Windows v.2.12.1004.exe** and **Intel SGX PSW for Windows v.2.12.102.1.exe** from [here](https://software.intel.com/content/www/us/en/develop/topics/software-guard-extensions/sdk.html).
