View Single Post
Old 12-14-2009, 04:48 PM   #556
joblack
Wizard
joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.joblack ought to be getting tired of karma fortunes by now.
 
Posts: 1,752
Karma: 4382688
Join Date: Jul 2006
Location: Somewhere on earth
Device: Onyx Boox Tab X C
Quote:
Originally Posted by JohnTheRipper View Post
Hi joblack,

I was debugging the script, and found that the error was because of the lenght of the book session key in line 1196 (v3 of the script). Maybe there's something wrong in RSA decrypting so that the decryption of the streams does not work.

The RSA decryption is based in the AES key generated by ineptkey script. Maybe is not an AES CBC_MODE key for PDF older versions. i♥cabbages said that uses AES in CBC mode with a random IV... or maybe is not RSA with PKCS#1 v1.5 padding, who knows?

All of these questions influence the dump method, because my "decrypted" PDF has the correct structure.
Hey John

Perhaps that could be one solution for the problem

Bug fixes of pycrypto:
==========
2.1.0beta1


* Modified RSA.generate() to ensure that e is coprime to p-1 and q-1.
Apparently, RSA.generate was capable of generating unusable keys.
==========

Try it with a newer py crypto version.
---
It complains because the first item in the array isn't equal 02. I don't know why it compares it because in the PDF Reference nothing is mentioned about the 2 as a check value.

I haven't checked out the length but if the length is wrong as well (should be 16 Bytes) then something else got wrong.

A good idea from you ...

The Adobe PDF Reference reads a little bit cryptic so in the worst case someone has to dive into the assembly code of ADE (like ILC did).

You only use RSA for decrypting the main decryption key for the symmetric RC4 or AES decryption method who is doing the main work. Only using RSA would be too slow in processing (especially for ebook readers).

Last edited by joblack; 12-14-2009 at 05:03 PM.
joblack is offline   Reply With Quote