![]() |
#31 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Ok, I may have been a little too pessimistic when speaking of millions of years.
Here's a little thought experiment. From all that I know, the Kindle devices use a 10-character alphanumeric code derived from the serial number of the Kindle. Assuming that only A-Z and 0-9 are valid characters (which is a wrong assumption, because some special characters may also appear), that leaves us with 36^10 = 3,656,158,440,062,976 possible keys. Now for the sake of simplicity, assume that we can try 1,000,000 keys per second. To try every single key, that means we'd need 3656158440 seconds. That is 1015600 hours, or 42317 days, or 116 years. If you have 116 computers, you can thus effectively search the entire key space within a year. The good news is that on average, you'd expect to be done at about half the time. In the best case, you're done immediately, because the first key you try matches, and in the worst case, the very last key you try matches. |
![]() |
![]() |
![]() |
#32 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
The real question is, does kindle ebook DRM use a good (slow) secure hash function for its key generation? |
|
![]() |
![]() |
![]() |
#33 | |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Edit: I may have missed the point. I don't know how many decryption "attempts" are feasible per second, that could well be much less. Edit2: some further reading: http://security.stackexchange.com/qu...mized-cray-xe6 Last edited by ixtab; 08-23-2012 at 01:01 AM. |
|
![]() |
![]() |
![]() |
#34 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
We typically used PBKDF2 key generation when I worked on this stuff. It converts a text key (passphrase, or serial number in this case) into a larger 128-bit key. It is designed to run slowly to prevent exhaustive brute-forcing.
If you plan to search the raw keyspace without doing slow key generation, you have to search a much larger keyspace (128-bits) which would take a LONG time. Slow key generation is WHY encryption (done well) is still secure. Even for rainbow tables, it took a LOT of CPU time to generate those tables. You can crack the raw keyspace quickly by using rainbow tables to lookup the key precursors for a quick and small raw keyspace subset search. I am no encryption expert -- but that is how I understand it. It has been awhile, so I may not remember it all correctly... P.S. You are talking about SLOWLY GENERATING 10 alphunumeric character keys, or quickly searching a HUGE 128-bit raw keyspace. Either way takes a lot of time... EDIT: Again, I do not know how the kindle DRM does it. I suspect that generating keys for all possible kindle serial numbers would be very slow. Using a fast hash for key generation would be vulnerable to brute-forcing the much smaller serial-number space instead of the full 12-bit encryption keyspace, so it would be foolish to use a fast hash for DRM key generation. After you have the right key, decryption is fast. But FINDING the right key is slow, which is why you need to know the serial number of the kindle that owns the DRMed media, or otherwise extract its key from it. Last edited by geekmaster; 08-23-2012 at 01:40 AM. |
![]() |
![]() |
![]() |
#35 | ||
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
http://en.wikipedia.org/wiki/PBKDF2 Quote:
EDIT2: PBKDF2 (or other) key stretching algorithms are also used to severely slow down dictionary-based attacks. Last edited by geekmaster; 08-23-2012 at 02:03 AM. |
||
![]() |
![]() |
![]() |
#36 | |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
So if I was using that unoptimized program to brute-force the key for a book, it would take pretty much exactly one month to go through the entire keyspace. Parallelize this to 100 quad-core machines using AWS, and you have it cracked in at most 2 hours. Spoiler:
![]() |
|
![]() |
![]() |
![]() |
#37 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
The calculation on brute forcing Kindle keys is flawed in two ways.
(i) The key is actually only eight characters. The two other characters are a checksum. (ii) Kindle ebook keys are not limited to A-Z and 0-9. One error cancels out the other - it's still impractical to brute-force a Kindle ebook's DRM key. |
![]() |
![]() |
![]() |
#38 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
You're right... but actually, it's a bit different. I had assumed so far that only the PID (which is in turn derived from the serial number) constitutes the key, in which case it would indeed have been even worse than what I wrote above (the PID is really only 7 characters + "*" + 2-character checksum), and those 7 characters don't even span the entire possible range (O and 0 are excluded).
However, providing the correct PID, but a wrong serial number, also fails to decrypt the file. Thus, the key space is more likely to be something like 36^13 again, which leads back to the first calculation, multiplied by another factor of ~ 50000 (yes, the serials are 16 characters, but there are only few valid "prefixes") Last edited by ixtab; 08-23-2012 at 04:32 AM. |
![]() |
![]() |
![]() |
#39 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73
Karma: 2634
Join Date: Sep 2010
Device: none
|
Right, that same America that has a legislation that makes DRM breaking outlawed (DMCA)? That tried to push the ACTA, SOPA and other inane legislations using coercion to the rest of the world? At least in my country, breaking DRM for personal use is not illegal, and I can watch DVD and Blurays on my Linux system. But thanks to the land of the free, this may not last very long.
|
![]() |
![]() |
![]() |
#40 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() They must be relying on the DMCA to protect them, rather than using "REAL" security practices. It is still a lot faster to crack the DRM using information obtained from an authorized reading device. EDIT: You did not say how many hash rounds you used in your test. Even if it is more than a single round, testing 1,000,000 keys in 35 seconds may require more rounds for good protection. Last edited by geekmaster; 08-23-2012 at 08:58 AM. |
|
![]() |
![]() |
![]() |
#41 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
To be able to read the book, the user must have both the key and the decryption algorithm. It's just a question of how hard it is to do the reverse engineering. |
|
![]() |
![]() |
![]() |
#42 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,005
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#43 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
The various sites that claim to generate a PID from a Kindle serial number are only useful for Kindle 1 and early firmware Kindle 2. Kindles, since the later Kindle 2 firmwares, have not had a per-device PID. Instead the Kindle's serial number is combined with information from the book's metadata to produce a per-book 8 digit PID. A similar mechanism is used for Kindle for PC and Kindle for Mac, and I think for Kindle for Android, using some IDs from the PC or Mac instead of a Kindle serial number. Only Kindle for iOS still (until very recently) used a fixed PID for all kindle ebooks on the device, which was derived from the iOS device's UUID. However, since Apple have banned the use of the UUID by iOS apps, new installations of Kindle for iOS use some new method of key generation. But all the methods eventually lead to a 8-digit (64-bit) key to the base encryption. |
|
![]() |
![]() |
![]() |
#44 | |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#45 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
I don't see that either is likely to happen. |
|
![]() |
![]() |
![]() |
Tags |
azw, drm, kindle |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
AZW de-DRM'd to HTMLZ | Caleb666 | Conversion | 20 | 12-22-2017 05:07 AM |
Remove Drm from AZW | lullaby88 | Amazon Kindle | 8 | 12-10-2011 05:23 PM |
Remove DRM from AZW files | Dellboy67 | Kobo Reader | 1 | 12-08-2011 07:45 PM |
how to convert to azw files ? | geordiejohn | Calibre | 5 | 12-09-2010 12:41 PM |
how to convert azw files? | lizzybeth05 | Amazon Kindle | 11 | 02-17-2010 01:47 PM |