C# Класс DotNetCrypt.ManagedTransformBase

An abstract base class for managed implementations of ICryptoTransform.

This class deals with the various forms of padding available. Unlike the classes built into the .NET framework, however, for modes which effectively operate in stream cipher mode (CFB, OFB), it is permissible to encrypt a message which is not an exact number of bytes without specifying a padding mode other than System.Security.Cryptography.PaddingMode.None

It also takes into account the cipher mode to be used. For increased compatibility with other systems, counter mode (CTR) is also supported via the ExtendedCipherMode enumeration.

Наследование: ICryptoTransform
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
Decrypt void
DecryptData int
Encrypt void
EncryptData int
IncrementCounter void

Открытые методы

Метод Описание
Clear ( ) : void

Releases all resources used by the ManagedTransformBase class.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

TransformBlock ( byte inputBuffer, int inputOffset, int inputCount, byte outputBuffer, int outputOffset ) : int

Transforms the specified region of the input byte array and copies the resulting transform to the specified region of the output byte array.

TransformFinalBlock ( byte inputBuffer, int inputOffset, int inputCount ) : byte[]

Transforms the specified region of the specified byte array.

Защищенные методы

Метод Описание
DecryptBlock ( byte block ) : void

Decrypts a single block of bytes, writing the result into the provided array.

Dispose ( bool disposing ) : void

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.

If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

EncryptBlock ( byte block ) : void

Encrypts a single block of bytes, writing the result into the provided array.

ManagedTransformBase ( ISymmetricAlgorithm algorithm, byte rgbIv, TransformDirection transformDirection, Endianness endianness ) : System

Creates a new managed transform instance, reading necessary setting values from the provided ISymmetricAlgorithm instance.

Reset ( ) : void

Clears all potentially sensitive data stores.

Приватные методы

Метод Описание
Decrypt ( uint cipher ) : void
DecryptData ( byte inputBuffer, int inputOffset, int inputCount, byte &outputBuffer, int outputOffset, PaddingMode paddingMode, bool final ) : int
Encrypt ( uint plain ) : void
EncryptData ( byte inputBuffer, int inputOffset, int inputCount, byte &outputBuffer, int outputOffset, PaddingMode paddingMode, bool final ) : int
IncrementCounter ( ) : void

Описание методов

Clear() публичный Метод

Releases all resources used by the ManagedTransformBase class.
public Clear ( ) : void
Результат void

DecryptBlock() защищенный Метод

Decrypts a single block of bytes, writing the result into the provided array.
protected DecryptBlock ( byte block ) : void
block byte /// The block of bytes to be decrypted. ///
Результат void

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Dispose(bool disposing) executes in two distinct scenarios. If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed.

If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.

protected Dispose ( bool disposing ) : void
disposing bool /// Indicates whether this method is being called by a user's code. ///
Результат void

EncryptBlock() защищенный Метод

Encrypts a single block of bytes, writing the result into the provided array.
protected EncryptBlock ( byte block ) : void
block byte /// The block of bytes to be encrypted. ///
Результат void

ManagedTransformBase() защищенный Метод

Creates a new managed transform instance, reading necessary setting values from the provided ISymmetricAlgorithm instance.
protected ManagedTransformBase ( ISymmetricAlgorithm algorithm, byte rgbIv, TransformDirection transformDirection, Endianness endianness ) : System
algorithm ISymmetricAlgorithm /// A instance from which to take /// setting values. ///
rgbIv byte /// The initialization vector to use. ///
transformDirection TransformDirection /// The direction of the transform (encryption or decryption). ///
endianness Endianness /// The endianness convention for the algorithm. ///
Результат System

Reset() защищенный Метод

Clears all potentially sensitive data stores.
protected Reset ( ) : void
Результат void

TransformBlock() публичный Метод

Transforms the specified region of the input byte array and copies the resulting transform to the specified region of the output byte array.
public TransformBlock ( byte inputBuffer, int inputOffset, int inputCount, byte outputBuffer, int outputOffset ) : int
inputBuffer byte /// The input for which to compute the transform. ///
inputOffset int /// The offset into the input byte array from which to begin using data. ///
inputCount int /// The number of bytes in the input byte array to use as data. ///
outputBuffer byte /// The output to which to write the transform. ///
outputOffset int /// The offset into the output byte array from which to begin writing /// data. ///
Результат int

TransformFinalBlock() публичный Метод

Transforms the specified region of the specified byte array.
public TransformFinalBlock ( byte inputBuffer, int inputOffset, int inputCount ) : byte[]
inputBuffer byte /// The input for which to compute the transform. ///
inputOffset int /// The offset into the byte array from which to begin using data. ///
inputCount int /// The number of bytes in the byte array to use as data. ///
Результат byte[]