UtilEncryptionAesDecrypt Method
Decrypts a string using AES algorithm.
Namespace: DevCase.Core.Security.Cryptography.EncryptionAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string AesDecrypt(
string str,
string key,
int size,
byte[] salt = null,
CipherMode mode = CipherMode.ECB,
Encoding enc = null
)
Public Shared Function AesDecrypt (
str As String,
key As String,
size As Integer,
Optional salt As Byte() = Nothing,
Optional mode As CipherMode = CipherMode.ECB,
Optional enc As Encoding = Nothing
) As String
Dim str As String
Dim key As String
Dim size As Integer
Dim salt As Byte()
Dim mode As CipherMode
Dim enc As Encoding
Dim returnValue As String
returnValue = UtilEncryption.AesDecrypt(str,
key, size, salt, mode, enc)
public:
static String^ AesDecrypt(
String^ str,
String^ key,
int size,
array<unsigned char>^ salt = nullptr,
CipherMode mode = CipherMode::ECB,
Encoding^ enc = nullptr
)
static member AesDecrypt :
str : string *
key : string *
size : int *
?salt : byte[] *
?mode : CipherMode *
?enc : Encoding
(* Defaults:
let _salt = defaultArg salt null
let _mode = defaultArg mode CipherMode.ECB
let _enc = defaultArg enc null
*)
-> string
No code example is currently available or this language may not be supported.
- str String
-
The string to decrypt.
- key String
-
The decryption key.
- size Int32
-
The key size.
128, 192 or 256 bits.
- salt Byte (Optional)
-
The key salt.
- mode CipherMode (Optional)
-
The AES decryption mode.
- enc Encoding (Optional)
-
The text Encoding.
String
The decrypted string.
This is a code example.
No code example is currently available or this language may not be supported.
Dim decrypted As String = UtilEncryption.AesDecrypt("HHtV2WioKQ4b/999bytx9A==", "my key", 256)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
A value of 128, 192 or 256 is required for AES algorithm.;size
or
Salt should contain at least 8 bytes.;salt
|