PDFTK has options to set passwords :
Quote:
NAME
pdftk - A handy tool for manipulating PDF
SYNOPSIS
pdftk <input PDF files | - | PROMPT>
[ input_pw <input PDF owner passwords | PROMPT> ]
[ <operation> <operation arguments> ]
[ output <output filename | - | PROMPT> ]
[ encrypt_40bit | encrypt_128bit ]
[ allow <permissions> ]
[ owner_pw <owner password | PROMPT> ]
[ user_pw <user password | PROMPT> ]
|
https://www.pdflabs.com/docs/pdftk-cli-examples/
================================
http://daemonforums.org/showthread.php?t=10457