-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyPDF2.utils.PdfReadError: file has not been decrypted #416
Comments
Can you provide a copy of your pdf and the code you are using? Both of these will be very helpful for troubleshooting |
@manish59 I know it's been years since you asked, but do you maybe still have a minimal Python script that shows the issue? Can somebody else create a minimal example? |
Note to myself: The file is NOT encrypted. PyPDF2 only thinks it is. |
If you open the document with acrobat reader and look at the protections/permissions, you will note that there is some permission removed (eg assembling). When you set the permissions like that, the file has an admin password and if you want to open it as a user you use an empty password : this is typically the case of the pdf reference https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf I've tried the open your file with "" password but the encryption but AES-128 seems to not be supported yet by PYPDF2😌 |
New Features (ENH): - Add support for pathlib as input for PdfReader (#979) Performance Improvements (PI): - Optimize read_next_end_line (#646) Bug Fixes (BUG): - Adobe Acrobat \'Would you like to save this file?\' (#970) Documentation (DOC): - Notes on annotations (#982) - Who uses PyPDF2 - intendet \xe2\x9e\x94 in robustness page (#958) Maintenance (MAINT): - pre-commit / requirements.txt updates (#977) - Mark read_next_end_line as deprecated (#965) - Export `PageObject` in PyPDF2 root (#960) Testing (TST): - Add MCVE of issue #416 (#980) - FlateDecode.decode decodeParms (#964) - Xmp module (#962) - utils.paeth_predictor (#959) Code Style (STY): - Use more tuples and list/dict comprehensions (#976) Full Changelog: 2.1.0...2.1.1
Is it confirmed that PyPDF2 does not support AES-128 encryption? I have an AES encrypted PDF files generated by Acrobat Sign (that unfortunately I cannot share) that will not decrypt. The PDF document linked above initially exhibits the same behavior, but after using the "trick" in issue 652 of accessing However, the "trick" doesn't work on my file - I cannot compel PyPDF2 to read or merge it. The other differences between the example file above and my file, as reported by
Here's what I mean, which is hopefully more clear:
|
|
Thank you for confirming. As noted above, I do have an AES-encrypted file that fails to decrypt on 2.3.1. Unfortunately I can't share it and I can't find any Linux application that will generate and equivalent example file (PDF 1.7, AES-128bit). If I do, I will create a new issue. |
There are several aspects to encryption in PDF and I cannot claim that I understand all of them.
The PDF 1.7 reference has the details in Chapter 3 "Password Algorithms" @exiledkingcc is the expert on those topics :-) |
New Features (ENH): - Add PageObject._get_fonts (#1083) - Add support for indexed color spaces / BitsPerComponent for decoding PNGs (#1067) Performance Improvements (PI): - Use iterative DFS in PdfWriter._sweep_indirect_references (#1072) Bug Fixes (BUG): - Let Page.scale also scale the crop-/trim-/bleed-/artbox (#1066) - Column default for CCITTFaxDecode (#1079) Robustness (ROB): - Guard against None-value in _get_outlines (#1060) Documentation (DOC): - Stamps and watermarks (#1082) - OCR vs PDF text extraction (#1081) - Python Version support - Formatting of CHANGELOG Developer Experience (DEV): - Cache downloaded files (#1070) - Speed-up for CI (#1069) Maintenance (MAINT): - Set page.rotate(angle: int) (#1092) - Issue #416 was fixed by #1015 (#1078) Testing (TST): - Image extraction (#1080) - Image extraction (#1077) Code Style (STY): - Apply black - Typo in Changelog Full Changelog: 2.4.2...2.4.3
I was trying to read the fileds in a pdf form. The Pypdf2 is kicking me with this error. I tired to see if it is encrypted using pypdf2.isencrypted but it is giving me that it is not encrypted. please let me know if any one know this
MCVE
File: https://www.fda.gov/downloads/AboutFDA/ReportsManualsForms/Forms/UCM074728.pdf
The text was updated successfully, but these errors were encountered: