Bill Butler
Bill Butler

Reputation: 489

Open a pdf with blank password with pdftk

We occasionally receive pdf files with blank/empty passwords. We use pdftk and under these circumstances it fails. We have tried:

pdftk input.pdf input_pw  output output.pdf
pdftk input.pdf input_pw \ output output.pdf
pdftk input.pdf input_pw '' output output.pdf
pdftk input.pdf input_pw "" output output.pdf

All fail indicating that we have supplied an incorrect password, however this command works great when the password consists of actual characters. We were hoping that quotes or a \ escaping would trick it, but no love. We found a workaround with qpdf and are going to use that for now, but was hoping someone out there could crack this nut.

Upvotes: 14

Views: 2036

Answers (1)

Royce Williams
Royce Williams

Reputation: 1639

According to this hashcat forums post, the qpdf tool might work for this purpose.

qpdf in.pdf out.pdf --decrypt --password=''

And it looks like you've tried all of the command-line ways to try to pass an empty string to pdftk (and my testing had the same results), so there may be no way to do this with pdftk at all.

Upvotes: 11

Related Questions