Click or drag to resize

AeadEncryptWithTag(Byte, Byte, Byte, Byte, AeadAlgorithm, AeadOpts) Method

Encrypt data using specified AEAD algorithm in one-off operation with AAD and options. The authentication tag is appended to the output.

Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntax
public static byte[] EncryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad,
	AeadAlgorithm aeadAlg,
	AeadOpts opts = AeadOpts.Default
)

Parameters

input  Byte
Input data to be encrypted.
key  Byte
Key of exact length for algorithm (16 or 32 bytes).
iv  Byte
Initialization Vector (IV) (aka nonce) (16 bytes for ASCON-128 else 12 bytes).
aad  Byte
Additional authenticated data (optional) - set as null to ignore.
aeadAlg  AeadAlgorithm
Authenticated encryption algorithm.
opts  AeadOpts  (Optional)
Advanced options (optional). Use Opts.PrefixIV to prepend the IV to 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 28/32 bytes longer if Aead.Opts.PrefixIV is used.
See Also