StringExtensionsDecrypt(String, SymmetricAlgorithm, Byte, Byte, Encoding) Method

Decrypts an encrypted base64 string data by the provided symmetric algorithm, key and initialization vector.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static string Decrypt(
	this string data,
	SymmetricAlgorithm algorithm,
	byte[] key,
	byte[] iv,
	Encoding? encoding = null
)

Parameters

data  String
The encrypted text in base64 format.
algorithm  SymmetricAlgorithm
A SymmetricAlgorithm instance to use for decryption.
key  Byte
Key of decryption.
iv  Byte
The initialization vector to be used for decryption.
encoding  Encoding  (Optional)
The Encoding of the decrypted plain text. If , then the native UTF-16 encoding of the string type is assumed. This parameter is optional.
Default value: .

Return Value

String
The decrypted plain text.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also