Question

I've written a program in MATLAB and I'm considering three methods of deploying the program to end users. The first method involves converting the .m files to p-code and then deploying that to end users who can use the p-code in MATLAB but cannot see the code themselves. The second method involves compiling the .m files to C# using MATLAB Compiler and MATLAB Builder NE and then using Visual Studio to obfuscate the code and to also create the end product. The third method involves using MATLAB Compiler and MATLAB Builder EX to create an Excel add-in, and deploying the Excel add-in to end-users.

I am wondering how hard it is for someone to reverse engineer or crack and gain access to the code in each of these three methods of deployment that I am considering. I know that it is essentially impossible to create a program that can't be cracked or reverse engineered, but is any method of deployment harder to crack than other methods? I know that p-code gives the end user access to the names of the files which I guess can potentially help someone reverse engineer your program.

Thanks in advance for your assistance!

Was it helpful?

Solution 2

I ended up calling MathWorks about this question. The MathWorks engineer told me that he's not allowed to tell me the type of encryption because it is proprietary information.

I also asked the MathWorks engineer what sort of encryption is used for Compiler and Builder EX or Builder NE. He said this used 128-bit AES encryption to encrypt m-files but other sorts of files used in your program aren't encrypted like .dll or picture files.

I then asked which has stronger encryption, p-code or a program deployed used Compiler and Builder. He said it's hard to say because they are different kinds of encryption, but before using Compiler and Builder, you can actually turn your .m files to p-code thus making the protection product deployed using Compiler and Builder at least as strong as p-code.

OTHER TIPS

In terms of the ability to reverse-engineer your code from the deployed version, there's little difference in practice between these methods.

Builder for .NET does not convert MATLAB to C#. MATLAB Compiler and the Builder products archive and encrypt your code, and create a small wrapper (.NET assembly or Excel add-in) that dearchives it and executes it against the MATLAB Compiler Runtime. During execution, the dearchived files, although still encrypted, are visible in a temp directory, so the filenames are available in the same way as with p-coding.

P-coding will be simplest and cheapest for you, but will require your end users to have a copy of MATLAB and any toolboxes you use. A product deployed with the Compiler and/or the Builder products will not require them to have anything, but you will need to buy those products, and the deployment process is a little more complex.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top