CipherFileEncrypt(String, String, Byte, Byte, CipherAlgorithm, Mode, Padding, CipherOpts) Method |
Encrypt a file.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static int FileEncrypt(
string fileOut,
string fileIn,
byte[] key,
byte[] iv,
CipherAlgorithm cipherAlg,
Mode mode,
Padding pad = Padding.Default,
CipherOpts opts = CipherOpts.Default
)
Public Shared Function FileEncrypt (
fileOut As String,
fileIn As String,
key As Byte(),
iv As Byte(),
cipherAlg As CipherAlgorithm,
mode As Mode,
Optional pad As Padding = Padding.Default,
Optional opts As CipherOpts = CipherOpts.Default
) As Integer
Parameters
- fileOut String
- Name of output file to be created or overwritten
- fileIn String
- Name of input file
- key Byte
- Key of of exact length for block cipher algorithm
- iv Byte
- Initialization Vector (IV) of exactly the block size or null 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
Int320 if successful or non-zero
error code
RemarksfileOut and fileIn must not be the same
See Also