CryptoSys PKI Pro Manual

Cipher.Decrypt(String, String, String, CipherAlgorithm, Mode, Padding, Cipher.Opts) Method

Decrypt hex-encoded data using specified block cipher algorithm, mode and padding.

Syntax

[C#]
public static string Decrypt(
   string inputHex,
   string keyHex,
   string ivHex,
   CipherAlgorithm cipherAlg,
   Mode mode,
   Padding pad = Padding.Default,
   Cipher.Opts opts = Cipher.Opts.Default 
)
[VB]
Public Shared Function Decrypt (
   inputHex As String,
   keyHex As String,
   ivHex As String,
   cipherAlg As CipherAlgorithm,
   mode As Mode,
   Optional pad As Padding = Padding.Default,
   Optional opts As Cipher.Opts = Cipher.Opts.Default 
) As String

Parameters

inputHex  String
Hex-encoded input data
keyHex  String
Hex-encoded key representing exact key length
ivHex  String
Hex-encoded IV representing exact block length, or "" for ECB mode or if IV is prefixed.
cipherAlg  CipherAlgorithm
Cipher Algorithm
mode  Mode
Cipher Mode
pad  Padding  (Optional)
Padding method to use
opts  Cipher.Opts  (Optional)
Advanced options. Use Cipher.Opts.PrefixIV to expect the IV to be prepended to the input.

Return Value

String
Decrypted plaintex 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.

See Also

VB6/C equivalent: CIPHER_DecryptHex

[Contents] [Index]

[PREV: Cipher.Decrypt(String, String, String, CipherAlgorithm, Mode) Method...]   [Contents]   [Index]   
   [NEXT: Cipher.DecryptAEAD(Byte, Byte, Byte, AeadAlgorithm) Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.