The steps you propose will not work in Acrobat, because, if you manually compress streams, the PDF will no longer be valid -- Acrobat will see the encrypted data as garbage. You will then get errors, or crashes, and I doubt the file could save. You also cannot update stream content, only create new streams and replace indirect links to them.
Just use the standard encryption methods. If you have homework requiring that you use a non-standard algorithm, you can replace the compression algorithm. Then the details of how streams and strings are encrypted and decrypted are transparent.
I've never made an encryption filter, but let us know if you find any of the documentation unclear and we will try to clarify it. Be sure to give a reference to the material you are looking at.