Open Deng-yongbiao opened 2 weeks ago
See also #88. The challenge will be that AES-encrypted data is indistinguishable from random noise. It's possible for numbers-parser to unpack the top-level document and spot that it has what looks like Numbers metadata, but no readable IWA files, and infer from this the document might be encrypted. But the only option would be to raise an exception on the Document()
class.
I noticed that if a numbers file is encrypted, then almost all iwa files in it are unreadable, that is, the iwa binary stream does not start with 0x00
The most recent commits on the GitHub main branch include a test for the existence of .iwph
in the document, which is an indication it's encrypted. Opening such a document will raise a UnsupportedError
.
According to some information on the Internet, encrypted documents are encrypted using ASE-128. So is there a simpler way to determine whether a numbers document is encrypted? I do not need to parse the content of the encrypted document.