CryptoSys PKI Pro Manual

cipherEncryptHex

Encrypt hex-encoded data using the specified block cipher algorithm, mode and padding. The key and initialization vector are passed as hex-encoded strings.

Syntax

[VBA]
Public Function cipherEncryptHex ( _
    szInputHex As String, _
    szKeyHex As String, _
    szIvHex As String, _
    szAlgModePad As String, _
    Optional nOptions As Long = 0 _
) As String

Parameters

szInputHex
Input data to be encrypted.
szKeyHex
Hex-encoded key of exact key length.
szIvHex
Hex-encoded IV of exact required length or "" for ECB mode.
szAlgModePad
String with block cipher algorithm, mode and padding, e.g. "aes128/cbc/pkcs5"
Alg:  aes128|aes192|aes256|tdea|3des|desede3
Mode: ecb|cbc|ofb|cfb|ctr|gcm
Pad:  pkcs5|nopad|oneandzeroes|ansix923|w3c
nOptions
Add PKI_IV_PREFIX to prepend the IV before the ciphertext in the output (ignored for ECB mode).

Return Value

String: Encrypted ciphertext in hex-encoded string or empty string on error.

Remarks

Input data may be any even number of hex characters, but not zero. Default padding is Pkcs5 for ECB and CBC mode and NoPad for all other modes. GCM mode is only available with AES. The IV must be exactly 12 bytes long for GCM.
[PREV: cipherEncryptBytes...]   [Contents]   [Index]   
   [NEXT: cipherFileDecrypt...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.