encrypt()
Othent JS SDK encrypt() function
Last updated
Othent JS SDK encrypt() function
Last updated
The encrypt()
function encrypts the data using the active user's private key so that, when stored on Arweave, it is only accessible to that specific user, similarly to the .
This is useful for applications such as private file storage apps or mail/messaging platforms.
Limitation: There's currently an 8KB limit in data size when using Othent, but this is currently being worked on. Track the progress on this .
Limitation: Also, the only currently available encryption/decryption algorithm is AES (AES256-GCM
).
This function assumes (and requires) a user is authenticated. See .
plaintext: string | BinaryDataType
The data to be encrypted with the user's private key, which can be of type string
, , or .
return Promise<Uint8Array>
A Promise
containing the encrypted data as .