EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Invalid encrypted data

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 02/11/2015 08:35:56
by David ErÅ¡il (Standard support level)
Joined: 01/15/2013
Posts: 34


I have just came across an issue with password secured PDF document.
When I try to open it providing the correct password, I get EElPDFSecurityHandlerError: Invalid encrypted data.
I am able to open other protected documents, so I guess my code is correct. Also Adobe Reader and pdftron PDFNet SDK can open (and display) it just fine. Thus I assume the document is ok (no problems found in Adobe Preflight)

My code is as follows:

TElPDFDocument mDocument = new TElPDFDocument();
mDocument.OnDecryptionInfoNeeded += ((object Sender) =>
   // checking if the document is encrypted and trying to decrypt it
   if (mDocument.Encrypted)
      // decrypting the document
      if (mDocument.EncryptionHandler is TElPDFPasswordSecurityHandler)
         // trying the supplied password
         bool PasswordValid = false;
         TElPDFPasswordSecurityHandler PasswordHandler = (TElPDFPasswordSecurityHandler)(mDocument.EncryptionHandler);
         // Check for owner password
         PasswordHandler.OwnerPassword = correctPassword;
         if (PasswordHandler.IsOwnerPasswordValid())
            PasswordValid = true;
            // Check for user password
            PasswordHandler.UserPassword = correctPassword;
            if (PasswordHandler.IsUserPasswordValid())
               PasswordValid = true;

         if (!PasswordValid)
            Log(" !invalid password");
         Log(" !the document is encrypted with unsupported security handler");


The exact thrown exception is:
SBPDF.EElPDFSecurityHandlerError: Invalid encrypted data
   in SBPDF.TElPDFSecurityHandler.DecryptObject(TElPDFObject Obj)
   in SBPDF.TElPDFDocument.DecryptCallback(TElPDFObject Obj)
   in SBPDF.TElPDFDocument.EnumerateStringsAndStreams(TSBPDFCallbackFunc Callback, Boolean IncludeStreams, Int32 Start, ArrayList IncludeObjects, Boolean DecryptionMode)
   in SBPDF.TElPDFDocument.Decrypt()
   in SBPDF.TElPDFDocument.LoadFromStream(Stream Stream, Int32 Count)
   in SBPDF.TElPDFDocument.Open(Stream Stream)

Currently I am using the newest SBB build 12.0.266, but the same happens with 12.0.258.
Are you, by any chance, able to tell what can be wrong here?

The document is attached as txt, password is "test".

Posted: 02/11/2015 08:41:01
by Dmytro Bogatskyy (EldoS Corp.)

There is no attachment (the forum accepts only zip files).

I've moved the question to the helpdesk for investigation ( https://www.eldos.com/helpdesk/ ). You will see your (and only your) support tickets by following this URL. You will also get e-mail notifications about updates related to your support ticket.



Topic viewed 534 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!