tuweni / org.apache.tuweni.crypto.sodium / Box / encrypt

encrypt

fun encrypt(message: Bytes!, nonce: Nonce!): Bytes! (source)

Encrypt a message for a given key.

Parameters

message - Bytes!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

fun encrypt(message: ByteArray!, nonce: Nonce!): ByteArray! (source)

Encrypt a message for a given key.

Parameters

message - ByteArray!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
ByteArray!: The encrypted data.

static fun encrypt(message: Bytes!, receiver: PublicKey!, sender: SecretKey!, nonce: Nonce!): Bytes! (source)

Encrypt a message for a given key.

Parameters

message - Bytes!: The message to encrypt.

receiver - PublicKey!: The public key of the receiver.

sender - SecretKey!: The secret key of the sender.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

static fun encrypt(message: ByteArray!, receiver: PublicKey!, sender: SecretKey!, nonce: Nonce!): ByteArray! (source)

Encrypt a message for a given key.

Parameters

message - ByteArray!: The message to encrypt.

receiver - PublicKey!: The public key of the receiver.

sender - SecretKey!: The secret key of the sender.

nonce - Nonce!: A unique nonce.

Return
ByteArray!: The encrypted data.