Click or drag to resize

AeadEncrypt Method

Encrypt input using specified AEAD algorithm in one-off operation.

Namespace: CryptoSysAPI
Assembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntax
public static byte[] Encrypt(
	out byte[] tag,
	byte[] input,
	byte[] key,
	byte[] nonce,
	byte[] aad,
	AeadAlgorithm alg
)

Parameters

tag  Byte
To receive the output authentication tag value. Currently always returned exactly 16 bytes long. This is a by-reference parameter. There is no need to initialize (but the VB compiler may complain).
input  Byte
Plain text input data (required)
key  Byte
Key of exact length for given algorithm (16 or 32 bytes)
nonce  Byte
Nonce of exact length for given algorithm (currently always 12 bytes)
aad  Byte
Additional authentication data (optional). Pass null/Nothing to ignore.
alg  AeadAlgorithm
AEAD algorithm to use

Return Value

Byte
Encrypted ciphertext in byte array, or empty array on error
Remarks
Use General.ErrorCode to find the code of the last error. The ciphertext is always the same length as the plaintext. The authentication tag is output separately.
See Also