Table of Contents

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

string

Methods

Init(bool, ICipherParameters)

Initialise the cipher.

void Init(bool forEncryption, ICipherParameters parameters)

Parameters

forEncryption bool

If true the cipher is initialised for encryption, if false for decryption.

parameters ICipherParameters

The 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

input byte[]

The input byte array.

inOff int

The offset into input where the data to be processed starts.

length int

The number of bytes to be processed.

output byte[]

The output buffer the processed bytes go into.

outOff int

The offset into output the 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

input ReadOnlySpan<byte>

The input span.

output Span<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

input byte

the byte to be processed.

Returns

byte

the result of processing the input byte.