-
Notifications
You must be signed in to change notification settings - Fork 119
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
Not decrypting streams in encrypted pdf #159
Comments
Hello, the decryption happens here: https://github.com/pdf-rs/pdf/blob/master/pdf/src/file.rs#L75 |
and it is set here: https://github.com/pdf-rs/pdf/blob/master/pdf/src/file.rs#L243 |
Ok, as far as I understand the following is happening: In But for streams, the data is not really read, only the range withing the file where the stream is located is strored (that happens in Then, in Is my analysis correct? If so, I wonder how to fix that.
@s3bk What do you think, how should this be done? I am willing to try to implement this but I would like your opinion so I am not running in the wrong direction. |
From my understanding there is only one key per file, which is why decrypting happens in storage. https://github.com/pdf-rs/pdf/blob/master/pdf/src/object/stream.rs#L84 should call |
Mmmh, should
|
ugh. yes. |
Hi,
I am opening an encrypted pdf and it errors when decoding a stream (FlateDecode).
Debugging the code, I notice that it tries to decode the stream "as-is" without decrypting it first. This of course already fails with the header.
I am working my way through the code, but have not found out where it should be decided to decrypt, where the password comes from and stuff like that.
Maybe someone with more experience has an Idea where to change that?
The text was updated successfully, but these errors were encountered: