Skip to main content
If you are here to see how auth context is consumed here, jump to Decrypt.

Prerequisites

  • authContext is required. This is the result from the authentication flow.

Installation

Example Walkthrough

๐Ÿ” Encrypt & Decrypt Flow Alice can encrypt without authentication, Bob must authenticate to decrypt.
  • Alice: Encrypts โ†’ No AuthContext needed
  • Bob: Decrypts โ†’ Requires AuthContext

๐Ÿ‘ฉ๐Ÿผ Alice

Alice encrypts data without needing authentication

Create Aliceโ€™s Account

Generate Aliceโ€™s account using a random private key. Alice only needs an account for encryption - no authentication required.

๐Ÿง”๐Ÿปโ€โ™‚๏ธ Bob

Bob needs authentication to decrypt data

Create Bobโ€™s Account

Generate Bobโ€™s account using a random private key. Bob will need this account for authentication to decrypt data.

๐Ÿ‘ฉ๐Ÿผ Alice Defines Access Rules

Alice decides who can decrypt her encrypted data
See SDK Reference for more details on the Access Control Conditions Builder. Access Control Conditions Builder Reference

Build Access Control Conditions

Alice defines who can decrypt the encrypted data using official access control conditions builder. These conditions reference Bobโ€™s wallet address and will be checked during decryption.

๐Ÿง”๐Ÿปโ€โ™‚๏ธ Bob

Prepares for Decryption

Bob creates authentication context to prove he meets access conditions

๐Ÿ‘ฉ๐Ÿผ Alice

Prepares Data

Alice configures and encrypts the data with access control conditions

๐Ÿง”๐Ÿปโ€โ™‚๏ธ Bob

Decrypts Data

Bob uses his authentication context to decrypt Aliceโ€™s data