ArweaveKit Docs
  • ArweaveKit
    • Introduction
  • 🔐Wallets
    • Introduction to Wallets
    • Create Wallet
    • Get Wallet Address
    • Get Wallet Balance
    • Wallet Plugins
  • 💳ARWEAVE WALLET KIT
    • Introduction to Arweave Wallet Kit
    • Setup
    • Connect Button
    • Hooks
    • Customization
  • 🏦Transactions
    • Introduction to Transactions
    • Create Transaction
    • Sign Transaction
    • Post Transaction
    • Get Transaction Status
    • Get Transaction
    • Create and Post Transaction with Othent
    • Transaction Plugins
  • 📄SMART CONTRACTS
    • Introduction to Smart Contracts
    • Create Contract
    • Write Contract
    • Read Contract State
    • View Contract State
    • Write Contract with Othent
    • Read Contract with Othent
    • Smart Contract Plugins
  • ✅AUTH
    • Introduction to Auth
    • Connect
    • Disconnect
    • Get Active Address
    • Get Permissions
    • Get Wallet Names
    • Get All Addresses
    • Get Active Public Key
    • Is Installed
    • Log In with Othent
    • Log Out with Othent
    • Get User Details with Othent
    • Auth Plugins
  • 🔐Encryption
    • Introduction to Encryption
    • Encrypt Data with AES
    • Decrypt Data with AES
    • Encrypt AES Key with RSA
    • Decrypt AES Key with RSA
    • Encryption Plugins
  • 🌐GRAPHQL
    • Introduction to GraphQL
    • Query All Arweave Transactions
    • Query Arweave Data
    • Query Arweave Transactions
    • GraphQL Plugins
  • 🗺️RoadMap
    • Features
  • 📘REFERENCES
    • ArweaveKit in Browser Environments
  • 🛠️SUPPORTING TOOLS
    • Arweave StarterKit
Powered by GitBook
On this page
  • Basic Syntax
  • Input Parameters
  • Returned Data

Was this helpful?

  1. Encryption

Decrypt Data with AES

Decrypt Data with the Advanced Encryption Standard (AES)

PreviousEncrypt Data with AESNextEncrypt AES Key with RSA

Last updated 4 months ago

Was this helpful?

The decryptDataWithAES performs symmetric encryption using the , specifically the Galois/ Counter Mode (GCM).

The AES key and the random initialized vector (iv) used at the time of encryption are needed to decrypt the data.

The iv is part of the combinedArrayBuffer returned as the encrypted data from the encryptDataWithAES function. The decryptDataWithAES functions splits this into the iv and actual encryptedData on the backend before decrypting the latter.

Basic Syntax

The function is called as follows:

import { decryptDataWithAES } from 'arweavekit/encryption';

const decryptedDataObject = await decryptDataWithAES({params});

Input Parameters

The following params are available for this function and they must be passed in as an object:

  • data: ArrayBuffer : The combination of the random initialized vector prepended to the encrypted data as an ArrayBuffer generated at the time of encryption.

  • key: string : The encryption key generated at the time of data encryption using AES-GCM and used for encrypting the data.

Example
const decryptedDataObject = await decryptDataWithAES({
    data: ArrayBuffer,
    key: string,
});

This encrypts the provided ArrayBuffer using the AES-GCM encryption method.

Returned Data

The function call returns the following data:

decryptedData: ArrayBuffer
  • decryptedData: ArrayBuffer : The decrypted data returned as an ArrayBuffer.

🔐
Advanced Encryption Standard (AES)