Initialises the context with the key, direction and mode
ready for repeated
operations of the BLF_Update
or BLF_UpdateHex
functions.
The key and IV data are provided in byte arrays.
Public Declare Function BLF_Init Lib "diCryptoSys.dll"
(ByRef lpKey As Byte, ByVal nKeyLen As Long, ByVal bEncrypt As Boolean,
ByVal strMode As String, ByRef lpInitV As Byte) As Long
hContext = BLF_Init(abKey(0), nKeyLen, bEncrypt, strMode, abInitV(0))
long __stdcall BLF_Init(const unsigned char *lpKey, long keyBytes, 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
BLF_Update
, BLF_UpdateHex
or BLF_Final
.
Returns zero if an error occurs.
Blowfish.InitEncrypt Method (Byte[], Mode, Byte[])
Blowfish.InitDecrypt Method (Byte[], Mode, Byte[])
The initialization vector
byte array lpInitV must be exactly the block size of 8 bytes long,
except for ECB mode, where it is ignored (use 0
).
The key array lpKey can be any length between 1 and 56 bytes (448 bits).
Unlike most other functions in this API, BLF_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 BLF_Update
or BLF_UpdateHex
.
See BLF_Update
.
BLF_InitHex
BLF_UpdateHex
BLF_Update
BLF_Final