cipherEncryptAEAD
Encrypt data using Authenticated Encryption with Associated Data (AEAD).
Syntax
[VBA]
Public Function cipherEncryptAEAD ( _
lpInput() As Byte, _
lpKey() As Byte, _
lpIV() As Byte, _
lpAAD() As Byte, _
nOptions As Long _
) As Byte()
Parameters
- lpInput
- Byte array containing the input data.
- lpKey
- Key of exact length for algorithm (16, 24 or 32 bytes).
- lpIV
- Initialization Vector (IV) (aka nonce) exactly 12 bytes long.
- lpAAD
- Additional authenticated data (optional) - set as empty array to ignore.
- nOptions
- Algorithm to be used. Select one from
PKI_AEAD_AES_128_GCM
PKI_AEAD_AES_192_GCM
PKI_AEAD_AES_256_GCM
PKI_AEAD_CHACHA20_POLY1305
and optionally add PKI_IV_PREFIX
to prepend the IV (nonce) before the ciphertext in the output.
Return Value
Byte(): Ciphertext with tag appended in a byte array, or empty array on error.
Remarks
The output will either be exactly 16 bytes longer than the input, or exactly 28 bytes longer if API_IV_PREFIX is used.