View Single Post
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: 7,516
Karma: 18512745
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
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