officefileapi-devexpress-dot-spreadsheet-dot-encryptionoptions.md
Gets or sets the encryption type for the current workbook.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
EncryptionType Type { get; set; }
Property Type As EncryptionType
| Type | Description |
|---|---|
| EncryptionType |
One of the EncryptionType enumeration values indicating the type of the encryption.
|
Available values:
| Name | Description |
|---|---|
| Compatible |
Standard encryption for Open XML files that uses a binary EncryptionInfo structure. The default encryption algorithm is AES-128 and SHA-1 is used as a hashing algorithm. Binary files (XLS) are encrypted by 40-bit RC4 encryption.
| | Strong |
Agile encryption for Open XML files that uses an XML EncryptionInfo structure. The default encryption algorithm is AES-256 and SHA512 is used as a hashing algorithm. Binary files (XLS) are encrypted by RC4 CryptoAPI encryption.
|
You can access this nested property as listed below:
| Object Type | Path to Type |
|---|---|
| DocumentSettings |
.Encryption .Type
|
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Type property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-spreadsheet-load-and-save-a-password-encrypted-files/CS/EncryptionExample/Form1.cs#L50
IWorkbook workbook = spreadsheetControl1.Document;
workbook.DocumentSettings.Encryption.Type = (EncryptionType)Enum.Parse(typeof(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString());
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString();
winforms-spreadsheet-load-and-save-a-password-encrypted-files/VB/EncryptionExample/Form1.vb#L51
Dim workbook As IWorkbook = spreadsheetControl1.Document
workbook.DocumentSettings.Encryption.Type = CType([Enum].Parse(GetType(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString()), EncryptionType)
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString()
See Also