Table of Contents

Class AesCipher

Namespace
Renci.SshNet.Security.Cryptography.Ciphers
Assembly
Renci.SshNet.dll

AES cipher implementation.

public sealed class AesCipher : BlockCipher, IDisposable
Inheritance
AesCipher
Implements
Inherited Members

Constructors

AesCipher(byte[], byte[], AesCipherMode, bool)

Initializes a new instance of the AesCipher class.

public AesCipher(byte[] key, byte[] iv, AesCipherMode mode, bool pkcs7Padding = false)

Parameters

key byte[]

The key.

iv byte[]

The IV.

mode AesCipherMode

The mode.

pkcs7Padding bool

Enable PKCS7 padding.

Exceptions

ArgumentNullException

key is null.

ArgumentException

Keysize is not valid for this algorithm.

Methods

Decrypt(byte[], int, int)

public override byte[] Decrypt(byte[] input, int offset, int length)

Parameters

input byte[]
offset int
length int

Returns

byte[]

DecryptBlock(byte[], int, int, byte[], int)

public override int DecryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)

Parameters

inputBuffer byte[]
inputOffset int
inputCount int
outputBuffer byte[]
outputOffset int

Returns

int

Dispose()

public void Dispose()

Dispose(bool)

Dispose the instance.

public void Dispose(bool disposing)

Parameters

disposing bool

Set to True to dispose of resouces.

Encrypt(byte[], int, int)

public override byte[] Encrypt(byte[] input, int offset, int length)

Parameters

input byte[]
offset int
length int

Returns

byte[]

EncryptBlock(byte[], int, int, byte[], int)

public override int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset)

Parameters

inputBuffer byte[]
inputOffset int
inputCount int
outputBuffer byte[]
outputOffset int

Returns

int