|
|||||||
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features. If you have any problems with the registration process or your account login, please contact us. Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience. |
| Kindle Developer's Corner Linux, hacking and development of software and hardware |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 2,851
Karma: 6239
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Adventures in discovering the K4PC PID.
Anyone done this yet? Anyone want to detail their experiences so far?
Perhaps if we detail this in this thread we can finally make the breakthrough we want. Derek |
|
|
|
|
Enthusiast
|
|
|
|
#2 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 219
Karma: 2613
Join Date: Mar 2009
Location: Greenwood, SC
Device: Kindle 2
|
What good is the 'pid'? The book key isn't encrypted in the same way as normal mobi books in k4pc books. Who knows if a mobiPID is even used anymore in the new key encryption. This is fairly obvious if you look at the DRM sections from two different books.
|
|
|
|
|
|
#3 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 2,851
Karma: 6239
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
Derek |
|
|
|
|
|
|
#4 |
|
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 5,759
Karma: 10704
Join Date: Mar 2006
Location: Mississippi, USA
Device: iLiad, Kindle 1, EZ Reader Basic and Pocket Pro
|
Perhaps it is worth summarizing what happens in a normal MOBI ebook. Here is what I think happens, but I am nor certain this is right and I am skipping over some technical details.
The actual encryption is done before the ebook leaves the publisher, with a (book specific) key. Only a small part of this file is then customized for the 1-4 PIDs allowed in a delivered MOBI ebook. The customization encodes an encrypted marker of the PID and the book key in the file, and this can then be extracted by entering the PID (e.g. by a MobiPocket Reader or by mobidedrm). So the process is PID -> book key -> plain text. The K4PC AZW files are largely the same as AZWs for other devices, in other words the book key and the basic encryption is the same. What clarknova is suggesting is that Amazon has changed the PID -> book key process. This is plausible, because Amazon only needs 1 PID per file (not 4) and in principle they could do anything that used the same basic structure as the standard MOBI file. If this is the case, then this would be disappointing because MobiPocket never designed the PID to be a secret. Since it is only 8 characters long, with 36 values per character, it is in principle discoverable using a Brute force attack. In effect the PID is a password, subject to Password cracking. I don't know how long it would take to crack the PID from a MOBI file, but this seems practical even using brute force and there might be faster ways. This is a complete waste of effort for standard PIDs, because we already know them. Even the "secret" PIDs of Kindles and the Kindle iPhone app were discovered by other techniques, not relying of cracking the PID from a MOBI file. Since we don't know the PID of K4PC, cracking might be appropriate - but only if we know that K4PC is actually using a conventional MOBI PID. Note that most DRM schemes are not broken by brute force or other attacks on the cipher, but rather on some flaw in the system that allows discovering the PID (or whatever). This "flaw" has to be there because DRM is being asked to do the impossible. The reader app is in the possession of the "attacker" and it has to know how to decrypt the ebook. Last edited by wallcraft; 11-26-2009 at 11:38 PM. |
|
|
|
|
|
#5 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 2,851
Karma: 6239
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
Derek |
|
|
|
|
|
|
#6 |
|
Junior Member
![]()
Posts: 6
Karma: 10
Join Date: Nov 2009
Device: none
|
For version 1.0.25338.0 (MD5 348F25D496FBDDF2CE4A9CE0C2A7E1ED) deregister K4PC, set a breakpoint at offset 005B2A59, register again, and look at the stack
0012C144 01A13110 ASCII "https://firs-ta-g7g.amazon.com/FirsProxy/registerDevice?deviceType=AXXXXXXXXXXXXS&deviceSer ialNumber=PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX3 &deviceName=%25FIRST_NAME%25's%20Kindle%20for%20PC %25DUPE_STRATEGY_2ND%25&pid=NXXXXXXK" Note that the PID is 8 chars long. MobiDeDRM failed at decrypting after removing the checkum check. |
|
|
|
|
|
#7 | |
|
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 5,759
Karma: 10704
Join Date: Mar 2006
Location: Mississippi, USA
Device: iLiad, Kindle 1, EZ Reader Basic and Pocket Pro
|
Quote:
Something I did not make explicit in my description above is that MOBI allows up to 4 PIDs per ebook, i.e. has "slots" for 4 PIDs in the file structure, but Amazon only uses 1 PID per ebook. In other words each AZW file will only work on one device. |
|
|
|
|
|
|
#8 |
|
reader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 5,759
Karma: 10704
Join Date: Mar 2006
Location: Mississippi, USA
Device: iLiad, Kindle 1, EZ Reader Basic and Pocket Pro
|
Is the PID what you get by running kindlepid on the deviceSerialNumber? It is clearly being generated on the PC, hopefully from some local unique id.
Last edited by wallcraft; 11-27-2009 at 09:37 AM. |
|
|
|
|
|
#9 | ||
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 219
Karma: 2613
Join Date: Mar 2009
Location: Greenwood, SC
Device: Kindle 2
|
Quote:
This would be faster if you know the PID is a Kindle/Mobi pid (Which ends in either $ or * and limits the combinations to 105046700288) However for a Kindle 4 PC or iPod these increase to 1785793904896 combinations. I got lucky and it only took me about a day to brute force my Kindle 4 PC pid.Quote:
Now if you look at books for your Kindle 4 PC, you'll see that "00 00 00 43" is encrypted DIFFERENTLY on every* book. This means they've introduced an IV into the book key encryption method. * - So how did I brute force my PID when the encryption's changed? Because when I first installed K4PC I downloaded one book out of my library. It came across with the old encryption. Every book since has had the new encryption, and the only way I can readily tell which encryption method the book will use is by that EXTH 208 record (you know the one: "atv:kin:1:{base64 data}:{base64 data}" ). If that record has a length of 0xC7, then the book seems to use the old (normal) book key encryption. If the length is 0xDB, then it's the new method. |
||
|
|
|
|
|
#10 | |
|
Junior Member
![]()
Posts: 6
Karma: 10
Join Date: Nov 2009
Device: none
|
Quote:
FWIW, I found that the PID actually IS used to decrypt books (only tried on www.amazon.com/gp/product/B002ENBM7G , prc format) |
|
|
|
|
|
|
#11 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 2,851
Karma: 6239
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
Derek |
|
|
|
|
|
|
#12 | ||
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 219
Karma: 2613
Join Date: Mar 2009
Location: Greenwood, SC
Device: Kindle 2
|
Quote:
Quote:
Now, why don't you try newly downloading a free book (like http://www.amazon.com/gp/product/B000FBJBA4) and see how far that PID gets you. Once that fails, you could also try deleting that book you listed before, re-downloading and seeing if it still comes down with the old encryption method. |
||
|
|
|
|
|
#13 | |
|
Junior Member
![]()
Posts: 6
Karma: 10
Join Date: Nov 2009
Device: none
|
Quote:
> Mobipocked PID for iPhone serial# {SERIAL} is S*1*S*H*AT The PID that's sent to the server (and used in decryption AFAICT is N*I*7*F* [calc checksum: VZ]) They do NOT match
|
|
|
|
|
|
|
#14 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 2,851
Karma: 6239
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
Derek |
|
|
|
|
|
|
#15 | |
|
Now I'm *2* Kindle-icious
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 5,275
Karma: 32382
Join Date: Apr 2008
Location: Long Drive, Calinadia Candafornia
Device: Kindle 1 & Kindle Deux
|
Quote:
__________________
Visual Kindle Guide, Kindle Myths and Partial Truths, Links Every Kindle Owner Should Have The Screensaver Hack for all flavors of 2.3 updated K2 and KDX - & - The Font Hack for all flavors of 2.3 updated K2 and KDX The Screensaver Hack for all 2.5.x Kindles - & - The Font Hack for all 2.5.x Kindles |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Opus Opus PID? | Raoul Applefish | Bookeen | 13 | 07-16-2010 07:36 AM |
| Free on Kindle - Discovering Dani | koland | Deals, Freebies, and Resources | 0 | 09-28-2009 09:57 AM |
| Identifying PID | f64club | Mobi | 15 | 06-22-2009 12:10 PM |
| Kindle PID from Mobi PID - can anyone do it? | delphidb96 | Workshop | 2 | 04-27-2009 04:42 PM |
| PID | riverhorus | Workshop | 2 | 07-06-2008 01:05 PM |