Click or drag to resize

CryptographyEncrypt(String, String, Boolean) Method

Encrypts a string using the default symmetrical encryption.

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,
	bool addSalt
)

Parameters

plainText  String
The string to encrypt.
key  String
The key to encrypt the plaintext.
addSalt  Boolean
If true, the plaintext is salted before encryption. See AddSalt(String)

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