How to protect Julia code from being read by users?

Viewed 242

Can Julia code be protected so that end users cannot read the code? I'm looking at this as alternative to Python which I know is difficult to protect.

I'm looking for a language which can be used to create end user desktop apps, which is strong in terms of statistics / mathematical applications, and Julia seems perfect for this.

2 Answers

There are two separate things you would need for such a scenario:

  1. compile your code in an executable and ship the compiled code
  2. "obfuscate" the code so that it becomes difficult to reverse engineer it

Honestly I don't think Julia is the most suited language for this task at this time:

(1) is possible with the PackageCompiler.jl package. It isn't however mainstream, don't expect a click and solve your problem solution. For (2) I am not aware of software tools that obfuscate Julia source code, although you can still "decide" to write pretty cryptographic, spaghetti code in Julia if you wish!

You could certainly encrypt a file containing some of your code and then read the file, decrypt, Meta.parse(), and eval() that code in memory, FairPlay style. That would keep anyone from simply browsing out of curiosity with an editor. But anyone with reasonable determination and some time could understand your method and decrypt your code. Why bother?

Related