C# Class 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.

Inheritance: ICryptoTransform
Afficher le fichier Open project: drizzt/KeePass-SerpentCipher

Private Properties

Свойство Type Description
Decrypt void
DecryptData int
Encrypt void
EncryptData int
IncrementCounter void

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

Clear() public méthode

Releases all resources used by the ManagedTransformBase class.
public Clear ( ) : void
Résultat void

DecryptBlock() protected méthode

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. ///
Résultat void

Dispose() public méthode

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

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. ///
Résultat void

EncryptBlock() protected méthode

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. ///
Résultat void

ManagedTransformBase() protected méthode

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. ///
Résultat System

Reset() protected méthode

Clears all potentially sensitive data stores.
protected Reset ( ) : void
Résultat void

TransformBlock() public méthode

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. ///
Résultat int

TransformFinalBlock() public méthode

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. ///
Résultat byte[]