CryptoSys API Library Manual
cipherInit
Initializes the CIPHER context with the key, algorithm and mode ready for repeated incremental operations.
Syntax
[VBA]
Public Function cipherInit ( _
fEncrypt As Integer, _
szAlgAndMode As String, _
lpKey() As Byte, _
lpIV() As Byte, _
Optional nOptions As Long = 0 _
) As Long
Parameters
- fEncrypt
- Direction flag: set as
ENCRYPT
(True) to encrypt or DECRYPT
(False) to decrypt.
- szAlgAndMode
- String with block cipher algorithm and mode, e.g.
"aes128/cbc"
- lpKey
- Key of exact length for block cipher algorithm.
- lpIV
- Initialization Vector (IV) of exactly the block size or empty array for ECB mode.
- nOptions
- Option flags, set as zero for defaults.
Return Value
Long: Nonzero handle of the CIPHER context, or zero if an error occurs.