EasyXLS

Password protected Excel file and encryption

Concept

EasyXLS™ library enables you to protect your Excel file from unauthorized access by setting passwords for opening or / and modifying the document. If you set the password for opening the file, the Excel file will be encrypted.

EasyXLS allows you to create password protected Excel files and also to read password protected Excel files.

The library also provides methods for protecting the workbook structure and windows. An optional password can be set for this purpose. If the workbook is protected, the Excel file will be encrypted. The library allows you to create encrypted Excel files and also to read encrypted Excel files.

For Office 97-2003 documents, you may choose between RC4 (default encryption) or XOR (weak encryption). The default encryption for Office 2007-2013 documents is AES (Advanced Encryption Standard).

Concept in action

The below example shows how to create a password protected Excel file. The exported file is encrypted and a password is set for opening the Excel file.

Source code sample

C#.NET
VB.NET
C++.NET
J#.NET
Java
PHP
ASP
C++
VB6
VBS
Coldfusion

The screen shot provides an example of a password protected Excel file and the password window to enter the required password for opening the file.

Create and read password protected Excel file

Create XLSX, XLSB, XLSM and XLS password protected Excel files

This code sample shows how to create a password protected XLS file. Similarly, you can create password protected XLSX or XLSM files using ExcelDocument.easy_WriteXLSXFile method or create password protected XLSB files using ExcelDocument.easy_WriteXLSBFile method.

Read XLSX, XLSB, XLSM and XLS password protected Excel files

This code sample shows how to create a password protected XLS file. Similarly, you can set the password for reading password protected XLS file and use ExcelDocument.easy_LoadXLSFile method, read password protected XLSX or XLSM file and use ExcelDocument.easy_LoadXLSXFile method or read password protected XLSB file using ExcelDocument.easy_LoadXLSBFile

Password to open Excel file

EasyXLS allows you to set a password for opening the Excel file using ExcelOptions.setPasswordToOpen method. If password set, the Excel file is encrypted.

Password to modify Excel file

EasyXLS allows you to set a password for modifying the Excel file using ExcelOptions.setPasswordToModify method.

Password protected workbook

EasyXLS allows you to protect the workbook structure and windows with a password using ExcelDocument.setWorkbookProtection method and ExcelDocument.setWorkbookPassword method. If the workbook is protected, the Excel file will be encrypted.

Encrypted Excel file and encryption algorithm

If a password is set for opening the Excel file or if the workbook is protected the Excel file is encrypted. EasyXLS supports RC4 (default encryption) or XOR (weak encryption) for Excel 97-2003 files and AES (Advanced Encryption Standard) for Excel 2007-2013 files. The encryption algorithm can be set using ExcelOptions.setEncryptionOptions method.

Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for .NET and Java

If you already own a license key, you may login and download EasyXLS from your account.



Available for: Professional, Excel Writer, Excel Reader
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Writer
.NET version to create and export Excel files
.NET Excel Reader
.NET version to read and import Excel files
-
Java
Java Excel Library
full Java version to import, export or convert Excel files
Java Excel Writer
Java version to create and export Excel files
Java Excel Reader
Java version to read and import Excel files
Download EasyXLS™ Excel Library for .NET and Java

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2010
MS Excel 2013
MS Excel 2016
MS Excel 2019
XLSX XLSM XLSB XLS
XML HTML CSV TXT