Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.
1461 Discussions

Wrapping Python Interpreter in C to Run Python modules in Enclave?


We have some Python programs that may prove difficult to rewrite in another language, but they contain a number of algorithms and data we would like to protect within something like the SGX enclave.  Assuming limited rewrites such that the Python code that needs protection is not making system calls and doing everything in memory, can a C program compiled with the Python interpreter and Python modules run in an SGX enclave?  What would be the caveats to doing so?  Some references that cause me to consider this are:

"Embedding Python in Your C Programs" (

"Calling Python Functions from C" (

On the flip side, to limit rewrites of Python code, is there any reason I can't call an untrusted C program from a Python program in order to launch C-enclave modules into the SGX enclave?





0 Kudos
0 Replies