How to protect my functions which will be called by other programmers?
11 views (last 30 days)
Show older comments
I have some Matlab functions stored in my computer. Other people will call those functions from Matlab in their computer. However, I don't want them to see my codes or copy the files of my functions for some reasons. Are there any solutions for this?
Accepted Answer
Image Analyst
on 2 Feb 2019
See this MathWorks link for a full discussion of protecting your source code by deploying as p-code.
7 Comments
Walter Roberson
on 3 Feb 2019
You can provide a .h file and a shared object such as a .dll, and have them calllib(), with your shared object making https connection to the remote server. You would have to copy or serialize the data and send it to the remote system.
Or you could provide a series of .m or .p functions that use tcpclient() to make https connection to the remote server. You would have to copy or serialize the data and send it to the remote system.
In theory, DCOM permits remote execution (if I recall correctly), but I suspect that would be a pain to get right and configure on all sides; https://www.cybereason.com/blog/dcom-lateral-movement-techniques
More Answers (1)
Stephen23
on 2 Feb 2019
Two steps:
- write your function so that at the start it checks something that only you know about: e.g. your username in the absolute filepath, or the content of a file somewhere. If the check fails, return.
- convert to p-code.
Unless they manage to read your mind it is unlikely that they will know what you are checking.
0 Comments
See Also
Categories
Find more on Call C from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!