Dear MathWorks Team,
We, Centre for Marine Science and Technology of Curtin University have developed a Matlab toolbox called CHORUS (Gavrilov A.N. and Parsons M.J.G. (2014), “A Matlab tool for the Characterisation Of Recorded Underwater Sound (CHORUS)”, Acoustics Australia v.42, No.3, pp. 190-196) for analysis of ocean noise data, including whale detection. The toolbox is under ongoing improvement to include more models of underwater sound recorders and new features. All routines needed to work with the main program CHORUS GUI where compiled into a stand-alone CHORUS.exe program in Windows to allow researchers with little experience in Matlab to work with CHORUS. It’s available from our website. Recently we decided to make it available for Mac users as well. We compiled the package on a Mac computer and the resulting CHORUS.app works well on Mac machines.
However, when I copied CHORUS.app into a Windows-based computer, I saw it as a folder with many subfolders. It wouldn’t be critical, if one of the subfolders didn’t contain all source codes which we wouldn’t want to be publicly available. Please, let us know, if there is any way to hide the source code in the application compiled on a Mac.
Thanks, Alexander

 Réponse acceptée

Rik
Rik le 21 Mai 2021

0 votes

I don't know the actual answer, but you might try p-code. It is not fool-proof, but it is fairly tricky to find the way to decompile back to the original m-code.
Another layer of obfuscation you could use is my minify function, which you can use to remove comments and rename functions and variables.
Either method will only work for the back-end of your application, but that shouldn't be an issue, as a GUI should be an interface between the user and your 'real' functions.

2 commentaires

Alexander Gavrilov
Alexander Gavrilov le 21 Mai 2021
Thanks Rik for a prompt reply and advice. We will try both oprions and let Matlab community know about results
through this post.
Best regards, Alex
Rik
Rik le 21 Mai 2021
You're very much welcome. I would recommend combining the two.
You should note that neither is a perfect solution or will provide actual security. For that you would probably need to compile a binary from obfuscated generated C (or C++). Depending on how important keeping your source secret is to you, that might or might not be too much effort.

Connectez-vous pour commenter.

Plus de réponses (1)

Steven Lord
Steven Lord le 21 Mai 2021

0 votes

If you're generating a standalone application using MATLAB Compiler, your files are turned into a deployable archive that is encrypted using the AES cryptosystem. If you try looking at the contents one of the files from that archive I would be very surprised if you could read it.

4 commentaires

Alexander Gavrilov
Alexander Gavrilov le 22 Mai 2021
Hi Steven,
Unfortunately, it's not the case. Yes, if you compile a stand-alone application in MacOs, it will result in a single .app program that you can run in MacOs. However, this .app file will look as a folder in Windows, with multiple subfolders, with one of which containing the original .m scripts.
Regards, Alex
Walter Roberson
Walter Roberson le 22 Mai 2021
In MacOS, a .app is a structured folder containing information about the application, and containing the binary executable, and containing libraries needed to execute. The idea is that a MacOS app should be self contained for everything except operating system libraries.
When an application is compiled with MATLAB Compiler, the resulting bundle is a self-extracting archive. The archive contains encrypted copies of the source code. You will be able to see all the file names but the file content should be encrypted.
Alexander Gavrilov
Alexander Gavrilov le 23 Mai 2021
Many thanks Walter. Yes, the names of Matlab source code files are seen in Windows as .m files, but when I try to open any of them, I see the contents encrypted. Alex
Alexander Gavrilov
Alexander Gavrilov le 23 Mai 2021
PS. I'm really sorry that I haven't check this before sending a request to MathWorks.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange

Produits

Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by