09-19-2009, 06:40 AM | #1 |
The Grand Mouse 高貴的老鼠
Posts: 72,513
Karma: 309063598
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Encypted Embedded Fonts in ePubs
I'm starting a new thread for this.
I now have working Python scripts for encrypting the fonts in ePubs, one for the Adobe method and one for the IDPF method. Since the code is very similar, I'm pretty sure I have the code for the IDPF method done correctly. My Adobe code produces ePubs that ADE will read, but which are obfusticated sufficiently that operating systems can't read them. My IDPF code produces ePubs that look right, but that ADE will not read. So at the moment it looks like going the Adobe route is best. I still need to add a bit to my code a bit, (currently I have to add the encryption.xml file by hand), but it should be available by the end of next week. Does anyone know of any ePub reader that will read IDPF obfusticated fonts? I'd like to test both I'm also pondering whether it would be possible to include /both/ encryptions in some way. Anyone got any ideas? |
09-19-2009, 09:16 AM | #2 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
Advert | |
|
09-22-2009, 06:23 AM | #3 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Is there a way to know which obfuscation method is used by a particular ePUB, other than trying both and seeing which one works (gives correct font files)?
|
09-22-2009, 08:43 AM | #4 |
The Grand Mouse 高貴的老鼠
Posts: 72,513
Karma: 309063598
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
|
09-22-2009, 11:47 AM | #5 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
Advert | |
|
09-22-2009, 01:24 PM | #6 |
The Grand Mouse 高貴的老鼠
Posts: 72,513
Karma: 309063598
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
I see what you mean. I suppose that would be OK.
(Having just got a good response from one font company I don't want to jinx anything!) |
09-22-2009, 02:10 PM | #7 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Of course, it would be possible to "hack" into the temporary directory to get the un-obfuscated font, or to copy the code that un-obfuscates it... but I guess someone willing and knowledgeable to do that, would also be able to write the code or to get it from somewhere else. After all, the obfuscation does not prevent anything but trivial copying of font files.
|
09-22-2009, 03:16 PM | #8 | |
The Grand Mouse 高貴的老鼠
Posts: 72,513
Karma: 309063598
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
You are right, of course.
Quote:
|
|
09-24-2009, 03:53 PM | #9 |
Resident Curmudgeon
Posts: 76,421
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Because they are going to be stored (even temp) unencrypted, it's going to be fairly easy to get at them. So unless you can deal with the fonts in memory only, don't do it.
|
09-24-2009, 04:34 PM | #10 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Well, it turns out to be surprisingly simple to obfuscate/deobfuscate fonts with just with bash and xxd, provided one has the key:
Code:
for line in $(xxd -p -c 20 -l 1040 $file); do for i in $(seq 0 2 39); do if [[ ${line:$i:2} == '' ]]; then break; fi printf "%02x" $(( 0x${line:$i:2} ^ 0x${key:$i:2} )) done done | xxd -r -p - $file As for including the code in epub2pdf or similar scripts, I'll probably not distribute it but I don't think there's any (legal or moral) problem in doing so. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedded fonts, Calibre, and choice of fonts | AlexBell | ePub | 8 | 05-30-2010 07:00 AM |
iPad Embedded Fonts | JSWolf | Apple Devices | 24 | 04-26-2010 03:41 PM |
Classic Support for embedded fonts in sideloaded EPUBs ? | nycaleksey | Barnes & Noble NOOK | 6 | 02-26-2010 12:10 AM |
Embedded fonts in epub | erik5000 | ePub | 7 | 12-08-2009 12:55 PM |
ePub + Embedded Fonts | Cygfrydd | ePub | 11 | 03-02-2009 06:56 PM |