Function encryptData

  • Encrypts arbitrary data for P2P message/data exchange using asymmetric encryption

    Parameters

    • plaintext: Uint8Array

      Data to be encrypted

    • recipientPublicKeyHex: string

      The recipients public key in hexadecimal format

    • senderPrivateKeyHex: string

      The senders private (agreement) key hexadecimal format

    Returns Promise<EncryptedData>

    The encrypted Data