I want to perform an operation inside an enclave and encrypt it when passing the computed value to the outside.
How do I encrypt my data?
You can also refer the Intel SDK's sample code: SealUnseal. You can find this source code in the SDK installer, or you can find in the github: https://github.com/intel/linux-sgx/tree/master/SampleCode/SealUnseal
It is important to mention that the unsealing of data can only be performed in the same machine where the seal operation has occurred, and also that the user **cannot** choose a specific key to use to encrypt/decrypt data.