Status: ✅ Accepted at ACM CCS 2025 (artifact available)
Paper: How to Recover a Cryptographic Secret From the Cloud — also on the Cryptology ePrint Archive (2023/1308)
- Run our implementation either on AWS Nitro Enclaves (real TEE) or in a local emulated setup (Docker).
- Execute store / retrieve / remove / recover experiments.
- Collect timings into CSVs and generate summary stats (min / max / mean / median / stdev).
If you’re in a hurry: Jump to Quick Start → choose AWS Nitro or Emulated → then Run Experiments → Summarize Results.
- Folder Structure
- Quick Start
- Run Experiments
- Summarize Results
- What this artifact is / isn’t
- Reproducibility & Environment Notes
- Troubleshooting
- How to Cite
- License
The project is organized as follows:
cryptofolder contains common cryptographic primities such as encryption, commitment, pairing and signatures.enclavefolder contains all operations related to the enclave.fabricfolder contains codes to simulate hyperledger.skrecoveryfolder contains the protocol implementations.experimentsfolder contains the scripts to run store, recover, etc.
Pick one of the following paths:
- Path A (Recommended): Run on a real TEE with AWS Nitro Enclaves.
- Path B (Local Emulation): Run the emulated setup locally with Docker.
If you prefer video guides, we have screen recordings for Path A - Setup with AWS Nitro and Path B - Docker Emulation. Both videos can be found in google drive folder. Please download the view locally for higher quality.
1. Launch Parent Instance
You can use the AWS CLI or the AWS Web Management Console.
Option 1: AWS CLI (example uses us-east-1)
aws ec2 run-instances \
--image-id ami-00ca32bbc84273381 \
--count 1 \
--instance-type m5.xlarge \
--key-name your_key_name \
--security-groups your_security_group_name \
--enclave-options 'Enabled=true'Note: Replace
your_key_nameandyour_security_group_name. Ensure theimage-id(AMI) matches your chosen AWS region.
Option 2: AWS Management Console
- Go to the EC2 Dashboard and click Launch instance.
- Name: Enter any label for your instance.
- Application and OS Images (AMI): Choose Amazon Linux → Amazon Linux 2023 kernel-6.1 AMI (64-bit x86).
- Instance type: Select m5.xlarge.
- Key pair (login):
- If you have a key pair, select it.
- Otherwise, click Create new key pair, name it (e.g.,
skrec), choose ED25519, and click Create key pair. Your browser will download the private key (e.g.,skrec.pem). Keep it safe.
- Network settings:
- Select an existing security group or choose Create security group. The defaults are usually sufficient.
- Configure storage:
- Change the default 8 GiB to 30 GiB to avoid running out of space.
- Advanced details:
- Scroll to Nitro Enclave and select Enable.
- Review the Summary panel and click Launch instance.
2. Connect and Set Up the Instance
Connect via SSH:
Find your instance's public IP address in the EC2 console.
ssh -i path/to/your/skrec.pem ec2-user@<public-ip-address>If you see a "permissions are too open" error for your
.pemfile, fix it with:chmod 400 path/to/your/skrec.pem
Update the instance:
sudo yum update -yInstall Git:
sudo yum install git -yClone the repository:
git clone https://github.com/wspr-ncsu/Secret-Recovery.gitEnter the repository directory:
cd Secret-RecoveryRun the parent setup script (installs Docker, Docker Compose, nitro-cli):
Make the script executable first.
sudo chmod +x aws-parent-setup.shThen run it.
./aws-parent-setup.shAllocate 4 GiB of memory to the enclave:
sudo nano /etc/nitro_enclaves/allocator.yamlChange
memory_mib: 512tomemory_mib: 4096. Save and close the file.
Restart the allocator service:
sudo systemctl restart nitro-enclaves-allocator.serviceCreate the environment file:
cp .env.example .env3. Manage the Enclave
Use the helper script tee.sh to manage the enclave lifecycle.
Make the helper script executable:
chmod +x tee.shBuild and run the enclave:
./tee.sh runVerify the enclave is running:
nitro-cli describe-enclavesView the read-only enclave console:
./tee.sh consoleDestroy the enclave when finished:
./tee.sh terminateIf you don't have AWS access or prefer a local setup, use the emulated path. Because AWS Nitro itself is pretty much a virtual machine, we can fairly emulate all aspects except attestation. We simulate attestaion by using the BLS digital signature scheme for attestation and verification. This behavior should be similar to actual attesation (ECDSA) produced by the Nitro System.
1. Install Dependencies
Ensure you have Docker and Docker Compose installed on your specific operating system.
2. Configure the Environment
Create the environment file:
cp .env.example .envEdit .env to enable emulation:
Update the following lines to your .env file.
USE_VSOCK=1
VSOCK_HOST=localhost
VSOCK_PORT=5005
VSOCK_ENV=emulated
You are now ready to run the experiments.
First, build the core skrecovery Docker image.
Make the build script executable:
chmod +x build-skrecovery.shBuild the image:
./build-skrecovery.shStart the services:
The command differs slightly for the real TEE vs. the emulated environment.
On AWS Nitro (Real TEE):
docker compose up -dIn Emulated Mode (Local):
docker compose --profile emulated up -dThese commands start the
db,ordering-service, andexperimentcontainers.
Follow logs (optional):
For the ordering service:
docker logs -f ordering-serviceFor the emulated enclave (emulated mode only):
docker logs -f emulated-enclaveOpen a shell in the experiment container:
docker exec -it experiment /bin/bashInside the experiment container, run the following commands:
Register the server and client (run once):
python -m experiments.registerRun the store experiment:
python -m experiments.storeRun the retrieve experiment:
python -m experiments.retrieveRun the remove experiment:
python -m experiments.removeRun the recover experiment:
python -m experiments.recoverRun experiments in a batch:
To run an experiment multiple times, use the -n or --num_runs flag. To start fresh, you can clear the experiments/results/ directory before running.
# Example: Run the 'store' experiment 100 times
python -m experiments.store -n 100After collecting data, use the get_stats.py script to compute summary statistics (min, max, mean, median, stdev) for each experiment.
General usage:
python -m experiments.get_stats <input_csv_path> <output_csv_path>Example:
python -m experiments.get_stats experiments/results/store.csv experiments/results/store-summary.csv- ✅ Is: A research prototype to demonstrate the feasibility of our secret recovery mechanism using TEEs.
- ❌ Is not: A production-ready or reference implementation. Please do not deploy this in a production environment.
-
TEE Path (AWS Nitro Enclaves):
- Parent Instance: Amazon Linux 2023 (kernel 6.1) on an m5.xlarge instance is recommended.
- Enclave: Allocate ≥ 4 GiB of memory (
memory_mib: 4096) and 2 vCPUs.
-
Emulated Path (Docker):
- Any recent version of Docker and Docker Compose on Linux or macOS should work.
-
Outputs:
- Raw, per-run measurements are saved to
experiments/results/*.csv. - Aggregated statistics are generated by
experiments.get_stats.
- Raw, per-run measurements are saved to
-
Environment Variables:
- See
.env.examplefor all options. For emulation, ensureUSE_VSOCK=1,VSOCK_ENV=emulated, andVSOCK_HOST=localhostare set.
- See
- Docker permission denied: Add your user to the
dockergroup (sudo usmod -aG docker $USER) and log out/in, or prefix Docker commands withsudo. - Enclave fails to start: Double-check that
/etc/nitro_enclaves/allocator.yamlhasmemory_mib: 4096and that you restarted the service. - AMI or region mismatch: Ensure your AMI ID is valid for your selected AWS region.
- Helper script isn’t executable: Run
chmod +x tee.shand./build-skrecovery.sh. TimeoutError: [Errno 110] Connection timed out: Ensure the enclave is running (./tee.sh run) before starting the experiment services.- Docker Requires Sudo: If on MacOS or Linux, run
sudo usermod -aG docker $USERto add your user to docker group then logout and log back in. - Command
docker composenot found: Usedocker-compose
If you’re still stuck, please open an issue on our GitHub repository with logs and environment details.
If this artifact contributes to your research, please cite our paper:
@inproceedings{TannerSecretRecovery-CCS2025,
title = {How to Recover a Cryptographic Secret From the Cloud},
author = {Verber, Tanner and Adei, David and Scafuro, Alessandra and Orsini, Chris},
booktitle = {Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security (CCS)},
year = {2025},
note = {Also available as Cryptology ePrint Archive, Report 2023/1308}
}
This is research code. Please see the LICENSE file in the repository for terms of use.
- Run on AWS Nitro? → Path A
- Run with Docker? → Path B
- Collect results? → Run Experiments → Summarize Results
Happy reproducing! 🎉