CryptographyEncryptAsync(String, String, CancellationToken) Method

Encrypts a string using the default symmetrical encryption but without salt.

Definition

Namespace: InnerDrive.Core
Assembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.2.9417.0
C#
public static Task<string> EncryptAsync(
	string plainText,
	string key,
	CancellationToken cancellationToken = default
)

Parameters

plainText  String
The string to encrypt.
key  String
The key to encrypt the plaintext.
cancellationToken  CancellationToken  (Optional)
A CancellationToken controlling the request lifetime

Return Value

TaskString
A Base64-encoded String containing the ciphertext.

Remarks

Uses the default encryption algorithm, DES.

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

The plain text must be at least 0 and no more than MaxPlaintextLength; the key length must be at least MinKeyLength and no more than MaxKeyLength.

See Also