Interface ISymmetricAlgorithm
- Namespace
- The.Security.Cryptography
- Assembly
- Instagile.dll
An initialised instance of a block cipher, containing keys and parameters.
public interface ISymmetricAlgorithm : IDisposable
- Inherited Members
Remarks
Not an AEAD interface!
Properties
BlockSizeBytes
Padded output will be a multiple of this size.
long BlockSizeBytes { get; }
Property Value
IsStreamingSupported
If false, WriteAppendix(Stream, byte[]) and ReadAppendix(Stream, byte[]) will throw.
bool IsStreamingSupported { get; }
Property Value
Methods
GetKey()
Serialise the key material for use elsewhere.
byte[] GetKey()
Returns
- byte[]
A symmetric encryption key.
ReadAppendix(Stream, byte[])
Decrypt additional data with a known IV.
Stream ReadAppendix(Stream ciphertext, byte[] iv)
Parameters
Returns
- Stream
Decrypting stream, which must be disposed once read.
ReadBodyAsync(Stream, Stream)
One-shot decryption with a contained IV.
Task<byte[]> ReadBodyAsync(Stream ciphertext, Stream plaintext)
Parameters
ciphertextStreamEncrypted message, prefixed with the IV.
plaintextStreamOutput to which to write the decrypted message.
Returns
WriteAppendix(Stream, byte[])
Encrypt additional data with a known IV.
Stream WriteAppendix(Stream plaintext, byte[] iv)
Parameters
Returns
- Stream
Encrypting stream with PKCS#7 padding, which must be disposed once read.
WriteBodyAsync(Stream, Stream)
One-shot encryption with a generated IV.
Task<byte[]> WriteBodyAsync(Stream plaintext, Stream ciphertext)
Parameters
plaintextStreamUnencrypted message.
ciphertextStreamOutput to which to write the IV prefix and the encrypted data.