CryptoSys API Library Manual

cipherDecryptHex

Decrypt hex-encoded data using the specified block cipher algorithm, mode and padding. The input data, key and initialization vector are all represented as hexadecimal strings.

Syntax

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

Parameters

szInputHex
Hex-encoded input data.
szKeyHex
Hex-encoded key of exact key length.
szIvHex
Hex-encoded IV of exact block length, ignored for ECB mode or if API_IV_PREFIX is used (use "").
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
Pad:  pkcs5|nopad|oneandzeroes|ansix923|w3c
nOptions
Add API_IV_PREFIX to expect the IV to be prepended before the ciphertext in the input (not applicable for ECB mode).

Return Value

String: Decrypted plaintext 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.
[PREV: cipherDecryptBytes...]   [Contents]   [Index]   
   [NEXT: cipherEncryptBytes...]

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