Encryption, EPUB DRM

6 posts / 0 new
Last post

I have some questions about EPUB specification.

1. As far as I know, I need to encrypt AFTER zip compression when make a DRM(Digital Rights Management) EPUB file. Compress first and then Encrypt. Right?
2. How about compression level? It must be 9? Or, 0 or 9 either way?
3. I encrypt ONLY data area after compression. Not a header. But, I’m not sure that need to correct CRC in zip header.
If I do not correct CRC in zip header, Zip application will not be able to open zip file properly. That means I should correct CRC after encryption?
Please see the followings.
-------------------------------------
Encrypted data replaces unencrypted data in an OCF Abstract Container. For example, if an image named photo.jpeg is encrypted, the contents of the photo.jpeg resource should be replaced by its encrypted contents. When stored in a ZIP container, streams of data must be compressed before they are encrypted and Deflate compression must be used. Within the ZIP directory, encrypted files should be stored rather than Deflate-compressed.
-------------------------------------
4. Another question is about embedded font.
Fonts in EPUB file should be encrypted some special way or the same as other files?

Thanks in advance,

1) Yes, as noted in the encryption section you cite: When stored in a ZIP container, streams of data must be compressed before they are encrypted and Deflate compression must be used.

2) Again, to quote the spec: In the local file header table, OCF ZIP Containers must set the compression method field to the values 0 or 8. OCF Processors must treat any other values as being in error.re

3) Not sure I follow. The part about the abstract container is not relevant to the actual encryption and storage in the zip archive, as I read it (i.e., you don't literally have to put the data in the zip container and then encrypt it in place and then fix the headers, if that's what you're suggesting doing), The abstract container is the abstract representation of the file system. But my experience is on the accessibility side where encryption isn't often encountered, so I might not be the best authority he.

4) There is an obfuscation method for fonts (not encryption) defined in the specification, but its use is not required. You can encrypt a font like any other file.

Hi Matt--

Thanks very much for the explanation and very helpful advice.

Dear Kjoon,
Did you get success in building DRM foe epub? I am new to Epub and DRM. I want to write /apply own DRM and modify reader for that DRM.

- I have added rights.xml (default code from idpf.org) to create first level protection based on authentication. But it did not do anything.
- For second level protection, added encryption.xml(sample given in idpf.org). When I tried to open book in reader it gives msg "This file is locked by DRM". means DRm applied , but from download I am able to get the epub, rename as zip and the content is available.

Please help me understanding the steps to encrypt the epub and appy DRM on Epub.

Dear Kjoon,
Did you get success in building DRM foe epub? I am new to Epub and DRM. I want to write /apply own DRM and modify reader for that DRM.

- I have added rights.xml (default code from idpf.org) to create first level protection based on authentication. But it did not do anything.
- For second level protection, added encryption.xml(sample given in idpf.org). When I tried to open book in reader it gives msg "This file is locked by DRM". means DRm applied , but from download I am able to get the epub, rename as zip and the content is available.

Please help me understanding the steps to encrypt the epub and appy DRM on Epub.

hi matt,
means first I will zip the files then encrypt the zip folder and then create epub from the encrypted zip?

Secondary menu