Sign pdf with password may corrupt file
See original GitHub issueHi
edit: I did a test with a non-empty password and I got the same result. Checking now endesive-2.0.5 edit2: Probably related to: pdf signing will not work correctly when only owner password is set for the pdf and the permission settings will be ignored by cms.sign
I use your nice library to sign automatically generated pdfs. Unfortunately sometime I run into problems.
- The pdf is gererated using
enscript
andps2pdf
- Then I use
qpdf --encrypt "" "" 128 --extract=n --accessibility=n --modify=none
to apply some restrictions but without any password - Then I use your
pdf-sign-cms.py
script to sign the pdf
The unfortunate outcome is that sometimes my pdf reader asks for a password, even none is set. pdfcrack
told me that the password is ‘’. But this works only for qpdf
with the option --password-is-hex-key
.
x:~$ qpdf --decrypt --password="" --password-is-hex-key /media/sf_shared_folder/TEST_encr-signed-cms.pdf x.pdf
WARNING: /media/sf_shared_folder/TEST_encr-signed-cms.pdf (offset 458): error decoding stream data for object 3 0: stream inflate: inflate: data: incorrect header check
WARNING: /media/sf_shared_folder/TEST_encr-signed-cms.pdf (offset 458): stream will be re-processed without filtering to avoid data loss
qpdf: operation succeeded with warnings; resulting file may have some problems
Attached are the files for the steps above:
The used version is endesive-2.0.2.tar.gz
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to edit secured PDFs using Adobe Acrobat
Open the PDF in Acrobat. Select Tools > Protect > Encrypt > Remove Security. Your options vary depending on the type of password...
Read more >How to Fix “The signature of this program is corrupt or invalid”
Right-click on your program and select Properties. · Click on the Digital Signatures tab. · Select the signature and click on the Details...
Read more >What is PDF Owner Password and How to Remove Password ...
A PDF owner password is a password that is used to restrict documents in PDF files. In Adobe Acrobat, the owner password is...
Read more >Signing existing PDF document sometimes causes a corrupt file
The problem is in your program, more exactly in your PdfWorker.Sign method: File.Copy(_source, _dest, true); FileStream f = new ...
Read more >[Best Practice] How to Lock PDF from Editing?
Select Tools > Protect > Protect Using Password from the drop-down menu. opening the pdf file in acrobat dc pro. Step 2: If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The ID was incorrectly copied from the previous document, try with 2.0.6
Thank you!!