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)); }
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)); }