encrypt

fun encrypt(algorithm: Algorithm, key: ByteArray, nonce: ByteArray, messagePlaintext: ByteArray, aad: ByteArray? = null): ByteArray

Message encryption.

Return

the cipher text with the tag appended to it.

Parameters

key

the encryption key.

nonce

the nonce/IV.

messagePlaintext

the message to encrypt.

Throws

if the given algorithm is not supported.