Click or drag to resize

CipherFileEncrypt(String, String, String, String, CipherAlgorithm, Mode, Padding, CipherOpts) Method

Encrypt a file passing key and IV as hex strings.

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	string keyHex,
	string ivHex,
	CipherAlgorithm cipherAlg,
	Mode mode,
	Padding pad = Padding.Default,
	CipherOpts opts = CipherOpts.Default
)

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
cipherAlg  CipherAlgorithm
Cipher Algorithm
mode  Mode
Cipher Mode
pad  Padding  (Optional)
Padding method to use (optional, ECB and CBC modes only, default=Pkcs5)
opts  CipherOpts  (Optional)
Advanced options. Use Cipher.Opts.PrefixIV to prepend the IV to the output.

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