CryptoSys PKI .NET Class Library

Cipher.FileEncrypt Method (String, String, Byte[], Byte[], CipherAlgorithm, Mode)

Encrypt a file

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

Parameters

fileOut
Name of output file to be created or overwritten
fileIn
Name of input file
key
Key of of exact length for block cipher algorithm
iv
Initialization Vector (IV) of exactly the block size or null 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

See Also

Cipher Class | CryptoSysPKI Namespace | Cipher.FileEncrypt Overload List