Main Content

Security in MATLAB Code

Security considerations for sensitive information and intellectual property in MATLAB® code

You can increase the security of your workflow by keeping sensitive information out of code and by obfuscating code. You can store sensitive information in your MATLAB vault or in a .env file. For more information, see Keep Sensitive Information Out of Code. When obfuscating code, consider combining multiple approaches. For more information, see Security Considerations to Protect Your Source Code.

Functions

expand all

setSecretAdd secret to MATLAB vault (Since R2024a)
getSecretRetrieve secret value from MATLAB vault (Since R2024a)
isSecretDetermine if secret exists in MATLAB vault (Since R2024a)
removeSecretRemove secret from MATLAB vault (Since R2024a)
setSecretMetadataSet metadata of secret in MATLAB vault (Since R2024a)
getSecretMetadataRetrieve metadata of secret in MATLAB vault (Since R2024a)
listSecretsList secret names and metadata sizes from MATLAB vault (Since R2024a)
loadenvLoad environment variables from .env and plain text files (Since R2023a)
pcodeCreate content-obscured, executable files
matlab.lang.obfuscateNamesObfuscate names of local variables, local functions, and nested functions (Since R2024b)

Topics