You can create a plug-in (written in C/C++) for this.
No you can't. Although Acrobat SDK claims support for that it does not actually work. At least I was unable to get Acrobat to register my encryption filter and use it. I was told it has something to do with the export restrictions. You can, I think, use Acrobat SDK to create a standalone application that does what you want but I myself never tried that.