CryptoSys API Library Manual
cipherStreamBytes
Encipher data in array of bytes using specified stream cipher.
Syntax
[VBA]
Public Function cipherStreamBytes ( _
lpInput() As Byte, _
lpKey() As Byte, _
lpIV() As Byte, _
nOptions As Long, _
Optional nCounter As Long = 0 _
) As Byte()
Parameters
- lpInput
- Input data.
- 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
Byte(): Ciphertext in byte array, or empty array on error.
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.