CryptographyDecryptDictionaryT Method (String, String) |
Decrypt the specified dictionary value
with the specified password,
using a SymmetricAlgorithm.
Namespace:
AskiaPortalCmn.Security
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static IDictionary<string, string> DecryptDictionary<T>(
string value,
string password
)
where T : new(), SymmetricAlgorithm
Public Shared Function DecryptDictionary(Of T As {New, SymmetricAlgorithm}) (
value As String,
password As String
) As IDictionary(Of String, String)
public:
generic<typename T>
where T : gcnew(), SymmetricAlgorithm
static IDictionary<String^, String^>^ DecryptDictionary(
String^ value,
String^ password
)
Parameters
- value
- Type: SystemString
Value to decrypt. - password
- Type: SystemString
Password used to encrypt/decrypt the string.
Type Parameters
- T
- SymmetricAlgorithm class to use, such as:
- AesManaged
- RijndaelManaged
- DESCryptoServiceProvider
- RC2CryptoServiceProvider
- TripleDESCryptoServiceProvider
Return Value
Type:
IDictionaryString,
StringDictionary or null if fail to decrypt.
Examples
Example of usage.
Based on http://stackoverflow.com/a/14286740/2134982
IDictionary<string, string> dictionary = new Dictionary<string, string>
{
{"key1", "value1"},
{"key2", "value2"}
};
string encrypted = Cryptography.EncryptDictionary<RijndaelManaged>(dictionary, password);
IDictionary<string, string> decrypted = Cryptography.DecryptDictionary<RijndaelManaged>(encrypted, password);
See Also