CryptoSys PKI Pro Manual

cipherDecryptBytes

Decrypts data in a byte array using the specified block cipher algorithm, mode and padding. The key and initialization vector are passed as byte arrays.

Syntax

[VBA]
Public Function cipherDecryptBytes ( _
    lpInput() As Byte, _
    lpKey() As Byte, _
    lpIV() As Byte, _
    szAlgModePad As String, _
    Optional nOptions As Long = 0 _
) As Byte()

Parameters

lpInput
Input data to be decrypted.
lpKey
Key of exact length for block cipher algorithm.
lpIV
Initialization Vector (IV) of required size (if not provided in input) or empty array 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 expect the IV to be prepended at the start of the input (ignored for ECB mode).

Return Value

Byte(): Decrypted plaintext in byte array or empty array on error.

Remarks

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: cipherDecryptAEAD...]   [Contents]   [Index]   
   [NEXT: cipherDecryptHex...]

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