CryptographyEncrypt(String, String, Symmetric |
public static Task<string> Encrypt( string plainText, string key, SymmetricAlgorithm provider )
Exception | Condition |
---|---|
ArgumentNullException | Thrown if plainText, or key, or provider is null. |
ArgumentException | Thrown if plainText or key is Empty. |
The default encryption 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.