private ICryptoTransform GetDecryptor() { var rijndael = new RijndaelManaged { Key = KeyProvider.GetKey(), IV = KeyProvider.GetIV() }; return(rijndael.CreateDecryptor()); }
private ICryptoTransform GetEncryptor(string password) { if (!KeyProvider.CorrectPassword(password)) { throw new Exception("Password isn`t correct"); } var rijndael = new RijndaelManaged() { Key = KeyProvider.GetKey(), IV = KeyProvider.GetIV() }; return(rijndael.CreateEncryptor()); }