TDEA_InitHex 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 hexadecimal format.
Public Declare Function TDEA_InitHex Lib "diCryptoSys.dll"
(ByVal strHexKey As String, ByVal bEncrypt As Boolean,
ByVal strMode As String, ByVal strHexIV As String) As Long
hContext = TDEA_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 TDEA_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
TDEA_Update, TDEA_UpdateHex or TDEA_Final.
Returns zero if an error occurs.
Tdea.InitEncrypt Method (String, Mode, String)
Tdea.InitDecrypt Method (String, Mode, String)
The key string strHexKey
must be exactly 48 hex characters long (i.e. representing exactly 24 bytes/192 bits).
The initialization vector strHexIV
must be exactly 16 hex characters long (i.e. representing exactly the block size of 8 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, TDEA_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 a TDEA function.
See TDEA_UpdateHex.
TDEA_Init
TDEA_UpdateHex
TDEA_Update
TDEA_Final