django-commons / drf-excel

An XLSX spreadsheet renderer for Django REST Framework.
BSD 3-Clause "New" or "Revised" License
217 stars 40 forks source link

Export as password protected file #81

Closed RakeshAMD closed 8 months ago

RakeshAMD commented 8 months ago

For tables which contains sensitive data, How to export the excel as password protected file.

ie, only if we enter the password the excel file should open.

FlipperPA commented 8 months ago

Howdy @RakeshAMD, we use OpenPyXL under the hood to create the xlsx spreadsheet. Password protection for Excel spreadsheets is basic at best, and most security experts agree that it shouldn't be used, in any case.

OpenPyXL also does not support the newer full-encryption feature set, so it offers no real protection. This is stated in their docs: https://openpyxl.readthedocs.io/en/stable/protection.html

Short answer: we can't add this feature because it doesn't exist upstream, and password protecting Excel files should never be relied on for security.