AdvantageCMS.Core.Common.BaseClasses Namespace
Advantage CSP

AESEncryption..::..Encrypt Method (String, String, HashAlgorithmName, Int32, CipherMode, PaddingMode, Int32, Int32)

Encryption utilizing AesCryptoServiceProvider

Namespace:  AdvantageCMS.Core.Common
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public static string Encrypt(
	string value,
	string key,
	HashAlgorithmName algorithm,
	int iterations,
	CipherMode mode,
	PaddingMode padding,
	int keySize,
	int blockSize
)

Parameters

value
Type: String
The value to be encrypted.
key
Type: String
The key used to encrypt.
algorithm
Type: HashAlgorithmName
The encryption algorithm to utilize.
iterations
Type: Int32
The number of iterations for the algorithm to use (default=1000).
mode
Type: CipherMode
The cipher mode to utilize (default=CipherMode.CBC).
padding
Type: PaddingMode
The padding mode to utilize (default=PaddingMode.PKCS7).
keySize
Type: Int32
Size of the key in bits used in the symmetric algorithm (default=256).
blockSize
Type: Int32
Size of the block in bits used in the cryptographic operation (default=128).

Return Value

The encrypted string

Exceptions


ExceptionCondition
ArgumentNullException
eCMSEngineEventStatus..::..ExceptionThere was an error encrypting the data.