Message Boards Message Boards

Create a secret code for running a program?

Hi! Just finished a program with 1260 lines with commercial applications. I want to be sure before I open up the code that the program only runs with a allowed individual code for every program distributed. The program is not compiled yet. It only runs on the Wolfram platform, so I do not know how to take out the linkage from the rights of the Wolfram company. I just intend to sale or distribute the program for use with the Wolfram language computer system. Any Help?

This is a very complex question in the current version of Mathematica. There still is no simple way to create distributable code that can be attached easily to a password for each intended user. There are approaches that I have used, but they are complex.

However, if your code is in a .m file and you are willing to create a code distribution for each user that you distribute your code to then you can take the following approach:

Get the user's

$MachineID

. Use Encode to create an encoded version of your .m file specifically for that user's $MachineID using

Encode[source, destination, MachineID->"User's MachineID"]

Distribute that custom version. This then will tied to that user's machine. The downside is that if the $MachineID changes (e.g. the user upgrades their machine) then a new distribution will be needed. The user then can load the .m file with Get.

Alternatively you can use the version of Encode that has 3 arguments

Encode[source, destination, key]

with a specific key that you create for each user that you distribute the .m file to. You have to generate it for each user. And the user can then load it with

Get[file,key]

And it will work for the user for each computer that they use it on. However the user can then share it with others by providing the key to them. You would have to limit this via a legal license agreement.

Note though that for each of these cases it is still possible for the user to reverse engineer your code using ? and ?? if the functions are not Protected and Locked. Locking functions has its own set of issues...

There are other approaches that I have created for myself, however they are rather long to describe.

Hopefully WRI will finally create a set of tools for users to market code, but they have not done so as of version 11.

POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract