I am creating a package and I would like it to be secure, i.e. it loads and runs using Needs but the code stays secret. So I set up the protection using:
SetAttributes[MyFunction,{Protected,ReadProtected,Locked}]
and the whole package is encoded using the Encode command so it is not human readable.
On first sight this approach works. However, I noticed almost all System` commands are not Locked so they can be unprotected and removed. This applies to SetAttributes as well.
Basically, Remove@Unprotect@SetAttributes and then loading my package can reveal full code since SetAttributes fails as it is not defined.
Is there a workaround this to make my code secure from system commands tampering?
DumpSave does solve the problem with SetAttributes, but other system commands can still be changed in attempt to hack the package to work when it shouldn't. I don't see there can be anything done for this.
– Schepy Jan 05 '20 at 13:48