Click or drag to resize

CipherEncryptAEAD(Byte, Byte, Byte, Byte, AeadAlgorithm, CipherOpts) Method

Encrypt data using the AES-GCM authenticated encryption algorithm with AAD and options.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static byte[] EncryptAEAD(
	byte[] input,
	byte[] key,
	byte[] iv,
	byte[] aad,
	AeadAlgorithm aeadAlg,
	CipherOpts opts
)

Parameters

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