Quote:
Originally Posted by kovidgoyal
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.