SgxCryptoFile is an application for encrypting and decrypting HLS chunks using Intel SGX.
The encryption and decryption are implemented based on T_CRYPTO library provided by Intel SGX SDK.
It uses AES-128-GCM algorithm and it was written in pure C language.
In addition, it generates an encryption/decryption benchmark time.
Actually, the key is hardcoded inside the enclave.
Prerequisites:
-
Ensure that you have the following required operating systems: Ubuntu* Desktop-14.04-LTS 64bits
-
Install Intel(R) SGX SDK for Linux* OS and follow all the instructions;
-
Use the following command to install the required tools to build SgxCryptoFile application:
$ sudo apt-get install nasm
Build the SgxCryptoFile
The following steps describe how to build the SgxCryptoFile application.
-
Build the project with the prepared Makefile:
-
Hardware Mode, Debug build:
$ make SGX_MODE=HW SGX_DEBUG=1
- Hardware Mode, Pre-release build:
$ make SGX_MODE=HW SGX_PRERELEASE=1
- Hardware Mode, Release build:
$ make SGX_MODE=HW
- Simulation Mode, Debug build:
$ make SGX_DEBUG=1
- Simulation Mode, Pre-release build:
$ make SGX_PRERELEASE=1
- Simulation Mode, Release build:
$ make
- To clean the files generated by previous
make
command, enter the following command:
$ make clean
Encrypt File
To encrypt a file, enter the following command:
$ ./sgxCryptoFile -e -i [INPUT_FILE] -o [OUTPUT_FILE]
Decrypt File
To decrypt a file, enter the following command:
$ ./sgxCryptoFile -d -i [INPUT_FILE] -o [OUTPUT_FILE]