CryptographyEncryptAsync(String, String, String, CancellationToken) Method
Encrypts a string using a specified symmetrical encryption algorithm.
Namespace: InnerDrive.CoreAssembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.2.9417.0
public static Task<string> EncryptAsync(
string plainText,
string key,
string providerName,
CancellationToken cancellationToken = default
)
- plainText String
- The string to encrypt.
- key String
- The key to encrypt the plaintext.
- providerName String
- The type name of any symmetric cryptography provider derived from
SymmetricAlgorithm that will perform the encryption.
- cancellationToken CancellationToken (Optional)
- A CancellationToken
controlling the request lifetime
TaskStringA Base64-encoded
String containing the ciphertext.
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.