แก้ไข

แชร์ผ่าน


TripleDESCng.CreateDecryptor Method

Definition

Creates a symmetric decryptor object.

Overloads

CreateDecryptor()

Creates a symmetric 3DES decryptor object with the current key and initialization vector (IV).

CreateDecryptor(Byte[], Byte[])

Creates a symmetric 3DES decryptor object with the specified key and initialization vector (IV).

CreateDecryptor()

Creates a symmetric 3DES decryptor object with the current key and initialization vector (IV).

public:
 override System::Security::Cryptography::ICryptoTransform ^ CreateDecryptor();
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor ();
override this.CreateDecryptor : unit -> System.Security.Cryptography.ICryptoTransform
Public Overrides Function CreateDecryptor () As ICryptoTransform

Returns

A symmetric 3DES decryptor object.

Exceptions

.NET 6 and later: CFB64 mode is selected and the key is persisted.

Remarks

This method decrypts an encrypted message created using the CreateEncryptor() overload with the same signature.

Applies to

CreateDecryptor(Byte[], Byte[])

Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs
Source:
Cng.NotSupported.cs

Creates a symmetric 3DES decryptor object with the specified key and initialization vector (IV).

public:
 override System::Security::Cryptography::ICryptoTransform ^ CreateDecryptor(cli::array <System::Byte> ^ rgbKey, cli::array <System::Byte> ^ rgbIV);
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[]? rgbIV);
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV);
override this.CreateDecryptor : byte[] * byte[] -> System.Security.Cryptography.ICryptoTransform
Public Overrides Function CreateDecryptor (rgbKey As Byte(), rgbIV As Byte()) As ICryptoTransform

Parameters

rgbKey
Byte[]

The secret key to use for the 3DES algorithm. The key size must be 192 bits.

rgbIV
Byte[]

The initialization vector to use for the 3DES algorithm.

Returns

A symmetric 3DES decryptor object.

Exceptions

rgbKey is null.

rgbKey is not a valid size for this algorithm.

-or-

rgbIV size does not match the block size for this algorithm.

rgbKey is a known weak key for this algorithm and cannot be used.

-or-

rgbIV is null.

Remarks

This method decrypts an encrypted message created using the CreateEncryptor(Byte[], Byte[]) overload with the same signature.

Note

If you've created the TripleDESCng object using an existing persisted key and you want to make use of that key when decrypting the message, you want to set the IV property and then call the parameterless CreateDecryptor() overload instead; otherwise, using this method will create an ephemeral key as specified by the rgbKey parameter.

Applies to