Encrypt input using AES-GCM in one-off operation
Namespace: CryptoSysAPIAssembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntaxpublic static byte[] Encrypt(
out byte[] tag,
byte[] input,
byte[] key,
byte[] iv,
byte[] aad
)
Public Shared Function Encrypt (
<OutAttribute> ByRef tag As Byte(),
input As Byte(),
key As Byte(),
iv As Byte(),
aad As Byte()
) As Byte()
Parameters
- tag Byte
- To receive the output authentication tag value.
Always returned exactly 16 bytes long. You may truncate as desired.
This is a by-reference parameter. There is no need to initialize (but the VB compiler may complain).
- input Byte
- Plain text input data
- key Byte
- Key: must be exactly 16, 24 or 32 bytes long.
- iv Byte
- Initialization vector: can be any length but 12 bytes is recommended.
- aad Byte
- Additional authentication data (optional). Pass null/Nothing to ignore.
Return Value
ByteEncrypted ciphertext in byte array, or empty array on error
Remarks
See Also