Esempio n. 1
0
 public static string DecryptBase64String(string password, AutoSaltSizes saltSize, string b64StrData, SymmetricCryptoAlgorithm algorithm = SymmetricCryptoAlgorithm.AES_256_CBC)
 {
     byte[] data          = Convert.FromBase64String(b64StrData);
     byte[] encryptedData = DecryptData(password, saltSize, data, algorithm);
     return(CryptoCommon.GetString(encryptedData));
 }
Esempio n. 2
0
 public static string EncryptString(string password, AutoSaltSizes saltSize, string strData, SymmetricCryptoAlgorithm algorithm = SymmetricCryptoAlgorithm.AES_256_CBC)
 {
     byte[] data          = CryptoCommon.GetBytes(strData);
     byte[] encryptedData = EncryptData(password, saltSize, data, algorithm);
     return(CryptoCommon.GetString(encryptedData));
 }