AES256_InitHex initialises the context with the key, direction and mode
ready for repeated
operations of the AES function.
The key and IV data are passed in hexadecimal format.
Public Declare Function AES256_InitHex Lib "diCryptoSys.dll"
(ByVal strHexKey As String,
ByVal bEncrypt As Boolean,
ByVal strMode As String, ByVal strHexIV As String) As Long
hContext = AES256_InitHex(strHexKey, bEncrypt, strMode, strHexIV)
String containing the key in hexadecimal
representation.Boolean direction flag:
set as True to encrypt or False
to decrypt.String specifying the confidentiality mode:String containing the initialization vector
in hexadecimal.
long _stdcall AES256_InitHex(const char *lpszKey, int bEncrypt,
const char *lpszMode, const char *lpszIV);
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 (String, Mode, String)
Aes256.InitDecrypt Method (String, Mode, String)
The key string strHexKey
must be exactly 64 hexadecimal characters long
(i.e. representing exactly 32 bytes/256 bits).
The initialization vector strHexIV
must be exactly 32 hexadecimal characters long
(i.e. representing exactly the block size of 16 bytes), except for ECB mode, where it is ignored (use "").
Valid hexadecimal characters are [0-9A-Fa-f].
Unlike most other functions in this API, AES256_InitHex 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_UpdateHex.
AES256_Init
AES256_UpdateHex
AES256_Update
AES256_Final