Encrypt
ArConnect Injected API encrypt() function
Some applications (such as private file storage apps, mail clients, messaging platforms) might want to upload content to Arweave that is encrypted and only accessible by the user via their private key. The encrypt()
function does just that: it encrypts data with the active private key and returns the encrypted bytes, similarly to the webcrypto encrypt API.
Argument | Type | Description |
---|---|---|
| The data to be encrypted with the user's private key | |
| An object specifying the algorithm to be used and any extra parameters if required |
Note: This function requires the ENCRYPT
permission.
Example usage
Old (deprecated) usage
Last updated