create a function while protecting it's code

조회 수: 4 (최근 30일)
Nathan Bblanc
Nathan Bblanc 2020년 9월 15일
댓글: Nathan Bblanc 2020년 9월 16일
i am working towards publishing my code. while most of it i hope to publish as an open source code, there is one function that i would like to leave protected and encrypted. i understood that there are three options:
a. publishing a p-code- I understand this option is insecure and not reccomended
b. password protecting my file- could that really work? wouldn't that be easy to by-pass by a skilled matlab person is there a secure function that does that?
c. compile creating a stand-alone file. my problem with this is that (i think) such a stand-alone file would be difficult to implement as part of a general, open-source matlab code. would it be possible? is it possible to create an executable file that communicates well with matlab? would be thankfull for any examples or references
many thanks
Nathan

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 9월 16일
I think you can try to create a mex function using MATLAB coder. It compiles your MATLAB code using C or C++ compiler and converts it into a binary file. However, you can directly run it insider MATLAB like a normal function. The MATLAB source code is not accessible through mex file.
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 9월 16일
If you have MATLAB code, then go to the APPS tab and open the MATLAB coder app. The App provides a pretty intuitive workflow to generate the mex file. This link will also be helpful: https://www.mathworks.com/help/coder/ug/how-to-generate-mex-functions-using-the-matlab-coder-project-interface.html
Nathan Bblanc
Nathan Bblanc 2020년 9월 16일
thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by