using OfficeOpenXml;
using System.IO;
string filePath = "path_to_encrypted_file.xlsx";
string password = "password";
FileInfo fileInfo = new FileInfo(filePath);
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using (ExcelPackage excelPackage = new ExcelPackage(fileInfo, password))
{
int sheetIndex = 0;
ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets[sheetIndex];
int rowCount = worksheet.Dimension.Rows;
int colCount = worksheet.Dimension.Columns;
for (int row = 1; row <= rowCount; row++)
{
for (int col = 1; col <= colCount; col++)
{
Console.Write(worksheet.Cells[row, col].Value + "\t");
}
Console.WriteLine();
}
}