Remove PDF password protection using qpdf and AppleScript
sheshbabu.com
sheshbabu.com
Back then, there were also some other means, like writing your own InputManager to inject code, or F-Script Anywhere, which injected a F-Script interpreter into a process.
pdftk input.pdf input_pw YOURPASSWORD output output.pdf