I am writting a code that could be useful for some people. The program will be free but I would like to protect the code. As I am not good at explaining myself I will simply illustrate my question with an example:

Let's say that I make the following code:

 Column[{Row[{InputField[Dynamic[a]], InputField[Dynamic[b]]}], 
   Button["Calculate SUM", c = a + b], "\n", "Result:", Dynamic[c], 
   "\n", Button["Plot c*x+5", 
    CreateDialog[Plot[c*x + 5, {x, -1, 1}]]]}]]

It allows you to calculate the sum of a number and to display the "y=c*x+5" function, where "a" is the sum of the previous values.

Anyway, I would like to somehow create a protected file (opening with a text editor would show something unreadable) and that, when doubling clicking on it, it opens Mathematica but evaluating it, without displaying the code. Something similar to an executable file that can be opened with mathematica (or the OS).

So, I should not able to see or modify the code but I want to solely display the Dialog.

I hope that someone can understand my question...

I have been reading stuff about "Encode", protecting functions but I did not understand it.... should I waste more time looking into it or is it not going to help me? any tips?

Why is that difficult to create an executable that only Mathematica could read and evaluate?

Is there a simple solution? if not, I have been thinking in creating millions and millions of not useful functions or/and text, inserting some in between the code and so on, with the hope of making it hard to uncode if someone would like to. My logic is that if one person can differenciate the non-useful code then it means that he/she knows how to program and if so, he/she can create a code. If it takes that person more time to get to the useful code discarding the non-usuful one than to make it from scratch, then I should be safe because they won't waste time on reading it?

Any ideas? perhaps it is simpler that I think?

Thanks in advance,

  • $\begingroup$ Maybe this question and answers could be interesting for you. $\endgroup$ – Pinti May 27 '17 at 20:28
  • $\begingroup$ This may be also related: How to distribute proprietary Mathematica code $\endgroup$ – Shadowray May 27 '17 at 23:24
  • $\begingroup$ It is simpler that you think, do it the way us developers do it by making an exe in .net, Java or etc. Then you can obfuscate your code, encrypt your MMA code and employ other methods to protect your code from reverse engineering. $\endgroup$ – WolframFan May 28 '17 at 4:17
  • $\begingroup$ I already read most of the links before posting my question. I guess this answers my question: no, it is not simple. I don't really understand most of the steps in the links or how to implement it in my code or in the example above. I don't want to create pretected functions that can be used by other people... I want to execute a program so that it automatically evaluates the whole notebook without being able to see the code. @WolframFan, I tried to follow your link but that looks more complicated and no simple as you suggest, particularly for someone that does not know about this things :( $\endgroup$ – neuron May 28 '17 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.