EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Invalid decryption mode

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#11588
Posted: 11/06/2009 15:19:32
by Cezar Botez (Priority Standard support level)
Joined: 08/28/2009
Posts: 22

If I use SecurePDF (sample project installed with SBB) to encrypt a PDF document, I am able to check if encrypted, then decrypt and sign it.

If I use Adobe 9.2 to encrypt the document, Tiny PDF Processor (Processor folder) returns that the document is "neither encrypted, nor signed" (TElPDFDocument.Encrypted returns false), but, on the other hand, TinySigner (Signer folder) refuses to sign it with an “Cannot sign encrypted document. Invalid decryption mode.” error.

After the owner password has been intialized with the correct value, TElPDFPasswordSecurityHandler.IsOwnerPasswordValid() returns true (correct value) in both cases.

Please find attached the document. Owner password is 123.

Is there something specific I need to do to be able to check whether the document has been encrypted and then decrypt it?

Thank you,
Cezar


[ Download ]
#11590
Posted: 11/06/2009 16:51:05
by Dmytro Bogatskyy (EldoS Corp.)

From: https://www.eldos.com/forum/read.php?FID=7&TID=2055 (it's describe your situation)
Quote
The document you have provided stores some of its data in so-called object streams. The possibility of storing document data in object streams is a feature of newer versions of PDF format. Though relatively efficient with regard to the final document size, object streams are quite inconvenient objects when the document is being encrypted. The presence of such objects in
the encrypted document does not allow the reading party to process the document at all without having valid decryption information. Please handle the TElPDFDocument.OnDecryptionInfoNeeded event and set the passwords inside the corresponding handler to make TElPDFDocument process the document fine.

In your case the document is encrypted with an empty User Password.
You doesn't handle OnDecryptionInfoNeeded event so an empty password is used, and the document successfully decrypted in Open method.
#11620
Posted: 11/09/2009 17:37:30
by Cezar Botez (Priority Standard support level)
Joined: 08/28/2009
Posts: 22

Quote
Bogatskyy wrote:
In your case the document is encrypted with an empty User Password.
You doesn't handle OnDecryptionInfoNeeded event so an empty password is used, and the document successfully decrypted in Open method.

Thank you Bogatskyy. I knew about the event, but I didn't know to what extent I needed to use it. Handling both the owner and the user passwords in the OnDecryptionInfoNeeded event worked as expected.

Cezar

Reply

Statistics

Topic viewed 1342 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!