readium/readium-sdk

Content Module fallback (EPUB encrypted with unknown DRM scheme)

danielweck opened this issue · 1 comments

See:
#274 (comment)

The current fallback is to attempt to load the EPUB without Content Module, but this will probably lead to fatal crashes because of libxml trying to load scrambled XML data.
So, in order to degrade gracefully, one option is to check that META-INF/encryption.xml does not contain any encrypted resources (other than obfuscated fonts).

The most likely case where this might occur is if a user attempts to open an encrypted book they got from the iBooks store. Here is an example of an encryption element from a Disney book obtained from the iBooks store.

<e:EncryptedData>
    <e:EncryptionMethod Algorithm="http://itunes.apple.com/dataenc"/>
    <d:KeyInfo>
      <d:KeyName>1</d:KeyName>
    </d:KeyInfo>
    <e:CipherData>
        <e:CipherReference URI="OEBPS/toc.xhtml"/>
    </e:CipherData>
</e:EncryptedData>