Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-19-2009, 05:40 AM   #1
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: 29,363
Karma: 83792800
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
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?
pdurrant is online now   Reply With Quote
Old 09-19-2009, 08:16 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,801
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
Quote:
Originally Posted by pdurrant View Post
Does anyone know of any ePub reader that will read IDPF obfusticated fonts? I'd like to test both
Not yet... but I'd be glad to add the option to my epub2pdf and epub-read scripts.
Jellby is offline   Reply With Quote
Old 09-22-2009, 05:23 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,801
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
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)?
Jellby is offline   Reply With Quote
Old 09-22-2009, 07:43 AM   #4
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: 29,363
Karma: 83792800
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
I'm not sure that your epub to pdf script should convert fonts that are encrypted.

Quote:
Originally Posted by Jellby View Post
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)?
pdurrant is online now   Reply With Quote
Old 09-22-2009, 10:47 AM   #5
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,801
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
Quote:
Originally Posted by pdurrant View Post
I'm not sure that your epub to pdf script should convert fonts that are encrypted.
Why not? They'd only be stored in a temporary directory (which is deleted upon termination) and subset-embedded in the final PDF.
Jellby is offline   Reply With Quote
Old 09-22-2009, 12:24 PM   #6
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: 29,363
Karma: 83792800
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
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!)

Quote:
Originally Posted by Jellby View Post
Why not? They'd only be stored in a temporary directory (which is deleted upon termination) and subset-embedded in the final PDF.
pdurrant is online now   Reply With Quote
Old 09-22-2009, 01:10 PM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,801
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
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.
Jellby is offline   Reply With Quote
Old 09-22-2009, 02:16 PM   #8
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: 29,363
Karma: 83792800
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
You are right, of course.

Quote:
Originally Posted by Jellby View Post
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.
pdurrant is online now   Reply With Quote
Old 09-24-2009, 02:53 PM   #9
JSWolf
Suspended
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
Posts: 35,392
Karma: 16147088
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Jellby View Post
Why not? They'd only be stored in a temporary directory (which is deleted upon termination) and subset-embedded in the final PDF.
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.
JSWolf is offline   Reply With Quote
Old 09-24-2009, 03:34 PM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 5,801
Karma: 4027751
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon
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
That's for the IDPF scheme, the ADE scheme would be similar, I guess.

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.
Jellby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded fonts, Calibre, and choice of fonts AlexBell ePub 8 05-30-2010 06:00 AM
iPad Embedded Fonts JSWolf Apple Devices 24 04-26-2010 02:41 PM
Classic Support for embedded fonts in sideloaded EPUBs ? nycaleksey Barnes & Noble NOOK 6 02-25-2010 11:10 PM
Embedded fonts in epub erik5000 ePub 7 12-08-2009 11:55 AM
ePub + Embedded Fonts Cygfrydd ePub 11 03-02-2009 05:56 PM


All times are GMT -4. The time now is 04:58 AM.


MobileRead.com is a privately owned, operated and funded community.