I needed to make an encrypted PDF to send to a government agency. It took me a while to find out how to do this on a Linux system, so I thought I'd share the very simple answer.
1. Install package 'qpdf'.
2. Create your unencrypted PDF using your favorite software (e.g., the "Export as PDF" function in LibreOffice).
3. From the command line:
qpdf unencrypted.pdf --encrypt mypassword mypassword 256 -- encrypted.pdf
(Note the double password, and the space before and after the second "--".)
Result: the content of your PDF is protected by 256-bit AES encryption, the two passwords are the same, and no permissions are restricted.
"Why two passwords? What permissions?" Because back in early PDF history, they came up with some bizarre ideas including a separate "permissions password" that would stop the user from doing certain things (e.g., printing) but only when using Adobe's own software. You don't want to know about it unless you enjoy headaches. Just be sure to set both passwords to something, otherwise anyone can read your PDF.
Since this is Linux, there are probably ten other ways to do the same thing. So you can tell me your favorite one that I didn't know about.