Click or drag to resize

CryptographyDecrypt(String, String, SymmetricAlgorithm) Method

Decrypts a ciphertext using a specific symmetric algorithm.

Namespace: InnerDrive.Core
Assembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.0.8475.0
Syntax
C#
public static Task<string> Decrypt(
	string cipherText,
	string key,
	SymmetricAlgorithm provider
)

Parameters

cipherText  String
The encrypted text to decrypt.
key  String
The key to decrypt the ciphertext.
provider  SymmetricAlgorithm
Any symmetric cryptography provider derived from SymmetricAlgorithm that will perform the decryption.

Return Value

TaskString
A String containing the decrypted plaintext.
Exceptions
ExceptionCondition
ArgumentExceptioncipherText is null or Empty
ArgumentNullExceptionprovider is null
Remarks

The default decryption algorithm is DES. Any other class derived from SymmetricAlgorithm can be used instead.

Adapted from work by Frank Fong and William Rawls of the Code Project.

The cipher text can be any length other than 0; the key length must be at least MinKeyLength and no more than MaxKeyLength.

See Also