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

Implement standard security handler (revision 6) #394

Merged
merged 7 commits into from
Feb 26, 2025

Conversation

StephanvanSchaik
Copy link
Contributor

This pull request implements the algorithms for the standard security handler essential to decrypt PDF documents using revision 6 (or later).

The first commit reorganizes the encryption code into its own module since the original file is getting rather big. The module has been split up into the PKCS#5 implementation, the password algorithms, the crypt filters. I have also moved the RC4 implementation to this module.

The second commit removes a Vec<u8> allocation by using a hasher directly.

The third commit merges the remaining algorithm functions into the PasswordAlgorithm implementation, such that we can avoid passing the length and revision everywhere.

Commits four, five and six implement the file encryption key and password algorithms necessary to decrypt PDF documents (PDF 2.0) using revision 6 of the standard security handler.

@J-F-Liu J-F-Liu merged commit 90ba059 into J-F-Liu:main Feb 26, 2025
7 checks passed
@StephanvanSchaik StephanvanSchaik deleted the encryption-v2 branch February 26, 2025 14:02
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

Successfully merging this pull request may close these issues.

2 participants