CryptoSys PKI .NET Class Library

Cipher.FileEncrypt Method (String, String, String, String, CipherAlgorithm, Mode)

Encrypt a file passing key and IV as hex strings

[Visual Basic]
Overloads Public Shared Function FileEncrypt( _
   ByVal fileOut As String, _
   ByVal fileIn As String, _
   ByVal keyHex As String, _
   ByVal ivHex As String, _
   ByVal cipherAlg As CipherAlgorithm, _
   ByVal mode As Mode _
) As Integer
[C#]
public static int FileEncrypt(
   string fileOut,
   string fileIn,
   string keyHex,
   string ivHex,
   CipherAlgorithm cipherAlg,
   Mode mode
);

Parameters

fileOut
Name of output file to be created or overwritten
fileIn
Name of input file
keyHex
Hex-encoded key of exact length
ivHex
Hex-encoded IV or "" for ECB mode
cipherAlg
Cipher Algorithm
mode
Cipher Mode

Return Value

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

Cipher Class | CryptoSysPKI Namespace | Cipher.FileEncrypt Overload List