Hub JS Package

Hub JS Package

  • Users
  • Buckets
  • Threads
  • Textile Docs

@textile/hub > encrypt

encrypt() function

Encrypts the given data using a Curve25519 variant of the public key.

The encryption uses an ephemeral private key, which is prepended to the ciphertext, along with a nonce of random bytes.

Signature:

export declare function encrypt(data: Uint8Array, pubKey: Uint8Array, type?: string): Promise<Uint8Array>;

Parameters

ParameterTypeDescription
dataUint8ArrayData to encrypt.
pubKeyUint8Array
typestring

Returns:

Promise<Uint8Array>

  • encrypt() function
  • Parameters
Hub JS Package
Docs
Getting StartedThreadDBBuckets
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @textileio