pyPdf
pyPdf copied to clipboard
Correct password verification for revision 3 or greater
According to spec, only the first 16 bytes must be compared when verifying password with Algorithm 3.5 revision 3 or greater.
To add some context, I ran into some pdf files generated by "[ClibPDF Library 2.02-r1-2] Windows 9x/NT" which did not use 0 as the arbitrary padding bytes. That's when I looked at the spec and figured out we're only supposed to compare the first 16 bytes of the U entry.