How can I protect files other than .m file with Matlab compiler?

22 views (last 30 days)
After I compiled the matlab files and other non-matlab files successfully, I found that when users run the executable files, the extraction of the executable will expand all files into temporary folders. All Matlab files are encrypted but all other files are just original files without any protection (not encrypted). Do you have any idea to protect the non-matlab files as well? Thanks.
  1 Comment
Walter Roberson
Walter Roberson on 4 Feb 2018
Mathworks does not provide any facility for this.
In some cases, you could use your own encryption function. However some routines such as imread() only read from unencrypted files, so you might have to do a notable amount of work to replace those functions, such as finding a combination of Java stream functions that can process them.

Sign in to comment.

Answers (1)

Jan on 5 Feb 2018
If you want to deliver encrypted files, encrypt them before the compilation. Then you Matlab code must contain the required decryption methods.
Remember that the keys for the decryption must be included in your compiled code. Then the keys can be found more or less easily also. If the files should be read by standard methods like imread, load etc., this will not work directly. Decrypting the files at first will leave clear text data on the disk.
Walter Roberson
Walter Roberson on 5 Feb 2018
In my experience, the easiest way to ensure that no-one will defeat your encryption system, is to make your program bug-ridden and useless: if the "value" available to be extracted from your program is pretty much zero, then it is not worth anyone's time to analyze it.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!