Ubuntu

can't open AES-V3 encrypted PDF

Reported by Petzl on 2009-11-03
34
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Poppler
Fix Released
Medium
poppler (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: evince

Can't open a protected PDF in evince Document Viewer 2.28.1 (password 6 numbers)

After upgrading to 9.10

documents created with Scan-to-PDF Win 32 version unknown

ProblemType: Bug
Architecture: i386
CheckboxSubmission: 76a8aa15b9b313821aecb135faf02193
CheckboxSystem: ff566da66476072c7d009c06e8fcb80c
Date: Tue Nov 3 12:17:34 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/evince
Package: evince 2.28.1-0ubuntu1
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: evince
Uname: Linux 2.6.31-14-generic i686

Yes, this uses AESV3 encryption that we do not support at the moment, help implementing this feature more than welcome

Is there some document I can read to learn how to add a new encryption scheme?

I don't have much time for this, and actually I just need to open the files from that lecture so I can live with printing them to files from Acroreader, but at least I would like to implement detection of this encoding scheme so that we can print a more accurate error message, something like "this file is encrypted using AES-256, which libpoppler does not support yet".

Then I would look into adding the AES-256 decoding.
Are AES-128 and AES-192 supported?

Having specific pointers to source files and documentation pages (PDF spec or whatever) would greatly increase the odds of me being able to work on this. I don't have time to learn this whole codebase and specifications.

We don't really have documentation at this level. The applicable parts of poppler are in poppler/poppler/Decrypt.[cc,h] - you should be able to follow it from there.

AES in that context is AES128.

The applicable section of the PDF spec is 3.5. You can get the information on the AES256 variant at: http://www.adobe.com/devnet/acrobat/pdfs/adobe_supplement_iso32000.pdf

It might help to compare that to the original crypto (RC4, AES128) parts of the spec, so you can see the code that needs to be changed / added. That is available from http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf

Good luck!

Brad

In addition to Decrypt.[cc,h], you'll also need to modify SecurityHandler.[cc,h] and add to the enum in Stream.h.

Binary package hint: evince

Can't open a protected PDF in evince Document Viewer 2.28.1 (password 6 numbers)

After upgrading to 9.10

documents created with Scan-to-PDF Win 32 version unknown

ProblemType: Bug
Architecture: i386
CheckboxSubmission: 76a8aa15b9b313821aecb135faf02193
CheckboxSystem: ff566da66476072c7d009c06e8fcb80c
Date: Tue Nov 3 12:17:34 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/evince
Package: evince 2.28.1-0ubuntu1
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic
SourcePackage: evince
Uname: Linux 2.6.31-14-generic i686

Petzl (petzl) wrote :
Petzl (petzl) wrote :

It Doesn't accept the password ...

Dave Walker (davewalker) wrote :

Hi Petzl,

Thanks for reporting this, would you be able to supply a sample PDF document that doesn't work as expected with evince, this will allow the bug to be easily reproduced.

Thanks.

Changed in evince (Ubuntu):
status: New → Incomplete
Petzl (petzl) wrote :

The password of this file is 975331

Dimitrios Symeonidis (azimout) wrote :

Confirmed on Karmic, importance medium.
Same issue in Okular, but it works in Xpdf and Acroread.

Changed in evince (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Medium
Andreas Moog (amoog) wrote :

Yes, this is a known problem with poppler, which doesn't support the AESV3 encryption yet, see http://bugs.freedesktop.org/show_bug.cgi?id=24752 for the upstream report.

summary: - can't open protected PDF in ubuntu 9.10
+ can't open AES-V3 encrypted PDF
affects: evince (Ubuntu) → poppler (Ubuntu)
Changed in poppler (Ubuntu):
status: Confirmed → Triaged
Changed in poppler:
status: Unknown → Confirmed
Changed in poppler:
importance: Unknown → Medium
Changed in poppler:
importance: Medium → Unknown
Changed in poppler:
importance: Unknown → Medium

Ghostscript (version tested: GPL Ghostscript 9.04) and MuPDF support it. Maybe there's some code that can be used for Poppler. For example, see this commit adding AESv3 support for MuPDF:

http://www.ghostscript.com/pipermail/gs-cvs/2011-February/012272.html

madbiologist (me-again) wrote :

I can open the file from comment #9 with Ubuntu 12.04 "Precise Pangolin" beta 1.

Packages: evince 3.3.90-0ubuntu2
          libpoppler19 0.18.4-1ubuntu1
          libcairo2 1.10.2-6.1ubuntu2

Changed in poppler (Ubuntu):
status: Triaged → Fix Released

Alberto: Are you able to open the file from this bug's description using recent versions of Evince and poppler?

I was unable to open the file from comment #9 of the Launchpad bug at https://bugs.launchpad.net/ubuntu/+source/poppler/+bug/472538 with Ubuntu 10.04 (which has libpoppler5 0.12.4-0ubuntu5.2) but I can open it with Ubuntu 12.04 "Precise Pangolin" beta 1, which uses the following packages.

Packages: evince 3.3.90-0ubuntu2
          libpoppler19 0.18.4-1ubuntu1

(In reply to comment #6)
> Alberto: Are you able to open the file from this bug's description using
> recent versions of Evince and poppler?
>
> I was unable to open the file from comment #9 of the Launchpad bug at
> https://bugs.launchpad.net/ubuntu/+source/poppler/+bug/472538 with Ubuntu 10.04
> (which has libpoppler5 0.12.4-0ubuntu5.2) but I can open it with Ubuntu 12.04
> "Precise Pangolin" beta 1, which uses the following packages.
>
> Packages: evince 3.3.90-0ubuntu2
> libpoppler19 0.18.4-1ubuntu1

    Well, I have Ubuntu 11.10, and it still behaves exactly as
before.
    - evince 3.2.1-0ubuntu2.2
    - libpoppler13 0.16.7-2ubuntu2

    I've tried running Ubuntu 12.04 Alpha 1 in a virtual machine,
and it's the same.
    - evince 3.2.1-1ubuntu1
    - libpoppler13 0.16.7-2ubuntu3

    Now I've run apt-get update+upgrade in the virtual machine,
which brings those packages to more or less the versions you have:
    - evince 3.3.90-0ubuntu3
    - libpoppler19 0.18.4-1ubuntu2

    At this point I still get the "Weird encryption info" error
(only visible when starting evince from the console), and it
fails to open the file with the correct password.
    I've opened it again with Acrobat Reader to make sure I was
not typing the wrong password. It works fine.

    I guess that if poppler understood the encryption scheme
it would not print the "Weird encryption info" message.

    Thanks for the follow-up.

The file from the OP is no longer available, but we do support AES-256 now (starting from 0.19.0).
I guess this bug can be closed, please reopen if I'm missing something.

(In reply to comment #8)
> The file from the OP is no longer available, but we do support AES-256 now
> (starting from 0.19.0).
> I guess this bug can be closed, please reopen if I'm missing something.

You are right, the original URL is no longer valid.
I've just tried with a local copy I had, and I still get the "Weird info" message from Evince.
I'll have to check that I'm using the correct password, but I'm quite sure I am.

I've put up a temporary copy of the file at:
http://matracas.org/tmp/Handout%20Management%20und%20Rechnungswesen%20WS%202009_2010.pdf

This is what happens when I start Evince from the command line:

00:02:34 ~$ evince /tmp/Handout\ Management\ und\ Rechnungswesen\ WS\ 2009_2010.pdf
Error: Weird encryption info
Error: Incorrect password

Please note that it says "Incorrect password" even before I've typed anything in the "Enter password" dialog.
When I enter the password, I get again those two messages and the dialog comes up again.

I just tried again with acroread, gave the password, and it works.

I've just tested and I don't get that message. Obviosuly I can't tell if it actually works because I don't have the password.
What poppler version do you have? Are you sure it is at least 0.19?

(In reply to comment #10)
> I've just tested and I don't get that message. Obviosuly I can't tell if it
> actually works because I don't have the password.
> What poppler version do you have? Are you sure it is at least 0.19?

Could it be that Ubuntu 12.10 still has libpoppler 18, not 19?
The package is called "libpoppler19", but it says "Version: 0.18.4-1ubuntu2":

00:08:58 ~$ dpkg --status libpoppler19
Package: libpoppler19
Status: install ok installed
Multi-Arch: same
Priority: optional
Section: libs
Installed-Size: 2111
Maintainer: Ubuntu Developers <email address hidden>
Architecture: amd64
Source: poppler
Version: 0.18.4-1ubuntu2
Depends: libc6 (>= 2.14), libfontconfig1 (>= 2.8.0), libfreetype6 (>= 2.2.1), libjpeg8 (>= 8c), liblcms2-2 (>= 2.2+git20110628-2), libpng12-0 (>= 1.2.13-4), libstdc++6 (>= 4.1.1), libtiff4
Pre-Depends: multiarch-support
Suggests: poppler-data
Description: PDF rendering library
 Poppler is a PDF rendering library based on Xpdf PDF viewer.
 .
 This package contains the shared core library.
Homepage: http://poppler.freedesktop.org/
Original-Maintainer: Loic Minier <email address hidden>
00:09:18 ~$ evince --version
GNOME Document Viewer 3.4.0

The evince package does not list libpoppler (any version) as a dependency, though:
Depends: libatk1.0-0 (>= 1.12.4), libc6 (>= 2.4), libcairo2 (>= 1.10.0), libevince3-3 (= 3.4.0-0ubuntu1.4), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgnome-keyring0 (>= 2.22.2), libgtk-3-0 (>= 3.0.2), libice6 (>= 1:1.0.0), liblaunchpad-integration-3.0-1 (>= 0.1.17), libnautilus-extension1a (>= 1:2.91), libsm6, libx11-6, libxml2 (>= 2.7.4), evince-common (>= 3.4), evince-common (<< 3.5), gnome-icon-theme (>= 2.17.1), shared-mime-info

Also ldd on /usr/bin/evince does not list anything with "poppler" in its name.

Hi! I just tried on an Ubuntu 13.04 system and yes, it works perfectly.

The evince version is 3.6.0, and the poppler package is called libpoppler28, which lists version 0.20.4-0ubuntu1.

Cheers!

Changed in poppler:
status: Confirmed → Fix Released
Sebastien Bacher (seb128) wrote :

you can see the poppler versions by Ubuntu serie on https://launchpad.net/distros/ubuntu/+source/poppler

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.