CryptographyEncrypt Method (String, String) |
Encrypt the specified string value
with the specified password,
using the AesManaged algorithm.
Namespace:
AskiaPortalCmn.Security
Assembly:
AskiaPortalCmn (in AskiaPortalCmn.dll) Version: 1.7.0-build068
Syntax public static string Encrypt(
string value,
string password
)
Public Shared Function Encrypt (
value As String,
password As String
) As String
public:
static String^ Encrypt(
String^ value,
String^ password
)
Parameters
- value
- Type: SystemString
String to encrypt. - password
- Type: SystemString
Password used to encrypt/decrypt the string.
Return Value
Type:
StringEncrypted string.
Examples
Example of usage.
Based on http://stackoverflow.com/a/14286740/2134982
string encrypted = Cryptography.Encrypt(dataToEncrypt, password);
string decrypted = Cryptography.Decrypt(encrypted, password);
See Also