[Paper Review] Leveraging Intel SGX to Create a Nondisclosure Cryptographic library
This paper presents a secure cryptographic library that leverages Intel SGX to isolate and protect cryptographic keys within hardware-enforced enclaves, ensuring confidentiality and integrity. By executing cryptographic operations—such as SHA-256, HMAC-SHA-256, and AES-ECB/CBC—inside SGX enclaves, the system prevents key exposure even if the OS or application is compromised, resulting in a minimal trusted computing base and open-sourced proof-of-concept code.
Enforcing integrity and confidentiality of users' application code and data is a challenging mission that any software developer working on an online production grade service is facing. Since cryptology is not a widely understood subject, people on the cutting edge of research and industry are always seeking for new technologies to naturally expand the security of their programs and systems. Intel Software Guard Extension (Intel SGX) is an Intel technology for developers who are looking to protect their software binaries from plausible attacks using hardware instructions. The Intel SGX puts sensitive code and data into CPU-hardened protected regions called enclaves. In this project we leverage the Intel SGX to produce a secure cryptographic library which keeps the generated keys inside an enclave restricting use and dissemination of confidential cryptographic keys. Using enclaves to store the keys we maintain a small Trusted Computing Base (TCB) where we also perform computation on temporary buffers to and from untrusted application code. As a proof of concept, we implemented hashes and symmetric encryption algorithms inside the enclave where we stored hashes, Initialization Vectors (IVs) and random keys and open sourced the code (https://github.com/hmofrad/CryptoEnclave).
Motivation & Objective
- To address the challenge of protecting cryptographic keys from exposure in untrusted software environments.
- To reduce the trusted computing base (TCB) by isolating sensitive cryptographic operations within Intel SGX enclaves.
- To enable secure cryptographic operations—hashing, symmetric encryption—without exposing keys to the host OS or application.
- To provide a production-ready, open-source cryptographic library that abstracts cryptographic complexity while enforcing key confidentiality.
- To lay the foundation for future secure inter-enclave communication with mutual authentication and key exchange.
Proposed method
- Uses Intel SGX to create isolated, CPU-protected memory regions (enclaves) that execute cryptographic functions and store keys securely.
- Implements cryptographic primitives—SHA-256, HMAC-SHA-256, AES-ECB, and AES-CBC—within the enclave using the Intel SGX SDK and LibTomCrypt library.
- Restricts data and key access to enclave boundaries, ensuring keys never leave the protected memory region.
- Employs remote and local attestation to verify enclave integrity and authenticate the execution environment.
- Designs a minimal trusted computing base by limiting the trusted code to only the enclave and its cryptographic operations.
- Uses sealed storage and secure entry/exit points to control data flow between untrusted application code and the enclave.
Experimental results
Research questions
- RQ1How can cryptographic keys be protected from compromise in untrusted execution environments?
- RQ2Can Intel SGX be effectively used to build a minimal, secure cryptographic library with strong key confidentiality?
- RQ3What cryptographic operations can be safely and efficiently isolated within an SGX enclave while maintaining performance and usability?
- RQ4How can a trusted computing base be minimized when building a cryptographic library with hardware-assisted protection?
- RQ5What are the practical challenges and limitations of enabling secure inter-enclave communication for key exchange and data transfer?
Key findings
- The implementation successfully secures cryptographic keys within Intel SGX enclaves, ensuring they are never exposed to the host OS or untrusted applications.
- The library supports four core cryptographic functions: SHA-256, HMAC-SHA-256, AES-ECB, and AES-CBC with 128-, 192-, and 256-bit keys.
- The system achieves strong confidentiality and integrity guarantees by isolating key generation, storage, and operations within hardware-protected enclaves.
- The use of LibTomCrypt enables modularity and extensibility, allowing future support for new cryptographic algorithms with minimal code changes.
- The open-sourced codebase (available on GitHub) provides a production-ready, secure foundation for integrating enclave-based cryptography into real-world applications.
- The authors identify that future work must address secure, authenticated communication between enclaves over potentially unsafe channels, even on the same machine.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.