MATLAB standalone application compiler - code obfuscation

8 views (last 30 days)
Does anyone know what does this option does? how does it compare between obfuscated/not obfuscated code?

Accepted Answer

dpb
dpb on 7 Jul 2025
When MATLAB Compiler or Simulink Compiler creates an standalone executable, all the files required for that application are bundled into an archive. In the archive, each MATLAB code file (plain text MATLAB file or P-code file) is encrypted using the standard AES-256 algorithm. By default, the names of files and the directory structure are not obscured and other file types (such as MAT, FIG, MEX, and so on) are not encrypted.
Under doc mcc for the various switches is
-s
Obfuscate folder structures and file names in the deployable archive (.ctf file) from the end user.
Optionally encrypt additional file types.
The -s option directs mcc to place user code and data contained in .m, .p, v7.3 .mat, and MEX files
into a user package within the CTF. During runtime, MATLAB code and data is decrypted and loaded
directly from the user package rather than extracted to the file system. MEX files are temporarily
extracted from the user package before being loaded.
To manually include additional file types in the user package, add each file type in a separate extension
tag to the file matlabroot/toolbox/compiler/advanced_package_supported_files.xml.
The following is not supported:
ver function
Out-of-process MATLAB Runtime ( C++ shared library for MATLAB Data Array)
Out-of-process MEX file execution (mexhost, feval, matlab.mex.MexHost)
In summary, just adds an additional layer of encryption to the source and data files the packaged application contains.

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!