CryptoSys API Library Manual

Aead.DecryptWithTag Method (Byte[], Byte[], Byte[], Aead.Algorithm)

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

Syntax

[C#]
public static byte[] DecryptWithTag(
	byte[] input,
	byte[] key,
	byte[] iv,
	Aead.Algorithm aeadAlg
)
[VB.NET]
Public Shared Function DecryptWithTag ( _
	input As Byte(), _
	key As Byte(), _
	iv As Byte(), _
	aeadAlg As Aead.Algorithm _
) As Byte()

Parameters

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

Return Value

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

VB6/C equivalent: AEAD_DecryptWithTag

[Contents] [Index]

[PREV: Aead.Decrypt Method...]   [Contents]   [Index]   
   [NEXT: Aead.DecryptWithTag Method (Byte, Byte, Byte, Byte, Aead.Algorithm, Aead.Opts)...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.