Interface IStreamCipher
- Namespace
- Org.BouncyCastle.Crypto
- Assembly
- BouncyCastle.Cryptography.dll
The interface stream ciphers conform to.
public interface IStreamCipher
Properties
AlgorithmName
The name of the algorithm this cipher implements.
string AlgorithmName { get; }
Property Value
Methods
Init(bool, ICipherParameters)
Initialise the cipher.
void Init(bool forEncryption, ICipherParameters parameters)
Parameters
forEncryptionboolIf true the cipher is initialised for encryption, if false for decryption.
parametersICipherParametersThe key and other data required by the cipher.
Exceptions
- ArgumentException
If the parameters argument is inappropriate.
ProcessBytes(byte[], int, int, byte[], int)
Process a block of bytes from input, putting the result into output.
void ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff)
Parameters
inputbyte[]The input byte array.
inOffintThe offset into
inputwhere the data to be processed starts.lengthintThe number of bytes to be processed.
outputbyte[]The output buffer the processed bytes go into.
outOffintThe offset into
outputthe processed data starts at.
Exceptions
- DataLengthException
If the input buffer is too small.
- OutputLengthException
If the output buffer is too small.
ProcessBytes(ReadOnlySpan<byte>, Span<byte>)
Process a block of bytes from input, putting the result into output.
void ProcessBytes(ReadOnlySpan<byte> input, Span<byte> output)
Parameters
inputReadOnlySpan<byte>The input span.
outputSpan<byte>The output span.
Exceptions
- OutputLengthException
If the output span is too small.
Reset()
Reset the cipher to the same state as it was after the last init (if there was one).
void Reset()
ReturnByte(byte)
encrypt/decrypt a single byte returning the result.
byte ReturnByte(byte input)
Parameters
inputbytethe byte to be processed.
Returns
- byte
the result of processing the input byte.