StringExtensionsDecrypt(String, String, Byte, Encoding) Method

Decrypts an encrypted base64 string data by the Aes algorithm using the provided password and salt.

Definition

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

Parameters

data  String
The encrypted text in base64 format.
password  String
Password of decryption.
salt  Byte
A salt value to be used to derive the key and initialization vector bytes. It should be the same as the one generated by the Encrypt(String, String, Byte, Encoding) method.
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