View Single Post
Old 03-14-2012, 03:25 AM   #323
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,638
Karma: 306652114
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by kovidgoyal View Post
The first 1040 bytes of the *compressed* font are XORed with a (seemingly randomnly generated) key. I have committed code to calibre to de-obfuscate them. Given that the MOBI format itself is a much harder form of obfuscation, I have no idea why amazon felt the need to implement a XOR on top of it, but then I have no idea why Amazon makes have the technical decisions it does...
1040 bytes sounds like the IDPF font obfuscation algorithm.
http://idpf.org/epub/20/spec/FontMan....0.1_draft.htm
http://idpf.org/epub/30/spec/epub30-...nt-obfuscation

In which case, the key might also be the one specified in those documents. But since the XOR key is given in the file, I suppose it doesn't matter whether it is or not.

I'm not sure that de-obfustication code should go in calibre, unless any output is re-obfusticated. Simple though it is, I think it could be argued that the obfuscation is a digital rights management method, and that removing it might make calibre an illegal bit of software under the DMCA.
pdurrant is offline   Reply With Quote