Enciphers data in a file using specified stream cipher.
Namespace: CryptoSysAPIAssembly: diCrSysAPINet (in diCrSysAPINet.dll) Version: 6.22.2.24248 (6.22.2.0)
Syntaxpublic static int File(
string fileOut,
string fileIn,
byte[] key,
byte[] iv,
int counter,
CipherStreamAlgorithm streamAlg
)
Public Shared Function File (
fileOut As String,
fileIn As String,
key As Byte(),
iv As Byte(),
counter As Integer,
streamAlg As CipherStreamAlgorithm
) As Integer
Parameters
- fileOut String
- Name of output file to be created or overwritten
- fileIn String
- Name of input file
- key Byte
- Key
- iv Byte
- Initialization Vector (IV, nonce) or null for Arcfour
- counter Int32
- Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
- streamAlg CipherStreamAlgorithm
- Stream cipher algorithm
Return Value
Int320 if successful or nonzero
error code
RemarksfileOut and
fileIn must
not be the same
- Arcfour: any length key; specify null for IV.
- Salsa20: key must be exactly 16 or 32 bytes and IV exactly 8 bytes long.
- ChaCha20: key must be exactly 16 or 32 bytes and IV exactly 8, 12, or 16 bytes long.
Counter is ignored if IV is 16 bytes.
See Also