CryptoSys API Library Manual

cipherStreamFile

Encipher data in a file using specified stream cipher.

Syntax

[VBA]
Public Function cipherStreamFile ( _
    szFileOut As String, _
    szFileIn As String, _
    lpKey() As Byte, _
    lpIV() As Byte, _
    nOptions As Long, _
    Optional nCounter As Long = 0 _
) As Long

Parameters

szFileOut
Output file to be created.
szFileIn
Input file to be processed.
lpKey
Key.
lpIV
Initialization Vector (IV, nonce). Use an empty array for Arcfour.
nOptions
Algorithm to be used. Select one from:
API_SC_ARCFOUR
API_SC_SALSA20
API_SC_CHACHA20
nCounter
Counter value for ChaCha20 only, otherwise ignored.

Return Value

Long: Zero (0) on success, or a nonzero error code (use apiErrorLookup to check)

Remarks

Arcfour: any length key; use an empty array 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.
Note different order of parameters from core function.
[PREV: cipherStreamBytes...]   [Contents]   [Index]   
   [NEXT: cipherStreamFinal...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.