Click or drag to resize

AeadDecryptWithTag(Byte, Byte, Byte, AeadAlgorithm) Method

Decrypt data using specified AEAD algorithm in one-off operation. The authentication tag is expected to be appended to the input ciphertext.

Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntax
public static byte[] DecryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	AeadAlgorithm aeadAlg
)

Parameters

input  Byte
Input data to be decrypted.
key  Byte
Key of exact length for algorithm (16 or 32 bytes).
iv  Byte
Initialization Vector (IV) (aka nonce) (12 or 16 bytes).
aeadAlg  AeadAlgorithm
Authenticated encryption algorithm.

Return Value

Byte
Plaintext in a byte array, or empty array on error (an empty array may also be the correct result - check General.ErrorCode for details).
Remarks
The input must include the 16-byte tag appended to the ciphertext. The output will be exactly 16 bytes shorter than the input. In all cases the tag must be exactly 16 bytes (128 bits). The IV must be 16 bytes (128 bits) for ASCON-128 otherwise 12 bytes (96 bits).
See Also