pdftk my.pdf output my-decrypted.pdf input_pw PASSWORD
The download of pdftk
for MacOSX is borked. The link on their homepage points to an old version, and the new version didn’t work either.
You need a couple of packages installed:
brew install poppler
brew install ghostscript
Then convert to PostScript and back to PDF:
pdftops -upw PASSWORD my.pdf
ps2pdf my.ps my-decrypted.pdf
PDFs can have two passwords:
OWNER
password, which only controls features and can be removed without actually knowing the passwordUSER
password, which actually encrypts the file