Bug 158537 - Encrypted hybrid PDFs are opened as regular PDFs with Draw, with no option to enter password
Summary: Encrypted hybrid PDFs are opened as regular PDFs with Draw, with no option to...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 158559 (view as bug list)
Depends on:
Blocks: Password-Protected
  Show dependency treegraph
 
Reported: 2023-12-05 10:39 UTC by Bufetr
Modified: 2025-03-17 00:49 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple ODF text file with Lorem Ipsum text before saving to hybrid PDF (37.34 KB, text/plain)
2023-12-05 10:45 UTC, Bufetr
Details
Encrypted hybrid PDF file created with 7.6.2 (22.88 KB, application/pdf)
2023-12-05 10:49 UTC, Bufetr
Details
Encrypted hybrid PDF file created with 7.6.4 (51.22 KB, application/pdf)
2023-12-08 10:30 UTC, Bufetr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bufetr 2023-12-05 10:39:49 UTC
Description:
LibreOffice can't open encrypted hybrid PDFs when created or edited with the latest 3 major releases, 7.4, 7.5 and current 7.6 of Community Edition.

Hybrid PDFs created with pre-7.4 versions can be opened as expected in the latest (7.6.3.2) and any version.

Editing a pre-7.4 version hybrid PDF file with the 3 latest versions and saving it, reproduces the problem as mentioned.

Steps to Reproduce:
1.Create an ODF file with Writer, Calc or Impress
2.Save ODF file as hybrid PDF
3.Open hybrid PDF with LibreOffice

Actual Results:
Files are opened in LibreOffice Draw as regular PDF files with the text "This PDF file is encrypted and can't be opened."

Expected Results:
Show a window to enter password in Writer, Calc or Impress


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 60(Build:2)
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
7.6.3-3
Calc: threaded
Comment 1 Bufetr 2023-12-05 10:45:19 UTC
Created attachment 191241 [details]
Simple ODF text file with Lorem Ipsum text before saving to hybrid PDF

Simple ODF text file of "Lorem ipsum" text before saving to hybrid PDF
Comment 2 Bufetr 2023-12-05 10:49:22 UTC
Created attachment 191242 [details]
Encrypted hybrid PDF file created with 7.6.2

Encrypted hybrid PDF file created from the previous ODF text file attachment with 7.6.2 Community Edition, in 21 Nov 2023.
Comment 3 Bufetr 2023-12-05 12:44:40 UTC
Comment on attachment 191242 [details]
Encrypted hybrid PDF file created with 7.6.2

Password of this file is "loremipsum" without the "".
Comment 4 Bufetr 2023-12-05 12:45:36 UTC Comment hidden (obsolete)
Comment 5 Bufetr 2023-12-05 12:46:04 UTC Comment hidden (obsolete)
Comment 6 m_a_riosv 2023-12-06 15:10:54 UTC
*** Bug 158559 has been marked as a duplicate of this bug. ***
Comment 7 MilesB 2023-12-06 17:49:28 UTC
I can confirm that the bug is present in

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 8; OS: Mac OS X 14.1.1; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Tested with both the provided attached Lorem Ipsum file and a new ODF text file.

(UNCONFIRMED>NEW)
Comment 8 Telesto 2023-12-06 19:30:22 UTC
Confirm

A hybrid PDF with password generated with
Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: a9ad36ae46ff76c0d59b0d170314fdd3a9ee5d35
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL threaded

doesn't open in Writer. Older versions are also unable to open the file in Writer.

A hybrid PDF with password generated with
Version: 7.0.7.0.0+ (x64)
Build ID: 626ea4e62a3e5005fe9825923a1c0c5bdb61cc08
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

opens in Writer with 7.0.7 and current master
Comment 9 Stéphane Guillou (stragu) 2023-12-07 10:06:34 UTC
With the example file exported as hybrid PDF with a password for opening, not reproduced in:

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Nor in:

Version: 7.5.8.2 (X86_64) / LibreOffice Community
Build ID: f718d63693263970429a68f568db6046aaa9df01
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

In those, I can open the file and I am prompted for a password, which contradicts Comment 0.

However, reproduced in:

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Draw open the file with the message "This PDF file is encrypted and can't be opened" on page, without a password prompt.

Bibisected with linux-64-7.6 repo to first bad build commit [992931283a6377bd41a27ce1a42312feb9ac80a7] which points to core commit:

commit e052f6e1d49a5289411b31561d6e310bf414d896
author	Tomaž Vajngerl 	Mon Jan 23 12:33:39 2023 +0900
committer	Tomaž Vajngerl  Tue Jan 24 10:50:49 2023 +0000
tdf#66580 write ODF document as an attachment in hybrid mode
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146053

Quikee, can you please have a look?
Comment 10 Bufetr 2023-12-08 10:30:27 UTC
Created attachment 191309 [details]
Encrypted hybrid PDF file created with 7.6.4

Created with the same attached ODF file I submitted first (191241). It is still reproducing the bug. Password is the same as the previous file, "loremipsum" without the "".

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 4; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: el-GR (en_US.UTF-8); UI: en-US
7.6.4-1
Calc: threaded
Comment 11 Bufetr 2024-02-05 07:52:54 UTC
Bugs still exists with new version 24.2.0.3

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: 420(Build:3)
CPU threads: 4; OS: Linux 6.7; UI render: default; VCL: gtk3
Locale: el-GR (en_US.UTF-8); UI: en-US
24.2.0-1
Calc: threaded
Comment 12 UT 2024-09-03 12:03:48 UTC
I observed a similiar Bug after installing version 24.2.5.2. (previouss 7.5.9)
After exporting a PDF with password it can not be opened any more with LibreOffice Impress, because no password prompt is shown.
It is possible to open the PDF in Adobe.
Comment 13 Tomaz Vajngerl 2025-02-11 09:38:02 UTC
Can this be retested on master? Might be solved with the PDF 2.0 work..
Comment 14 V Stuart Foote 2025-03-05 20:58:30 UTC
*** Bug 165588 has been marked as a duplicate of this bug. ***
Comment 15 grofaty 2025-03-11 08:33:22 UTC
From my Bug 165588 I was redirected to this bug report as my being duplicate. I am not really convinced my bug is duplicate of this one, because of different behaviour.

TEST 1:
1. In Writer type some text.
2. File | Export As | Export as PDF.
3. From General tab from General section select PDF Version = PDF 2.0.
4. Leave other options as default ("Hybrid PDF" unchecked).
5. Click on Security tab and click on Set Passwords button.
6. In "Set open password" section type in some password and OK button and Export button and name the file e.g. mypdf.pdf
7. File | Open and select mypdf.pdf and Open button.
8. Enter Password dialog is opened with "Enter password to open file: 5D5D.tmp". This is strange UX name to get some ".tmp" file. Type in password and OK button.
9. Document is opened in Draw. Looks like this part is working fine.

TEST 2:
The same: 1-3
4. Check "Hybrid PDF".
The same: 5-7
8. Password dialog appears with text "Enter password to pen file: 1E1E.tmp" as the same strange UX referring to ".tmp" file. Type in password and OK button.
9. I get error "The password is incorrect. The file cannot be opened." I tried three times to type in password, just in case I mistyped the password and the same error.

P.S. Another small UX issue, I can't see typed in password in "Enter Password dialog like "small eye icon to display password". This would be very helpful for complex password to check before clicking OK button.
Comment 16 Dave Gilbert 2025-03-17 00:48:00 UTC
(In reply to grofaty from comment #15)
> From my Bug 165588 I was redirected to this bug report as my being
> duplicate. I am not really convinced my bug is duplicate of this one,
> because of different behaviour.
> 
> TEST 1:
> 1. In Writer type some text.
> 2. File | Export As | Export as PDF.
> 3. From General tab from General section select PDF Version = PDF 2.0.
> 4. Leave other options as default ("Hybrid PDF" unchecked).
> 5. Click on Security tab and click on Set Passwords button.
> 6. In "Set open password" section type in some password and OK button and
> Export button and name the file e.g. mypdf.pdf
> 7. File | Open and select mypdf.pdf and Open button.
> 8. Enter Password dialog is opened with "Enter password to open file:
> 5D5D.tmp". This is strange UX name to get some ".tmp" file. Type in password
> and OK button.
> 9. Document is opened in Draw. Looks like this part is working fine.
> 
> TEST 2:
> The same: 1-3
> 4. Check "Hybrid PDF".
> The same: 5-7
> 8. Password dialog appears with text "Enter password to pen file: 1E1E.tmp"
> as the same strange UX referring to ".tmp" file. Type in password and OK
> button.
> 9. I get error "The password is incorrect. The file cannot be opened." I
> tried three times to type in password, just in case I mistyped the password
> and the same error.
> 
> P.S. Another small UX issue, I can't see typed in password in "Enter
> Password dialog like "small eye icon to display password". This would be
> very helpful for complex password to check before clicking OK button.

I think you're right that is separate - you've got a problem with hybrid v2 PDFs - v2 uses a different encryption and that's related to tdf#55425.