CryptoSys API Library Manual

CIPHER_InitHex

Initialize the CIPHER context with hex-encoded key, iv, algorithm and mode ready for repeated update operations. The key and IV data are passed as hexadecimal-encoded strings.

VBA/VB6 Syntax

Public Declare Function CIPHER_InitHex Lib "diCryptoSys.dll" (ByVal fEncrypt As Integer, ByVal strAlgAndMode As String, ByVal strKeyHex As String, ByVal strIvHex As String, ByVal nOptions As Long) As Long

hContext = CIPHER_InitHex(fEncrypt, strAlgAndMode, strKeyHex, strIvHex, nOptions)

C/C++ Syntax

long __stdcall CIPHER_InitHex(int fEncrypt, const char *szAlgAndMode, const char *szKeyHex, const char *szIvHex, long nOptions);

Parameters

fEncrypt
[in] Direction flag: set as ENCRYPT (True) to encrypt or DECRYPT (False) to decrypt.
szAlgAndMode
[in] String specifying the block cipher algorithm and mode, e.g. "aes128/cbc" (see Specifying the algorithm and mode for generic block cipher functions).
szKeyHex
[in] Hex-encoded key of exact length for block cipher algorithm.
szIvHex
[in] Hex-encoded Initialization Vector (IV) of exactly the block size, or "" for ECB mode.
nOptions
[in] Option flags: zero (0) for default options.

Returns (VBA/C)

Non-zero handle of the CIPHER context, or zero if an error occurs.

.NET Equivalent

Cipher.InitEncrypt Method (String, String, CipherAlgorithm, Mode)
Cipher.InitDecrypt Method (String, String, CipherAlgorithm, Mode)

Remarks

This function is the equivalent of CIPHER_Init except it passes the key and IV parameters as hexadecimal-encoded strings.

Example

See CIPHER_UpdateHex.

See Also

CIPHER_Init

[Contents] [Index]

[PREV: CIPHER_Init...]   [Contents]   [Index]   
   [NEXT: CIPHER_KeyUnwrap...]

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