Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab source code encryption

Status
Not open for further replies.

stewlik

Newbie level 5
Joined
Jan 23, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
matlab encryption

Hi, all,
has anyone have any idea how (if possible) to encrypt the matlab source code (m-file)?

Regs
Marcin
 

matlab source code

do you mean Obfuscation?
as matlab is an interpreted language it's not posible to Obfuscate like in compiled or intermidate languages C++\Java\.Net
but in newer Matlab versions there is a nice function called
PCODE

or you can compile you m-files with mcc and Obfuscate the resulting application with an Obfuscator (asprotect, or a tweaked version of upx)

Hope this helps :p
 
  • Like
Reactions: superbot

    stewlik

    Points: 2
    Helpful Answer Positive Rating

    superbot

    Points: 2
    Helpful Answer Positive Rating
obfuscated matlab

hey,
thanks,
what about the reliability of the securance of the code (i mean pcode)? is it easy or hard to break the protection?

PS
what is "mcc"
 

how to encrypt matlab code

mcc is Matlabs m to C Converter/Compiler
you need Microsoft Visual Studio installed so you could compile the "m" to "C" files to exe
but for these exe (or dll) files to run you'll need the Matlab Run-time installed (about 200M) and they are slow!

And for the security of p files ? try it out, the output is unreadable by humans, the source for pcode is not open so how it does what it does I don't know. a Mathworks employ could probably break p files but for the rest of us, I don't think so.

Added after 5 minutes:

How to convert m files to p files is easy as pie :)
Write your m files, test them, and then just pcode them:
pcode *.m (backup your m-files and distribute only the p files they run just like any matlab program)

Added after 2 minutes:

And as an added bonus p-files run much faster then m-files They are acutely preparsed so at run-time there is no need for extra parsing
 
  • Like
Reactions: superbot

    stewlik

    Points: 2
    Helpful Answer Positive Rating

    superbot

    Points: 2
    Helpful Answer Positive Rating
matlab encryption pcode

thanks a lot, ill try them all ;)

"And for the security of p files ? try it out, the output is unreadable by humans, the source for pcode is not open so how it does what it does I don't know. a Mathworks employ could probably break p files but for the rest of us, I don't think so. "

yeah, but there are guys who does reverse engineering on .exe, and dlls ;) what I mean by that question is how does the simple pcode protect the file compared to e.g. hardware cipher keys
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top