Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Microsoft Excel (97-2007/2010) enables you to encrypt and password protect spreadsheets. It uses algorithms provided by a Crypto Service Provider. A Crypto Service Provider (or CSP) is a set of cryptographic algorithms with different properties. The default CSP is “Office 97/2000 Compatible”. This is a CSP with some publicly known security issues. Spreadsheets that are secured with the “weak encryption (XOR)” or with the “Office 97/2000 Compatible” encryption type can be cracked easily.
To overcome this problem, use one of the strong encryption types provided by Microsoft Excel. You can change the encryption type to the strongest available CSP. For strong encryption, a minimum key length of 128 bits is required, for example, ‘Microsoft Strong Cryptographic Provider’.
You can also encrypt and password protect Excel files with strong encryption type using the Aspose.Cells API.
To implement file encryption in Microsoft Excel (for example 2007):
The code examples below apply strong encryption on a file and set a password.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "Book1.xlsx");
// Instantiate a Workbook object.
// Open an excel file.
const workbook = new AsposeCells.Workbook(filePath);
// Specify Strong Encryption type (RC4,Microsoft Strong Cryptographic Provider).
workbook.setEncryptionOptions(AsposeCells.EncryptionType.StrongCryptographicProvider, 128);
// Password protect the file.
workbook.getSettings().setPassword("1234");
// Save the Excel file.
workbook.save(path.join(dataDir, "encryptedBook1.out.xls"));
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.