Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 665
    • Issues 665
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 46
    • Merge requests 46
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #824
Closed
Open
Issue created Sep 06, 2019 by leukimi@leukimi

Cannot decrypt PDF with passwords containing special characters [åäö!"§$%&]

Summary

Evince v3.28.4 and apparently also Okular does not open AES-256 encrypted PDF with password containing characters [åäö!"§$%&].

Description

Evince Document Viewer v3.28.4 (standard on Ubuntu 18.04LTS) and apparently also Okular, both apparently using libpoppler, does not open AES-256 encrypted PDF with password containing characters [åäö!"§$%&]. Firefox (and Foxit Reader) does open it. See this and this post about the issues that have been found. Suggestion was made to file the bug here.

Here is an output of what versions of libpoppler and cups-pdf are on the Ubuntu 18.04.3 LTS (latest) currently.

$ apt list --installed | grep poppler
libpoppler-glib8/bionic-updates,bionic-security,now 0.62.0-2ubuntu2.10 amd64
libpoppler73/bionic-updates,bionic-security,now 0.62.0-2ubuntu2.10 amd64
poppler-data/bionic,bionic,now 0.4.8-2 all
poppler-utils/bionic-updates,bionic-security,now 0.62.0-2ubuntu2.10 amd64

$ apt list --installed | grep cups-pdf
printer-driver-cups-pdf/bionic,now 3.0.1-5 amd64

Package info printer-driver-cups-pdf 3.0.1-5

Test script [test_case_01.sh] provided here to reproduce the issue:

#!/bin/bash
# test_case_01.sh
#  
# Tested on GNU bash v4.4.20 on Ubuntu 18.04LTS.
# May also work on other linux releases.
# Script requires: qpdf poppler-utils printer-driver-cups-pdf cups-filters
# If not present, install it:
# sudo apt-get install qpdf poppler-utils printer-driver-cups-pdf cups-filters

# Generate a random text like lorem ipsum.
# Put the contents in a text file.
cd /tmp # directory where the three files will be created
filenametxt="foo.txt"
tr -dc a-z1-4 </dev/urandom | tr 1-2 ' \n' | awk 'length==0 || length>50' | tr 3-4 ' ' | sed 's/^ *//' | cat -s | sed 's/ / /g' | fmt | head -30 > $filenametxt

# Create a PDF file from the text file:
filenamepdf=$(basename -s .txt $filenametxt).pdf
cupsfilter -e $filenametxt > $filenamepdf

# Encrypt the PDF file and change the extension to [*_encrypted.pdf] :
userpassvar="ä" # "åäö"
ownerpassvar="å" # "åäö"
encryptedfilenamepdf=$(basename -s .txt $filenametxt)_encrypted.pdf
qpdf --encrypt $userpassvar $ownerpassvar 256 --use-aes=y -- $filenamepdf $encryptedfilenamepdf

# Show the info of the encrypted PDF:
pdfinfo -upw $userpassvar -opw $ownerpassvar $encryptedfilenamepdf

# Open the encrypted PDF with Evince and Firefox with the user/owner password.
evince $encryptedfilenamepdf &
firefox $encryptedfilenamepdf &

exit 0

Result

Evince v3.28.4 does not accept any of the passwords containing [åäö!"§$%&].

Firefox (and Foxit Reader) accepts both passwords containing [åäö!"§$%&].

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking