Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ export function getSidebar() {
text: 'Build your first SGX app',
link: '/guides/build-iapp/advanced/build-your-first-sgx-iapp',
},
{
text: 'End-to-end Encryption',
link: '/guides/build-iapp/advanced/protect-the-result',
},
{
text: 'Access Confidential Assets',
link: '/guides/build-iapp/advanced/access-confidential-assets',
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ please see our [CONTRIBUTING.md](CONTRIBUTING.md) guide.**
- Refactor "advanced" section in build-iapp
- Rework src\get-started\protocol\iexec-doracle.md (transfer to guide or
rewrite)
- Talk about encrypting results in use-iapp (link in outputs, iapp generator...)
- Rework src\get-started\protocol\oracle.md (transfer to guide or rewrite)
- Talk about iApp secret
- Improve Guide in build-iapp section - be more clear for builder ( how to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ to use some confidential data to get the full potential of the **Confidential
Computing** paradigm. Check out next chapters to see how:

- [Access confidential assets from your iApp](access-confidential-assets.md)
- [Protect the result](/guides/build-iapp/advanced/protect-the-result.md)

<script setup>
import { computed } from 'vue';
Expand Down
156 changes: 0 additions & 156 deletions src/guides/build-iapp/advanced/protect-the-result.md

This file was deleted.

2 changes: 0 additions & 2 deletions src/guides/build-iapp/outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,3 @@ Continue building with these guides:
Control who can use your iApp
- **[Debugging Your iApp](/guides/build-iapp/debugging)** - Troubleshoot
execution issues
- **[How to Get and Decrypt Results](/guides/use-iapp/getting-started)** -
User-side result handling
137 changes: 137 additions & 0 deletions src/guides/use-iapp/run-iapp-without-ProtectedData.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,140 @@
workerpoolorder: workerpoolOrders.orders[0].order,
});
```

## 🔐 Encrypt Results (Advanced)

Check notice on line 204 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L204

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 204, "column": 22}}}, "severity": "INFO"}

::: info

DataProtector handles encryption automatically If you're using DataProtector,
result encryption is handled automatically. This section is only needed for

Check notice on line 209 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L209

[Google.Passive] In general, use active voice instead of passive voice ('is handled').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is handled').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 209, "column": 19}}}, "severity": "INFO"}
manual encryption when not using DataProtector.

:::

Secure your outputs with end‑to‑end encryption so only you (the beneficiary) can

Check notice on line 214 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L214

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 214, "column": 60}}}, "severity": "INFO"}
read them. Results leave the enclave and may traverse untrusted storage and
networks; encryption ensures nobody else (operators, storage providers,

Check notice on line 216 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L216

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 216, "column": 9}}}, "severity": "INFO"}
intermediaries) can access the content.

### 1) Generate your encryption key pair

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;

Check warning on line 222 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L222

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 222, "column": 12}}}, "severity": "WARNING"}

Check notice on line 222 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L222

[Google.Passive] In general, use active voice instead of passive voice ('be used').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be used').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 222, "column": 17}}}, "severity": "INFO"}

Check notice on line 222 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L222

[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 222, "column": 36}}}, "severity": "INFO"}

Check notice on line 222 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L222

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 222, "column": 78}}}, "severity": "INFO"}
the private key stays with the beneficiary to decrypt them locally.

Run from your iExec project directory:

```bash
iexec result generate-encryption-keypair
```

This creates two files in `.secrets/beneficiary/`:

```
.secrets/
└─ beneficiary/
├─ <0x-your-wallet-address>_key # PRIVATE KEY (keep safe)
└─ <0x-your-wallet-address>_key.pub # PUBLIC KEY
```

Back up the private key securely. You will only need it locally to decrypt

Check warning on line 240 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L240

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 240, "column": 39}}}, "severity": "WARNING"}
results.

### 2) Push your public key to the SMS

Check warning on line 243 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L243

[Google.Headings] '2) Push your public key to the SMS' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '2) Push your public key to the SMS' should use sentence-style capitalization.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 243, "column": 5}}}, "severity": "WARNING"}

Check notice on line 243 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L243

[Google.Acronyms] Spell out 'SMS', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'SMS', if it's unfamiliar to the audience.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 243, "column": 36}}}, "severity": "INFO"}

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

Check notice on line 246 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L246

[Google.Contractions] Use 'can't' instead of 'cannot'.
Raw output
{"message": "[Google.Contractions] Use 'can't' instead of 'cannot'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 246, "column": 55}}}, "severity": "INFO"}
you.

Make the public key available to TEEs at runtime:

```bash
iexec result push-encryption-key --tee-framework scone
```

Verify it:

```bash
iexec result check-encryption-key --tee-framework scone
```

### 3) Run the iApp with encrypted results

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

Check notice on line 264 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L264

[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 264, "column": 74}}}, "severity": "INFO"}
unreadable to others.

Trigger a task and request encrypted outputs:

```bash
iexec app run <0x-app-address> \
--workerpool <0x-workerpool-address> \
--tag tee,scone \
--encrypt-result \
--watch
```

When completed, download the results archive:

```bash
iexec task show <0x-task-id> --download
```

Inside the archive, `iexec_out/result.zip.aes` is encrypted.

Check notice on line 283 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L283

[Google.Passive] In general, use active voice instead of passive voice ('is encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is encrypted').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 283, "column": 48}}}, "severity": "INFO"}

Note: Results are encrypted for the task beneficiary. Ensure the beneficiary

Check warning on line 285 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L285

[Google.Colons] ': R' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': R' should be in lowercase.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 285, "column": 5}}}, "severity": "WARNING"}

Check notice on line 285 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L285

[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 285, "column": 15}}}, "severity": "INFO"}
address is yours to be able to decrypt the archive.

If you extract the archive and try to read the encrypted file, you'll see
unreadable content:

```bash
mkdir /tmp/trash && \
unzip <0x-your-task-id>.zip -d /tmp/trash && \
cat /tmp/trash/iexec_out/result.zip.aes
```

The output will look like:

Check warning on line 297 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L297

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 297, "column": 12}}}, "severity": "WARNING"}

```bash
)3XqYvzEfRu<\ݵmm疞rc(a{{'ܼ͛q/[{hgD$g\.kj"s?"hJ_Q41_[{XԚa蘟vEr肽
Յ]9WTL*tdzO`!e&snoL3K6L9%
```

This confirms the results are properly encrypted and unreadable without the
private key.

### 4) Decrypt results locally

Check warning on line 307 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L307

[Google.Headings] '4) Decrypt results locally' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '4) Decrypt results locally' should use sentence-style capitalization.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 307, "column": 5}}}, "severity": "WARNING"}

Results are encrypted end‑to‑end; only your private key can decrypt them. This

Check notice on line 309 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L309

[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 309, "column": 9}}}, "severity": "INFO"}

Check notice on line 309 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L309

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 309, "column": 33}}}, "severity": "INFO"}
step restores the plaintext so you can use the output files.

Check failure on line 310 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L310

[Vale.Spelling] Did you really mean 'plaintext'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'plaintext'?", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 310, "column": 19}}}, "severity": "ERROR"}

Use your private key generated in step 1:

```bash
iexec result decrypt iexec_out/result.zip.aes
```

This produces `results.zip`. Extract it to view plaintext outputs:

Check failure on line 318 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L318

[Vale.Spelling] Did you really mean 'plaintext'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'plaintext'?", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 318, "column": 49}}}, "severity": "ERROR"}

```bash
unzip results.zip -d my-decrypted-result
```

And you can see the content of your result file:

```bash
$ cat my-decrypted-result/result.txt
Hello, world!
```

Your results are now decrypted and ready to use.

### Notes and tips

- Keep the private key offline and backed up.
- You can rotate keys by re-running generation and push steps; old tasks remain
decryptable with the old private key.

Check failure on line 337 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L337

[Vale.Spelling] Did you really mean 'decryptable'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'decryptable'?", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 337, "column": 3}}}, "severity": "ERROR"}
- iApp code does not need changes to enable result encryption; it is enforced by

Check notice on line 338 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L338

[Google.Contractions] Use 'doesn't' instead of 'does not'.
Raw output
{"message": "[Google.Contractions] Use 'doesn't' instead of 'does not'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 338, "column": 13}}}, "severity": "INFO"}

Check notice on line 338 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L338

[Google.Contractions] Use 'it's' instead of 'it is'.
Raw output
{"message": "[Google.Contractions] Use 'it's' instead of 'it is'.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 338, "column": 64}}}, "severity": "INFO"}

Check notice on line 338 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L338

[Google.Passive] In general, use active voice instead of passive voice ('is enforced').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is enforced').", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 338, "column": 67}}}, "severity": "INFO"}
the TEE using the public key from SMS.

Check notice on line 339 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L339

[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'TEE', if it's unfamiliar to the audience.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 339, "column": 7}}}, "severity": "INFO"}

Check notice on line 339 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L339

[Google.Acronyms] Spell out 'SMS', if it's unfamiliar to the audience.
Raw output
{"message": "[Google.Acronyms] Spell out 'SMS', if it's unfamiliar to the audience.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 339, "column": 37}}}, "severity": "INFO"}