@@ -201,139 +201,8 @@ const taskId = await iexec.order.matchOrders({
201201});
202202```
203203
204- ## 🔐 Encrypt Results (Advanced)
204+ ## Next Steps
205205
206- ::: info
207-
208- DataProtector handles encryption automatically If you're using DataProtector,
209- result encryption is handled automatically. This section is only needed for
210- manual encryption when not using DataProtector.
211-
212- :::
213-
214- Secure your outputs with end‑to‑end encryption so only you (the beneficiary) can
215- read them. Results leave the enclave and may traverse untrusted storage and
216- networks; encryption ensures nobody else (operators, storage providers,
217- intermediaries) can access the content.
218-
219- ### 1) Generate your encryption key pair
220-
221- The beneficiary key pair is the root of trust for result confidentiality. The
222- public key will be used inside the TEE to encrypt results for the beneficiary;
223- the private key stays with the beneficiary to decrypt them locally.
224-
225- Run from your iExec project directory:
226-
227- ``` bash
228- iexec result generate-encryption-keypair
229- ```
230-
231- This creates two files in ` .secrets/beneficiary/ ` :
232-
233- ```
234- .secrets/
235- └─ beneficiary/
236- ├─ <0x-your-wallet-address>_key # PRIVATE KEY (keep safe)
237- └─ <0x-your-wallet-address>_key.pub # PUBLIC KEY
238- ```
239-
240- Back up the private key securely. You will only need it locally to decrypt
241- results.
242-
243- ### 2) Push your public key to the SMS
244-
245- The Secret Management Service securely delivers your public key, at runtime, to
246- the enclave running your iApp. Without this, the iApp cannot encrypt outputs for
247- you.
248-
249- Make the public key available to TEEs at runtime:
250-
251- ``` bash
252- iexec result push-encryption-key --tee-framework scone
253- ```
254-
255- Verify it:
256-
257- ``` bash
258- iexec result check-encryption-key --tee-framework scone
259- ```
260-
261- ### 3) Run the iApp with encrypted results
262-
263- The --encrypt-result flag instructs the platform to perform envelope encryption
264- inside the enclave using your public key, so the archive that leaves the TEE is
265- unreadable to others.
266-
267- Trigger a task and request encrypted outputs:
268-
269- ``` bash
270- iexec app run < 0x-app-address> \
271- --workerpool < 0x-workerpool-address> \
272- --tag tee,scone \
273- --encrypt-result \
274- --watch
275- ```
276-
277- When completed, download the results archive:
278-
279- ``` bash
280- iexec task show < 0x-task-id> --download
281- ```
282-
283- Inside the archive, ` iexec_out/result.zip.aes ` is encrypted.
284-
285- Note: Results are encrypted for the task beneficiary. Ensure the beneficiary
286- address is yours to be able to decrypt the archive.
287-
288- If you extract the archive and try to read the encrypted file, you'll see
289- unreadable content:
290-
291- ``` bash
292- mkdir /tmp/trash && \
293- unzip < 0x-your-task-id> .zip -d /tmp/trash && \
294- cat /tmp/trash/iexec_out/result.zip.aes
295- ```
296-
297- The output will look like:
298-
299- ``` bash
300- )3XqYvzEfRu< \ݵ mm疞rc(a{{' ܼ͛q/[{hgD$g\.kj"s?"hJ_Q41_[{XԚa蘟vEr肽
301- Յ]9WTL*tdzO`!e&snoL3K6L9%
302- ```
303-
304- This confirms the results are properly encrypted and unreadable without the
305- private key.
306-
307- ### 4) Decrypt results locally
308-
309- Results are encrypted end‑to‑end; only your private key can decrypt them. This
310- step restores the plaintext so you can use the output files.
311-
312- Use your private key generated in step 1:
313-
314- ```bash
315- iexec result decrypt iexec_out/result.zip.aes
316- ```
317-
318- This produces `results.zip`. Extract it to view plaintext outputs:
319-
320- ```bash
321- unzip results.zip -d my-decrypted-result
322- ```
323-
324- And you can see the content of your result file:
325-
326- ```bash
327- $ cat my-decrypted-result/result.txt
328- Hello, world!
329- ```
330-
331- Your results are now decrypted and ready to use.
332-
333- ### Notes and tips
334-
335- - Keep the private key offline and backed up.
336- - You can rotate keys by re-running generation and push steps; old tasks remain
337- decryptable with the old private key.
338- - iApp code does not need changes to enable result encryption; it is enforced by
339- the TEE using the public key from SMS.
206+ For advanced use cases where you need to encrypt the results of your iApp
207+ execution, refer to the [ Encrypt iApp Results] ( /guides/use-iapp/encrypt-result )
208+ guide.
0 commit comments