You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
::: info DataProtector handles encryption automatically
207
+
If you're using DataProtector, result encryption is handled automatically. This section is only needed for manual encryption when not using DataProtector.
208
+
:::
209
+
210
+
Secure your outputs with end‑to‑end encryption so only you (the beneficiary) can read them. Results leave the enclave and may traverse untrusted storage and networks; encryption ensures nobody else (operators, storage providers, intermediaries) can access the content.
211
+
212
+
### 1) Generate your encryption key pair
213
+
214
+
The beneficiary key pair is the root of trust for result confidentiality. The public key will be used inside the TEE to encrypt results for the beneficiary; the private key stays with the beneficiary to decrypt them locally.
215
+
216
+
Run from your iExec project directory:
217
+
218
+
```bash
219
+
iexec result generate-encryption-keypair
220
+
```
221
+
222
+
This creates two files in `.secrets/beneficiary/`:
Back up the private key securely. You will only need it locally to decrypt results.
232
+
233
+
### 2) Push your public key to the SMS
234
+
235
+
The Secret Management Service securely delivers your public key, at runtime, to the enclave running your iApp. Without this, the iApp cannot encrypt outputs for you.
236
+
237
+
Make the public key available to TEEs at runtime:
238
+
239
+
```bash
240
+
iexec result push-encryption-key --tee-framework scone
241
+
```
242
+
243
+
Verify it:
244
+
245
+
```bash
246
+
iexec result check-encryption-key --tee-framework scone
247
+
```
248
+
249
+
### 3) Run the iApp with encrypted results
250
+
251
+
The --encrypt-result flag instructs the platform to perform envelope encryption inside the enclave using your public key, so the archive that leaves the TEE is unreadable to others.
252
+
253
+
Trigger a task and request encrypted outputs:
254
+
255
+
```bash
256
+
iexec app run <0x-app-address> \
257
+
--workerpool <0x-workerpool-address> \
258
+
--tag tee,scone \
259
+
--encrypt-result \
260
+
--watch
261
+
```
262
+
263
+
When completed, download the results archive:
264
+
265
+
```bash
266
+
iexec task show <0x-task-id> --download
267
+
```
268
+
269
+
Inside the archive, `iexec_out/result.zip.aes` is encrypted.
270
+
271
+
Note: Results are encrypted for the task beneficiary. Ensure the beneficiary address is yours to be able to decrypt the archive.
272
+
273
+
If you extract the archive and try to read the encrypted file, you'll see unreadable content:
0 commit comments