Skip to content
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

PDF is Encrypted! Attempting to decrypt - not yet fully supported #196

Open
pvin opened this issue Jun 30, 2021 · 4 comments
Open

PDF is Encrypted! Attempting to decrypt - not yet fully supported #196

pvin opened this issue Jun 30, 2021 · 4 comments

Comments

@pvin
Copy link

pvin commented Jun 30, 2021

@kevshin2 @boazsegev I'm using version (1.0.16) and tried (1.0.21) also, but still getting this error PDF is Encrypted! Attempting to decrypt - not yet fully supported.

I'm able to open the file in preview without password.

I see this issue, which is already discussed #66 and closed but still getting, any help here?

@pvin pvin changed the title @kevshin2 @boazsegev I'm using version (1.0.16) and tried (1.0.21) also, but still getting this error **PDF is Encrypted! Attempting to decrypt - not yet fully supported.** PDF is Encrypted! Attempting to decrypt - not yet fully supported Jun 30, 2021
@technoir9
Copy link

@pvin @boazsegev I'm having the same issue (encrypted pdf file, but no password needed), a bit more details here:

File is encrypted - not supported.
/home/technoir/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/combine_pdf-1.0.21/lib/combine_pdf/decrypt.rb:187:in `raise_encrypted_error'
/home/technoir/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/combine_pdf-1.0.21/lib/combine_pdf/decrypt.rb:57:in `decrypt'
/home/technoir/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/combine_pdf-1.0.21/lib/combine_pdf/parser.rb:102:in `parse'
(...)
Data raising exception:
 {:P=>-1324
 :R=>4
 :StrF=>:StdCF
 :CF=>{:StdCF=>{:Type=>:CryptFilter
 :CFM=>:AESV2
 :Length=>16
 :EncryptMetadata=>false}}
 :Filter=>:Standard
 :Length=>128
 :U=>"<byte sequence>"
 :V=>4
 :StmF=>:StdCF
 :EncryptMetadata=>false
 :O=>"<byte sequence>"
 :indirect_generation_number=>0
 :indirect_reference_id=>170}

File metadata:

$ pdfinfo encrypted.pdf                                            
Title:          <redacted>
Creator:        Word
Producer:       Adobe Sign
CreationDate:   Thu Feb 11 15:05:43 2021 CET
ModDate:        Fri Mar 19 12:36:33 2021 CET
Tagged:         no
UserProperties: no
Suspects:       no
Form:           AcroForm
JavaScript:     no
Pages:          17
Encrypted:      yes (print:yes copy:yes change:no addNotes:no algorithm:AES)
Page size:      595 x 842 pts (A4)
Page rot:       0
File size:      311688 bytes
Optimized:      no
PDF version:    1.7

Removing this line seems to fix it for me:

raise_encrypted_error unless (cfilter[:AuthEvent] == :DocOpen)

@reiz
Copy link

reiz commented Oct 12, 2021

@pvin I have the same issue.

@boazsegev what would it take to support encrypted files? I would be willing to pay a couple $ to resolve this issue. I'm using this Gem at ZEIT.IO. It's my bootstrapped business. Not super profitable yet, but it generates a bit of revenue. Having support of encrypted files would simplify my coding and increase customer happiness. I would pay 100 EUR to get this resolved. I know it's not much, but better than nothing ;-)

@kalinchuk
Copy link

kalinchuk commented Mar 28, 2023

I'm also willing to pay to get this resolved.

@boazsegev
Copy link
Owner

Hi @reiz and @kalinchuk ,

I don't think money is the issue... besides, depending on which country the payment is from, the money I'll have to pay the accountant to process the foreign payment would probably cost more than the €100 😅

Essentially there's already a stub class that should be called when encrypted files are recognized.

The two things that will have to be done is improve the recognition code and implement the decryption algorithms (which would have been easier if OpenSSL's API wasn't so terrible). Another optional feature needed would be support for a :password option in the Parser's options hash so that could be passed on to the decrypt implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants