Function encryptMessage

  • Encrypts arbitrary message (UTF-8 compatible) for P2P message/data exchange using asymmetric encryption

    Parameters

    • plaintext: string

      Message to be encrypted

    • recipientPublicKeyHex: string

      The recipients public key hexadecimal format

    • senderPrivateKeyHex: string

      The senders private (agreement) key hexadecimal format

    Returns Promise<EncryptedMessage>

    The encrypted Message