Class CtrStreamCipher
The CTR cipher as a stream.
Implements
Org.BouncyCastle.Crypto.IStreamCipher
Inherited Members
Namespace: PeerTalk.Cryptography
Assembly: PeerTalk.dll
Syntax
public class CtrStreamCipher : IStreamCipher
Remarks
A copy of SicBlockCipher that implements Org.BouncyCastle.Crypto.IStreamCipher.
Constructors
| Improve this Doc View SourceCtrStreamCipher(IBlockCipher)
Creates a new instance of the CtrStreamCipher with the specified cipher.
Declaration
public CtrStreamCipher(IBlockCipher cipher)
Parameters
Type | Name | Description |
---|---|---|
Org.BouncyCastle.Crypto.IBlockCipher | cipher | The cipher to produce the output counter. Typically Org.BouncyCastle.Crypto.Engines.AesEngine. |
Properties
| Improve this Doc View SourceAlgorithmName
The name of this algorithm.
Declaration
public string AlgorithmName { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceInit(Boolean, ICipherParameters)
Init the cipher.
Declaration
public void Init(bool forEncryption, ICipherParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
Boolean | forEncryption | Ignored. |
Org.BouncyCastle.Crypto.ICipherParameters | parameters | Must be a Org.BouncyCastle.Crypto.Parameters.ParametersWithIV. |
Examples
var encrypt = new CtrStreamCipher(new AesEngine()); var p = new ParametersWithIV(new KeyParameter(key), iv); encrypt.Init(true, p);
| Improve this Doc View SourceProcessBytes(Byte[], Int32, Int32, Byte[], Int32)
Declaration
public void ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | input | |
Int32 | inOff | |
Int32 | length | |
Byte[] | output | |
Int32 | outOff |
Reset()
Declaration
public void Reset()
ReturnByte(Byte)
Declaration
public byte ReturnByte(byte input)
Parameters
Type | Name | Description |
---|---|---|
Byte | input |
Returns
Type | Description |
---|---|
Byte |
Implements
Org.BouncyCastle.Crypto.IStreamCipher