Can I encrypt the credentials.json file for AWS authentication using MATLAB Compiler?

I have some MATLAB code that accesses an AWS S3 bucket, and I'm compiling it to distribute to end users. I would like to encrypt the credentials.json file which provides authentication so that the user does not have access to this information. I noticed that in the MCR cache, this file is not encrypted like MATLAB files are.
Is there any way I can encrypt this file?

 Accepted Answer

Only MATLAB code will be encrypted into the MCR cache, so unfortunately you cannot encrypt this JSON file. However, you can use the authentication approach which involves setting environment variables using the "setenv" function in MATLAB. This will allow the environment variable values (i.e. your AWS secrets) to be encrypted in the MCR cache because the values are stored in the MATLAB file.
For more information about this approach, please see the following documentation page:

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Release

R2021a

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!