This question is inspired by this one: Convert PDF to PDF of images?
As the author does have the code, creating a LaTeX version that is difficult to decrypt seems to be a good solution. Certainly, it is easy to block the compilation as in The TeXbook:
\loop\iftrue
\errmessage{This manual is copyrighted and should not be TeXed}\repeat
\pausing1 \input manmac
\ifproofmode\message{Proof mode is on!}\pausing1\fi
but it is easy to omit. One can, using \immediate\write and \immediate\read require a password to compile, but it is also visible in the code.
However, in this thread, How can we draw a Christmas tree with decorations, using TikZ? David Carlisle gave a beautiful example of a pseudo-encrypted code.
How can we create such a code?
cryptopdflatexformat and the password hash (which could be placed at the start of your encrypted file). Be aware that this way LaTeX will probably need a bit of time to run, and you wouldn't want to create any (unencrypted) temporary files as that would be an obvious security risk! I begin to really like this idea :) – Skillmon Dec 30 '21 at 10:51