RC2CryptoServiceProvider Class

 

Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the RC2 algorithm. This class cannot be inherited.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

System.Object
  System.Security.Cryptography.SymmetricAlgorithm
    System.Security.Cryptography.RC2
      System.Security.Cryptography.RC2CryptoServiceProvider

[<Sealed>]
[<ComVisibleAttribute(true)>]
type RC2CryptoServiceProvider = 
    class
        inherit RC2
    end

NameDescription
System_CAPS_pubmethodRC2CryptoServiceProvider()

Initializes a new instance of the RC2CryptoServiceProvider class.

NameDescription
System_CAPS_pubpropertyBlockSize

Gets or sets the block size, in bits, of the cryptographic operation.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyEffectiveKeySize

Gets or sets the effective size, in bits, of the secret key used by the RC2 algorithm.(Overrides RC2.EffectiveKeySize.)

System_CAPS_pubpropertyFeedbackSize

Gets or sets the feedback size, in bits, of the cryptographic operation.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyIV

Gets or sets the initialization vector (IV) for the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyKey

Gets or sets the secret key for the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyKeySize

Gets or sets the size of the secret key used by the RC2 algorithm in bits.(Inherited from RC2.)

System_CAPS_pubpropertyLegalBlockSizes

Gets the block sizes, in bits, that are supported by the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyLegalKeySizes

Gets the key sizes, in bits, that are supported by the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyMode

Gets or sets the mode for operation of the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyPadding

Gets or sets the padding mode used in the symmetric algorithm.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubpropertyUseSalt

Gets or sets a value that determines whether to create a key with an 11-byte-long, zero-value salt.

NameDescription
System_CAPS_pubmethodClear()

Releases all resources used by the SymmetricAlgorithm class.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubmethodCreateDecryptor()

Creates a symmetric decryptor object with the current Key property and initialization vector (IV).(Inherited from SymmetricAlgorithm.)

System_CAPS_pubmethodCreateDecryptor(Byte[], Byte[])

Creates a symmetric RC2 decryptor object with the specified key (Key)and initialization vector (IV).(Overrides SymmetricAlgorithm.CreateDecryptor(Byte[], Byte[]).)

System_CAPS_pubmethodCreateEncryptor()

Creates a symmetric encryptor object with the current Key property and initialization vector (IV).(Inherited from SymmetricAlgorithm.)

System_CAPS_pubmethodCreateEncryptor(Byte[], Byte[])

Creates a symmetric RC2 encryptor object with the specified key (Key) and initialization vector (IV).(Overrides SymmetricAlgorithm.CreateEncryptor(Byte[], Byte[]).)

System_CAPS_pubmethodDispose()

Releases all resources used by the current instance of the SymmetricAlgorithm class.(Inherited from SymmetricAlgorithm.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGenerateIV()

Generates a random initialization vector (IV) to use for the algorithm.(Overrides SymmetricAlgorithm.GenerateIV().)

System_CAPS_pubmethodGenerateKey()

Generates a random key (Key) to be used for the algorithm.(Overrides SymmetricAlgorithm.GenerateKey().)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodValidKeySize(Int32)

Determines whether the specified key size is valid for the current algorithm.(Inherited from SymmetricAlgorithm.)

The RC2CryptoServiceProvider implementation supports key lengths from 40 bits to 128 bits in increments of 8 bits.

The RC2CryptoServiceProvider object is a block cipher that encrypts and decrypts data in blocks of 8 bytes. This class pads the final block of data if it is less than 8 bytes. As a result of this padding, the length of encrypted data could be greater than the original plaintext.

Note that the RC2CryptoServiceProvider object does not use salt.

System_CAPS_noteNote

A newer symmetric encryption algorithm, Advanced Encryption Standard (AES), is available. Consider using the Aes algorithm and its derived classes instead of the RC2CryptoServiceProvider class. Use RC2CryptoServiceProvider only for compatibility with legacy applications and data.

The following code example encrypts and then decrypts a string.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: