Table of Contents

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

long

IsStreamingSupported

bool IsStreamingSupported { get; }

Property Value

bool

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

ciphertext Stream
iv byte[]

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

ciphertext Stream

Encrypted message, prefixed with the IV.

plaintext Stream

Output to which to write the decrypted message.

Returns

Task<byte[]>

IV read from the beginning of the ciphertext.

WriteAppendix(Stream, byte[])

Encrypt additional data with a known IV.

Stream WriteAppendix(Stream plaintext, byte[] iv)

Parameters

plaintext Stream
iv byte[]

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

plaintext Stream

Unencrypted message.

ciphertext Stream

Output to which to write the IV prefix and the encrypted data.

Returns

Task<byte[]>

Generated IV to use when appending further data.