Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
Nik
-- Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...
On Sunday 25 August 2024 12.32:04 Dr. Nikolaus Klepp via tde-users wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
Nik
Hi Nik,
I confirm that kpdf asks for a password. qpdf and Master PDF Editor don't. pdfmod throws an error and can't open it either. Saving the document with one of the programs that can open it does not remove this "fake password".
Thierry
On Sunday 25 Aug 2024 12:32:04 Dr. Nikolaus Klepp via tde-users wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
Nik
Hello,
I tried to open your file ch32v003rm.pdf in Okular, running in Trinity, and it asked for a password. I am running an old Trinity system, installed around March 2017 over KDE4 installed from a late version of Debian Jessie, and I can choose whether I use Trinity versions or KDE4 versions of programs. I always use Okular to read pdf files. Looking at About KDE, under Help in Okular, shows KDE Platform Version 4.14.2. Looking at About Okular, shows Okular Version 0.20.2, Using KDE Development Platform 4.14.2.
I saved your file from KMail to Documents/ before trying to open it in Okular, so the problem with Okular asking for a password for the file is not caused by trying to open it directly from KMail.
I first saw this strange behaviour, where Okular asks for a password for one of my own files, that I never encrypted and never assigned a password for, just about a month or two ago. I have been using Okular in Trinity to read pdf files since around March 2017, exactly the same Okular, with no new installation or update, and no change to my Trinity platform, since the original installation around March 2017.
The pdf files which Okular suddenly started asking for a password for, are pdf files that I sent to myself as email attachments to an email sent via Google GMail, as a convenient means of sending the files from one computer to another. I can read those pdf files by logging in to Google GMail and reading them IN GMAIL, but it seems that GMail started encrypting pdf files sent as attachments via GMail, some time around September last year. I never tried to look at the pdf files I sent via GMail last September, until a month or two ago, which was when I first saw the problem. pdf files sent as attachments via GMail before around September last year seem to be unencrypted, while pdf files sent as attachments via GMail from around September last year onwards, seem to be encrypted, and can only be read IN GMAIL.
Chris
On Sun, 25 Aug 2024 12:32:04 +0200 "Dr. Nikolaus Klepp via tde-users" users@trinitydesktop.org wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 07:25:23 2024 EDT Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
How it ended up that way, I couldn't say. The "Producer:" line suggests that this is not being done on your system, so if it didn't start out encrypted, it's being tampered with in transit somewhere. Doesn't look like a kpdf issue, anyway.
E. Liddell
Anno domini 2024 Sun, 25 Aug 12:27:44 -0400 E. Liddell via tde-users scripsit:
On Sun, 25 Aug 2024 12:32:04 +0200 "Dr. Nikolaus Klepp via tde-users" users@trinitydesktop.org wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 07:25:23 2024 EDT Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
How it ended up that way, I couldn't say. The "Producer:" line suggests that this is not being done on your system, so if it didn't start out encrypted, it's being tampered with in transit somewhere. Doesn't look like a kpdf issue, anyway.
Well, xpdf has no problem opening the file without password, nor has firefox, so it's either a kpdf or better a libpoppler issue. pdfinfo uses libpoppler, too, so that says it's a libpoppler problem.
The same thing happened some years ago and was somehow solved. This is most likely a regression.
Nik
E. Liddell ____________________________________________________ tde-users mailing list -- users@trinitydesktop.org To unsubscribe send an email to users-leave@trinitydesktop.org Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@trinitydeskto...
-- Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...
On 8/25/24 11:27 AM, E. Liddell via tde-users wrote:
Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256)
The issue seems to be our dear kpdf not interpreting the pdf parameters correctly. I strongly suspect kpdf has no idea how to handle AES-256 encrypted data (was likely not part of .pdf in 2005 timeframe) It may also be not handling the print:, copy:, change:, addNote: restrictions correctly either.
Wherever the failure occurs it is tipping the password prompt in hopes of correcting it.
xpdf, firefox, etc. have likely been updated to handle the new restrictions and encryption correctly.
Time for a bounty on kpdf (or grab from current occular if possible and backport)
Good day everyone,
just to add to what has been said, to modify the PDF file to make it readable by kpdf, see below…
Am Sonntag, 25. August 2024 schrieb E. Liddell via tde-users:
On Sun, 25 Aug 2024 12:32:04 +0200
"Dr. Nikolaus Klepp via tde-users" users@trinitydesktop.org wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 07:25:23 2024 EDT Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
# change the password with a 40 bit one $ qpdf --allow-weak-crypto --encrypt '' '' 40 -- ch32v003rm.pdf ch32v003rm.new.pdf
$ pdfinfo ch32v003rm.new.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:yes addNotes:yes algorithm:RC4) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2288192 bytes Optimized: no PDF version: 1.7
Now kpdf is able to open and show the file. See also: https://mirror.git.trinitydesktop.org/gitea/TDE/tdegraphics/issues/29#issue-...
HTH Stefan
Hi Stefan!
Anno domini 2024 Sat, 30 Nov 12:18:58 +0100 Stefan Krusche via tde-users scripsit:
Good day everyone,
just to add to what has been said, to modify the PDF file to make it readable by kpdf, see below…
Am Sonntag, 25. August 2024 schrieb E. Liddell via tde-users:
On Sun, 25 Aug 2024 12:32:04 +0200
"Dr. Nikolaus Klepp via tde-users" users@trinitydesktop.org wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 07:25:23 2024 EDT Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
# change the password with a 40 bit one $ qpdf --allow-weak-crypto --encrypt '' '' 40 -- ch32v003rm.pdf ch32v003rm.new.pdf
$ pdfinfo ch32v003rm.new.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:yes addNotes:yes algorithm:RC4) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2288192 bytes Optimized: no PDF version: 1.7
Now kpdf is able to open and show the file. See also: https://mirror.git.trinitydesktop.org/gitea/TDE/tdegraphics/issues/29#issue-...
HTH Stefan
So this lead me to a viable solution to automatically remove those pesky passwords:
- Place the attached programm in your path - make it executeable
In /opt/trinity/share/applications/tde/kpdf.desktop, change the "Exec=" to this:
Exec=decrypt-pdf %U; kpdf %U %i -caption "%c"
... Now when KPDF opens a file it will first be sanitized (if possible) and then kpdf opens the unlocked file. Not as clean as I would like it to be, but good enough for me :)
Nik
Dr. Nikolaus Klepp via tde-users wrote:
Hi Stefan!
Anno domini 2024 Sat, 30 Nov 12:18:58 +0100 Stefan Krusche via tde-users scripsit:
Good day everyone,
just to add to what has been said, to modify the PDF file to make it readable by kpdf, see below…
Am Sonntag, 25. August 2024 schrieb E. Liddell via tde-users:
On Sun, 25 Aug 2024 12:32:04 +0200
"Dr. Nikolaus Klepp via tde-users" users@trinitydesktop.org wrote:
Hi all!
I just found that KPDF is (again) asking for a password on non-password-protected PDFs and fails to open the PDF if no password is given. The PDF preview in konqueror is fine. I have attached a PDF that triggers the behaviour on my system (KPDF 14.2.0~pre65-0debian13.0.0+3~a).
Could somebody please verify?
The file is encrypted, which would explain the password:
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 07:25:23 2024 EDT Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
$ pdfinfo ch32v003rm.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:no addNotes:yes algorithm:AES-256) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2283093 bytes Optimized: no PDF version: 1.7
# change the password with a 40 bit one $ qpdf --allow-weak-crypto --encrypt '' '' 40 -- ch32v003rm.pdf ch32v003rm.new.pdf
$ pdfinfo ch32v003rm.new.pdf Title: CH32V003RM-EN Author: WCH Creator: pdfFactory Pro pdffactorychina.cn Producer: pdfFactory Pro 8.31 (Windows 11 CreationDate: Mon Mar 11 12:25:23 2024 CET Custom Metadata: no Metadata Stream: no Tagged: no UserProperties: no Suspects: no Form: none JavaScript: no Pages: 185 Encrypted: yes (print:yes copy:yes change:yes addNotes:yes algorithm:RC4) Page size: 595.32 x 841.92 pts (A4) Page rot: 0 File size: 2288192 bytes Optimized: no PDF version: 1.7
Now kpdf is able to open and show the file. See also:
https://mirror.git.trinitydesktop.org/gitea/TDE/tdegraphics/issues/29#issue-...
HTH Stefan
So this lead me to a viable solution to automatically remove those pesky passwords:
- Place the attached programm in your path
- make it executeable
In /opt/trinity/share/applications/tde/kpdf.desktop, change the "Exec=" to this:
Exec=decrypt-pdf %U; kpdf %U %i -caption "%c"
... Now when KPDF opens a file it will first be sanitized (if possible) and then kpdf opens the unlocked file. Not as clean as I would like it to be, but good enough for me :)
Nik
Why don't you add this to TGW, it could be implemented at some point of time