Initialises the context with the key, direction and mode ready for repeated operations of the TDEA function. The key and IV data are provided in byte arrays.
Public Declare Function TDEA_Init Lib "diCryptoSys.dll" (ByRef lpKey As Byte, ByVal fEncrypt As Integer, ByVal strMode As String, ByRef lpIV As Byte) As Long
hContext = TDEA_Init(lpKey(0), bEncrypt, strMode, lpIV(0))
long __stdcall TDEA_Init(const unsigned char *lpKey, int fEncrypt, const char *szMode, const unsigned char *lpIV);
Non-zero handle of the context hContext
to be used in subsequent calls to the functions
TDEA_Update
, TDEA_UpdateHex
or TDEA_Final
.
Returns zero if an error occurs.
Tdea.InitEncrypt Method (Byte[], Mode, Byte[])
Tdea.InitDecrypt Method (Byte[], Mode, Byte[])
The key lpKey must be exactly 24 bytes long and the IV, if required, exactly 8 bytes long.
Unlike most other functions in this API, TDEA_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 a TDEA function.
See TDEA_Update
.
TDEA_InitHex
TDEA_UpdateHex
TDEA_Update
TDEA_Final