Initialises the context with the key, direction and mode ready for repeated operations of the AES function. The key and IV data are in byte arrays.
Public Declare Function AES256_Init Lib "diCryptoSys.dll"
(ByRef abKey As Byte,
ByVal bEncrypt As Boolean, ByVal strMode As String, ByRef abInitV As Byte) As Long
hContext = AES256_Init(abKey(0), bEncrypt, strMode, abInitV(0))
Byte array containing the key.Boolean direction flag:
set as True to encrypt or False
to decrypt.String specifying the confidentiality mode:Byte array containing the initialization vector,
or zero (0) for ECB mode.
long _stdcall AES256_Init(const unsigned char *key,
int bEncrypt, const char *lpszMode, const unsigned char *iv);
Long: non-zero handle of the context hContext
to be used in subsequent calls to the functions
AES256_Update, AES256_UpdateHex or AES256_Final.
Returns zero if an error occurs.
Aes256.InitEncrypt Method (Byte[], Mode, Byte[])
Aes256.InitDecrypt Method (Byte[], Mode, Byte[])
The key array abKey()
must be exactly 32 bytes long (i.e. 256 bits).
The initialization vector abInitV()
must be exactly the block size of 16 bytes long, except for ECB mode, where it is ignored (use 0).
Unlike most other functions in this API, AES256_Init returns zero if an error occurs.
It is important to check that the value of hContext returned is
not equal to zero before calling the AES Update function.
See AES256_Update.
AES256_InitHex
AES256_UpdateHex
AES256_Update
AES256_Final