Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XLSX with passwords #102

Closed
golddranks opened this issue Nov 20, 2017 · 2 comments
Closed

XLSX with passwords #102

golddranks opened this issue Nov 20, 2017 · 2 comments

Comments

@golddranks
Copy link

It seems that no Rust crate at the moment supports encrypted spreadsheets but is there any plans? It seems that password support is by no means a trivial feature, since there are many different schemes to encrypt an XLSX file. I don't even know if some are more common than others: http://poi.apache.org/encryption.html

I think that the Apache POI library is the gold standard standard for supporting stuff: https://github.com/apache/poi

As one step towards a better direction, it would be nice if it could recognize and report the error correctly, as it does with the XLS format.

@golddranks
Copy link
Author

It seems that it's possible to get the encryption method from the file like this:

https://github.com/apache/poi/blob/2b4f9448830a532c91d9c41f67241ae89debdcf1/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java#L105

So, either you use XOR padding, or then you can read a versionMajor and a versionMinor from the file (not sure if the DocumentInputStream does something funny in the middle or is it just a representation of the bytes...); then you compare those version numbers and possibly flags to what different formats have...

@saks
Copy link
Contributor

saks commented Nov 15, 2023

I recently came across an xslx file that is reported as CDFV2 Encrypted by file that failed with InvalidArchive error from zip crate which is quite misleading. I guess it would be nice to have a detection for a password protected spreadsheet and return an error at least.

I'm happy to look into this as a contribution if crate authors are seeing such feature as a good addition to calamine.
cc: @tafia

@saks saks mentioned this issue Nov 28, 2023
@tafia tafia closed this as completed in 7342e2d Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants