Encrypted file for account info in email script
2 views (last 30 days)
I have this script to send emails using MATLAB:
props = java.lang.System.getProperties;
sendmail('RECEIVER ADDRESS','I did it','I can also send attatchments');
and while the script itself (when filled in with the correct information) does function as intended, the inclusion of the email username and password in the .m file is obviously insecure. Does anyone know of a way of both encrypting a file with the information, and getting matlab to read it?
Pravarthana P on 16 Feb 2022
Edited: Pravarthana P on 16 Feb 2022
Hi Alexander Ketzle, it can be understood that you are trying to protect the data that is present in your MATLAB source code. This is a known issue, for which you can find the possible workarounds as stated below:
1. You can replace your SMTP server username and password in your MATLAB preferences with blank values. You can do this by typing the following commands at the MATLAB command prompt:
2. You can always convert into Pcode that obfuscates the code although this doesn’t provide complete encryption of your code.
You may find the following link helpful: