Click or drag to resize

CryptographyEncrypt(String, String, String) Method

Encrypts a string using a specified symmetrical encryption algorithm.

Namespace: InnerDrive.Core
Assembly: InnerDrive.Core (in InnerDrive.Core.dll) Version: 5.0.8475.0
Syntax
C#
public static Task<string> Encrypt(
	string plainText,
	string key,
	string providerName
)

Parameters

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.

Return Value

TaskString
A Base64-encoded String containing the ciphertext.
Remarks

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.

See Also