StringExtensionsDecrypt(String, SymmetricAlgorithm, String, Byte, Encoding) Method
Decrypts an encrypted base64 string data by the provided symmetric algorithm, password and salt.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
public static string Decrypt(
this string data,
SymmetricAlgorithm algorithm,
string password,
byte[] salt,
Encoding? encoding = null
)
<ExtensionAttribute>
Public Shared Function Decrypt (
data As String,
algorithm As SymmetricAlgorithm,
password As String,
salt As Byte(),
Optional encoding As Encoding = Nothing
) As String
public:
[ExtensionAttribute]
static String^ Decrypt(
String^ data,
SymmetricAlgorithm^ algorithm,
String^ password,
array<unsigned char>^ salt,
Encoding^ encoding = nullptr
)
[<ExtensionAttribute>]
static member Decrypt :
data : string *
algorithm : SymmetricAlgorithm *
password : string *
salt : byte[] *
?encoding : Encoding
(* Defaults:
let _encoding = defaultArg encoding null
*)
-> string
- data String
- The encrypted text in base64 format.
- algorithm SymmetricAlgorithm
- A SymmetricAlgorithm instance to use for decryption.
- 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, SymmetricAlgorithm, 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: .
StringThe decrypted plain text.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).