Skip to content

🛡️ Let's protect data

Reading time: 6 minutes

Time to get practical

Let's follow Alice as she learns how to protect her data using DataProtector on Bob's dApp, our developer tool for protecting data creation and management.

Protected data is encrypted data that remains confidential throughout its entire lifecycle - during storage, transfer and processing.

🧩 DataProtector, key features

DataProtector is a developer tool built on top of our technology. It helps developers easily add data protection, management, and monetization features to their dApps with these key features:

🔐 Data Privacy and Security

Utilizes end-to-end encryption and decentralized storage (IPFS) to ensure protection and confidentiality, leveraging advanced confidential computing technology.

🎮 Dynamic Access Management

Allows users to manage access, enabling flexible control and monetization of data assets.

🔌 Seamless dApp Integration

Features an SDK for easy integration into your DApp, enhancing functionality and user experience.

DataProtector interacts with iExec's Bellecour sidechain, which is gasless, meaning you can use it completely free without needing any tokens!

🧩 Let's create protected data

Connect Your Wallet (iExec network) :

You will sign three things:

  1. A transaction to create the protected data
  2. A message signature to prove your identity to the production SMS
  3. A message signature to prove your identity to the debug SMS (this signature is only required during this Hello World tutorial)

🧩 What happened under the hood

You won't believe how easy it is to protect your data with DataProtector. Just a few lines of code, and you're done!

To use it, simply call the protectData method from the DataProtector SDK with two arguments.

  • The data object to be protected (can contain text, files, JSON data etc.)
  • The name of the protected data
ts
const { 
address
:
protectedDataAddress
} = await
dataProtectorCore
.
protectData
({
name
: 'myEmail',
data
: {
email
: 'example@gmail.com',
}, });

For this tutorial, you can try out the code directly in our interactive CodeSandbox demo here. Here's a quick overview of what happened when you clicked the Protect Data button:

alt text

1The DataProtector SDK is called
2The data is encrypted with a symmetric key
3The encrypted data is stored on IPFS
4The symmetric key is stored in a secure enclave (TEE) in the Secret Management Service
5The DataProtector smart contract is used to establish data ownership as an NFT
6The protected data address is returned to the user

🧩 How to install and use DataProtector

Decentralized confidential computing might sound complex, but we've made it simple through our developer tools.

1. Install the Developer Tool

Run the install command:

sh
npm install @iexec/dataprotector

2. Import and Initialize it in your project

Import the tool
ts
import { 
Address
,
IExecDataProtector
} from '@iexec/dataprotector';

Create a new instance and call the methods you need

ts
const { 
address
:
protectedDataAddress
} = await
dataProtectorCore
.
protectData
({
name
: 'myEmail',
data
: {
email
: 'example@gmail.com',
}, });

Check out our code sandbox for ready-to-use examples!

🎯 Key takeaways

🔒

DataProtector ensures data protection, management, and confidentiality

📦

Protected Data is encrypted and stored on decentralized storage

⛓️

Ownership is stored on the blockchain and linked to your wallet

🔌

Integration is simple with our developer tools

In the next chapter, we'll show you how to build, deploy, and run an iApp to process your protected data. Let's go! 🚀