C# Class Org.Mentalis.Security.Cryptography.RC4CryptoServiceProvider

Defines a wrapper object to access the cryptographic service provider (CSP) version of the RC4 algorithm. This class cannot be inherited.
Inheritance: Org.Mentalis.Security.Cryptography.RC4
Exibir arquivo Open project: soywiz/csharputils Class Usage Examples

Public Methods

Method Description
CreateDecryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform

Creates a symmetric decryptor object with the specified Key.

This method decrypts an encrypted message created using the CreateEncryptor overload with the same parameters.

CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform

Creates a symmetric encryptor object with the specified Key.

Use the CreateDecryptor overload with the same parameters to decrypt the result of this method.

GenerateIV ( ) : void

This is a stub method.

Since the RC4 cipher doesn't use an Initialization Vector, this method will not do anything.

GenerateKey ( ) : void

Generates a random Key to be used for the algorithm.

Use this method to generate a random key when none is specified.

RC4CryptoServiceProvider ( ) : System

Initializes a new instance of the RC4CryptoServiceProvider class.

Private Methods

Method Description
CanUseUnmanaged ( int keySize ) : bool

Returns a boolean that indicates whether the unmanaged CSP can be used or not.

_Dispose ( ) : void

Releases all managed and unmanaged resources used by this class.

Method Details

CreateDecryptor() public method

Creates a symmetric decryptor object with the specified Key.
This method decrypts an encrypted message created using the CreateEncryptor overload with the same parameters.
The object is disposed. is a null reference (Nothing in Visual Basic).
public CreateDecryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte The secret key to be used for the symmetric algorithm.
rgbIV byte Not used in RC4. It can be a null reference or a byte array with a length less than 2.
return ICryptoTransform

CreateEncryptor() public method

Creates a symmetric encryptor object with the specified Key.
Use the CreateDecryptor overload with the same parameters to decrypt the result of this method.
The object is disposed. is a null reference (Nothing in Visual Basic).
public CreateEncryptor ( byte rgbKey, byte rgbIV ) : ICryptoTransform
rgbKey byte The secret key to be used for the symmetric algorithm.
rgbIV byte Not used in RC4. It can be a null reference or a byte array with a length less than 2.
return ICryptoTransform

GenerateIV() public method

This is a stub method.
Since the RC4 cipher doesn't use an Initialization Vector, this method will not do anything.
public GenerateIV ( ) : void
return void

GenerateKey() public method

Generates a random Key to be used for the algorithm.
Use this method to generate a random key when none is specified.
public GenerateKey ( ) : void
return void

RC4CryptoServiceProvider() public method

Initializes a new instance of the RC4CryptoServiceProvider class.
public RC4CryptoServiceProvider ( ) : System
return System