CryptoSys API Library Manual
Aead.Decrypt Method
Decrypt and authenticate input using specified AEAD algorithm in one-off operation
Syntax
[C#]
public static byte[] Decrypt(
byte[] input,
byte[] key,
byte[] nonce,
byte[] aad,
byte[] tag,
Aead.Algorithm alg
)
[VB.NET]
Public Shared Function Decrypt ( _
input As Byte(), _
key As Byte(), _
nonce As Byte(), _
aad As Byte(), _
tag As Byte(), _
alg As Aead.Algorithm _
) As Byte()
Parameters
- input
- Cipher text input data (required)
- key
- Key of exact length for given algorithm (16 or 32 bytes).
- nonce
- Nonce of exact length for given algorithm (currently always 12 bytes).
- aad
- Additional authentication data (optional). Pass null/Nothing to ignore.
- tag
- Tag value (required)
- alg
- Type: Aead.Algorithm
AEAD algorithm to use
Return Value
Decrypted plaintext in byte array, or empty array on error
Remarks
Use General.ErrorCode to find the code of the last error. The plaintext is always the same length as the ciphertext. The tag must be input separately.
See Also
VB6/C equivalent: AEAD_Decrypt
[Contents] [Index]