CryptoSys PKI Pro Manual

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

Encrypt a file.

Syntax

[C#]
public static int FileEncrypt(
	string fileOut,
	string fileIn,
	byte[] key,
	byte[] iv,
	CipherAlgorithm cipherAlg,
	Mode mode
)
[VB.NET]
Public Shared Function FileEncrypt ( _
	fileOut As String, _
	fileIn As String, _
	key As Byte(), _
	iv As Byte(), _
	cipherAlg As CipherAlgorithm, _
	mode As Mode _
) As Integer

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
Type: CipherAlgorithm
Cipher Algorithm
mode
Type: Mode
Cipher Mode

Return Value

0 if successful or non-zero error code

Remarks

fileOut and fileIn must not be the same

Examples (VB.NET)

See Example1

See Also

VB6/C equivalent: CIPHER_File

[Contents] [Index]

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

Copyright © 2004-21 D.I. Management Services Pty Ltd. All rights reserved. Generated 2021-10-01T09:03:20Z.