Mentalis.org Security Library documentation

DataProtectionCryptoServiceProvider.UnprotectData Method (Byte[], Byte[])

Decrypts data that has been encrypted with the ProtectData method.

[Visual Basic]
Overloads Public Function UnprotectData( _
   ByVal data As Byte(), _
   ByVal entropy As Byte() _
) As Byte()
[C#]
public byte[] UnprotectData(
   byte[] data,
   byte[] entropy
);

Parameters

data
The data to decrypt.
entropy
Additional entropy to use during the encyption process. This parameter can be set to null.

Return Value

The decrypted data.

Remarks

The entropy used during decryption must be the same as the entropy used during encryption.

Exceptions

Exception TypeCondition
ArgumentNullExceptiondata is a null reference (Nothing in Visual Basic).
CryptographicExceptionAn error occurs during the encryption process. Under some circumstances, Microsoft cryptographic service providers may not allow encryption when used in France. This may occur on down-level platforms such as Windows 98 and Windows NT 4.0, depending on the system's configuration and the version of the CSPs.

See Also

DataProtectionCryptoServiceProvider Class | Org.Mentalis.Security.Cryptography Namespace | DataProtectionCryptoServiceProvider.UnprotectData Overload List