Bug 107007 - PDF export uses insecure RC4-128 encryption
Summary: PDF export uses insecure RC4-128 encryption
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: PDF-Export
  Show dependency treegraph
Reported: 2017-04-06 21:37 UTC by kevin.foley.fyg
Modified: 2021-03-10 20:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description kevin.foley.fyg 2017-04-06 21:37:55 UTC
Documents exported as password-protected PDFs are encrypted with the outdated and insecure RC4-128, with no options to use a newer standard (AES)

Steps to Reproduce:
1. File > Export as PDF
2. Security > Set Passwords
3. Export
4. Open the PDF in a PDF viewer such as Acrobat Reader, and check the Encryption Level

Actual Results:  
Encrypted with RC4

Expected Results:
Encrypted with AES, or at least let the user pick when they export the PDF

Reproducible: Always

User Profile Reset: 

Additional Info:

User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Buovjaga 2017-04-23 15:56:09 UTC
LibO currently only supports PDF 1.4. Support for 1.6 would need to be added.


For import there is bug 55425

"TODO: in pdf ver 1.5 and 1.6 the step 6 is different, should be implemented. See spec."
Comment 2 Timur 2019-01-08 10:25:50 UTC
Repro LO 6.3+.
Comment 3 paulystefan 2020-04-02 17:50:44 UTC
Much people in firms and journalists needs better encryption with AES

so importance for security is high and not medium
Comment 4 paulystefan 2020-04-02 17:54:49 UTC
Repro x64 win10-64
Comment 5 Hans Deragon 2021-03-10 20:02:34 UTC
Still RC4 as of version

$ pdfinfo -opw abc lo.pdf | fgrep Encrypted
Encrypted:      yes (print:yes copy:yes change:yes addNotes:yes algorithm:RC4)

Version: / LibreOffice Community
Build ID: 10(Build:2)
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-CA (en_CA.UTF-8); UI: en-US
Ubuntu package version: 1:7.1.1~rc2-0ubuntu0.20.04.1~lo1
Calc: threaded

Workaround on Linux to encrypt a PDF in AES-256:

  qpdf --encrypt <user-password> <owner-password> 256 -- "${DECRYPTED_PDF}" "${ENCRYPTED_PDF}"

Would be nice that LibreOffice detect that qpdf is available and use it to encrypt in AES-256 instead of relying on its library.

Also, LibreOffice does not report what algorithm is being used.  A warning should be shown that a very week algorithm is being used.