mfenniak / pyPdf

Pure-Python PDF Library; this repository is no longer maintained, please see https://github.com/knowah/PyPDF2/ insead.
https://github.com/knowah/PyPDF2/
Other
276 stars 85 forks source link

Correct password verification for revision 3 or greater #12

Open kushal-kumaran opened 13 years ago

kushal-kumaran commented 13 years ago

According to spec, only the first 16 bytes must be compared when verifying password with Algorithm 3.5 revision 3 or greater.

kushal-kumaran commented 13 years ago

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.