RC2CryptoServiceProvider.CreateEncryptor Method (Byte[], Byte[])


Creates a symmetric RC2 encryptor object with the specified key (Key) and initialization vector (IV).

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

override CreateEncryptor : 
        rgbKey:byte[] *
        rgbIV:byte[] -> ICryptoTransform


Type: System.Byte[]

The secret key to use for the symmetric algorithm.

Type: System.Byte[]

The initialization vector to use for the symmetric algorithm.

Return Value

Type: System.Security.Cryptography.ICryptoTransform

A symmetric RC2 encryptor object.

Exception Condition

An OFB cipher mode was used.


A CFB cipher mode with a feedback size other than 8 bits was used.


An invalid key size was used.


The algorithm key size was not available.

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

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
Return to top