CryptoSys API Library Manual

AES192_Init

Initialises the context with the key, direction and mode ready for repeated operations of the AES function. The key and IV data are in byte arrays.

VBA/VB6 Syntax

Public Declare Function AES192_Init Lib "diCryptoSys.dll" (ByRef lpKey As Byte, ByVal bEncrypt As Boolean, ByVal strMode As String, ByRef lpInitV As Byte) As Long

hContext = AES192_Init(abKey(0), bEncrypt, strMode, abInitV(0))

C/C++ Syntax

long __stdcall AES192_Init(const unsigned char *lpKey, int fEncrypt, const char *szMode, const unsigned char *lpIV);

Parameters

lpKey
[in] array containing the key.
fEncrypt
[in] direction flag: set as ENCRYPT (True) to encrypt or DECRYPT (False) to decrypt.
szMode
[in] specifying the confidentiality mode:
"ECB" for Electronic Codebook mode,
"CBC" for Cipher Block Chaining mode,
"CFB" for 128-bit Cipher Feedback mode,
"OFB" for Output Feedback mode, or
"CTR" for Counter mode.
lpIV
[in] array containing the initialization vector, or zero (0) for ECB mode.

Returns (VBA/C)

Non-zero handle of the context hContext to be used in subsequent calls to the functions AES192_Update, AES192_UpdateHex or AES192_Final. Returns zero if an error occurs.

.NET Equivalent

Aes192.InitEncrypt Method (Byte[], Mode, Byte[])
Aes192.InitDecrypt Method (Byte[], Mode, Byte[])

Remarks

The key array abKey() must be exactly 24 bytes long (i.e. 192 bits). The initialization vector abInitV() must be exactly the block size of 16 bytes long, except for ECB mode, where it is ignored (use 0). Unlike most other functions in this API, AES192_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 the AES Update function.

Example

See AES192_Update.

See Also

AES192_InitHex AES192_UpdateHex AES192_Update AES192_Final

[Contents] [Index]

[PREV: AES192_HexMode...]   [Contents]   [Index]   
   [NEXT: AES192_InitError...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.