CryptoSys PKI Pro Manual

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

Decrypt a file passing key and IV as hex strings.

Syntax

[C#]
public static int FileDecrypt(
   string fileOut,
   string fileIn,
   string keyHex,
   string ivHex,
   CipherAlgorithm cipherAlg,
   Mode mode,
   Padding pad = Padding.Default,
   Cipher.Opts opts = Cipher.Opts.Default 
)
[VB]
Public Shared Function FileDecrypt (
   fileOut As String,
   fileIn 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 Integer

Parameters

fileOut  String
Name of output file to be created or overwritten
fileIn  String
Name of input file, in binary format.
keyHex  String
Hex-encoded key of exact length
ivHex  String
Hex-encoded IV, or "" for ECB mode or if IV is prefixed.
cipherAlg  CipherAlgorithm
Cipher Algorithm
mode  Mode
Cipher Mode
pad  Padding  (Optional)
Padding method to use (optional, ECB and CBC modes only, default=Pkcs5)
opts  Cipher.Opts  (Optional)
Advanced options. Use Cipher.Opts.PrefixIV to expect the IV to be prepended to the input.

Return Value

Int32
0 if successful or non-zero error code

Remarks

fileOut and fileIn must not be the same. The output file is in binary format.

See Also

VB6/C equivalent: CIPHER_FileDecrypt

[Contents] [Index]

[PREV: Cipher.FileDecrypt(String, String, Byte, Byte, CipherAlgorithm, Mode, Padding, Cipher.Opts) Method...]   [Contents]   [Index]   
   [NEXT: Cipher.FileEncrypt(String, String, Byte, Byte, CipherAlgorithm, Mode, Padding, Cipher.Opts) Method...]

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