How I can protect MATLAB compiled .exe from:
Which packers, protection tools etc should I use?
One method for protecting source code is to store that source code on a remote protected server using MATLAB Web App Server or MATLAB Production Server. The stored source code resides on a server with restricted access, and users access the application through secure interfaces.
P-code files are an obfuscated, execute-only form of MATLAB code. You cannot open a P-code file in the MATLAB Editor or Live Editor.
This is a pre-parsed pseudocode file (P-file), which is a “pre-compiled” form of the Matlab function signal1. m. To evaluate this function, simply type y = signal1(t) where t is a vector containing values of time.
MATLAB Coder™ generates C and C++ code from MATLAB® code for a variety of hardware platforms, from desktop systems to embedded hardware. It supports most of the MATLAB language and a wide range of toolboxes. You can integrate the generated code into your projects as source code, static libraries, or dynamic libraries.
I have been previously faced with exactly this problem. Here are some thoughts:
exe
with user-based keys to limit the redistribution, since the decompressed files will be available during runtime. In that sense it is equivalent to just using mcc
for protection.We ended up using a solution, which involves a USB dongle. It performs the encryption/decryption on the fly and more-or-less addresses the above complexities. It works in a client/server setting, i.e., you can have a USB dongle on the server, and the clients contact the server to checkout the license and run the code. At that time however, the full encryption was only supported on Windows. I am not sure whether I should mention the company name here on SO (I am not in any way affiliated to it, but anyways). I can tell you privately what we used, or you could google around a bit - there are alternatives on this market.
Edit I made a mistake in my original statement. The archive is indeed extracted to MCR_CACHE directory, but the files are encrypted. However, this still does not prevent redistribution of the compiled program. Although the scripts are not available in clear text, so in this sense your intellectual property is secured. A more detailed description of what MATLAB deployment tool does and does not protect, and a short statement regarding the security of the scheme can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With