CryptoSys API Library Manual
CipherStream.Init Method
Initializes the context ready for repeated operations of CipherStream.Update
Syntax
[C#]
public int Init(
byte[] key,
byte[] iv,
int counter,
CipherStream.Algorithm streamAlg
)
[VB.NET]
Public Function Init ( _
key As Byte(), _
iv As Byte(), _
counter As Integer, _
streamAlg As CipherStream.Algorithm _
) As Integer
Parameters
- key
- Key
- iv
- Initialization Vector (IV, nonce) or null for Arcfour
- counter
- Counter value for ChaCha20 only, otherwise ignored. Use 0 for default.
- streamAlg
- Type: CipherStream.Algorithm
Stream cipher algorithm
Return Value
Remarks
- 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
VB6/C equivalent: CIPHER_StreamInit
[Contents] [Index]