View Full Version : What in the world is a key file?


surrealmind
04-07-2010, 11:10 AM
Alright, my Internet searching has come up empty, so I am bringing my newbie problem here. Sometimes when I create an .imp file in eBook Publisher, the program generates a key file (BookName.key) along with the .imp file. I can load the book onto my EB1150, but some books created this way will not open. I get an error message about needing to check the book back out, or something along those lines. Again, it's strange because some books work fine this way while others fail. I've tried both standard methods of uploading the book: impserve and direct copy (of both files) onto the Smartmedia card.

So, what am I doing wrong, and is there any way to get eBook Publisher to generate an .imp file without a .key file? Have I accidentally turned on some kind of library-book timestamp in eBook Publisher? Thanks all for any help.

nrapallo
04-07-2010, 10:33 PM
So, what am I doing wrong, and is there any way to get eBook Publisher to generate an .imp file without a .key file? Have I accidentally turned on some kind of library-book timestamp in eBook Publisher? Thanks all for any help.

Yes, there is a very simple solution to your problem. Do not encrypt the .imp.

When using eBook Publisher, go to the "Edition Settings..." under the "Build Options" tab and un-check "Encrypt". You must have inadvertently checked it. :rolleyes:

The .key file holds the encryption information for Secure .imp, but it needs to be tied to your EBW1150's internal serial number for it to be read there. You cannot do that using the PC software as it doesn't know YOUR internal key.

Per Jeffrey Kraus-yao's excellent reverse-engineering of the .IMP format (http://krausyaoj.tripod.com/reb1200.htm):DATA.FRK File

Element text is extracted and placed in this file. Elements tags are replaced with control characters. This file can be compressed and encrypted with compression occuring before encryption. This file is compressed when the element <meta name="x-SBP-compress" content="on"/> is included in the <x-metadata> element of the package file. The compression algorithm used is LZSS. This file is encrypted when the element <meta name="x-SBP-encrypt" content="on"/> is included in the <x-metadata> element of the package file. The encryption algorithm used is DES. The 8 byte encryption key is in the SoftBook Edition Encryption Key File (.key) at offset 0x0C.

.key File

When an encrypted .imp file is created the DES encryption key is stored in a file with extension .key. The DES key is used to encrypt the content of file DATA.FRK after compression. This key is encrypted with the REB1200 device key and stored in resource !!ky.

offset 0x00: 4 bytes, constant 0x00000001
offset 0x04: 4 bytes, constant 0x00000000
offset 0x08: 4 bytes, constant 0x00000001
offset 0x0C: 8 bytes, DES key
offset 0x14: 4 bytes, constant 0x00000000

surrealmind
04-08-2010, 12:21 AM
You must have inadvertently checked it.

:smack: Okay, thanks Nick, problem solved. The real mystery is how anyone could possibly hit that checkbox accidentally, but alas, I somehow found a way.