Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How safe are P-code files?

Subject: How safe are P-code files?

From: dan berkowitz

Date: 17 Jun, 2010 06:48:04

Message: 1 of 16

Hi,
I am working on some proprietary algorithms and plan on using P-code to distribute my program.

How safe are p-files? Can they be viewed using the debugger? what tips can you recommend to ensure the securit of p-files.

Any help would be appreciated.

db

Subject: How safe are P-code files?

From: us

Date: 17 Jun, 2010 07:35:05

Message: 2 of 16

"dan berkowitz" <aim120c5@gmail.com> wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
> Hi,
> I am working on some proprietary algorithms and plan on using P-code to distribute my program.
>
> How safe are p-files? Can they be viewed using the debugger? what tips can you recommend to ensure the securit of p-files.
>
> Any help would be appreciated.
>
> db

in general, they are very safe...
however, look at this

http://www.mathworks.com/matlabcentral/newsreader/view_thread/271697#713066

us

Subject: How safe are P-code files?

From: dan berkowitz

Date: 17 Jun, 2010 11:43:04

Message: 3 of 16

given this apparent vulnerability, how would you reccomend coding an M file that i want to convert to a p file? i'm trying to avoid hard coding any thing, and am trying to call as many (p-coded) function M-files as possible.

any thoughts would be greatly appreciated.

db

Subject: How safe are P-code files?

From: us

Date: 17 Jun, 2010 12:05:06

Message: 4 of 16

"dan berkowitz" <aim120c5@gmail.com> wrote in message <hvd1o8$m30$1@fred.mathworks.com>...
> given this apparent vulnerability, how would you reccomend coding an M file that i want to convert to a p file? i'm trying to avoid hard coding any thing, and am trying to call as many (p-coded) function M-files as possible.
>
> any thoughts would be greatly appreciated.
>
> db

it depends on what exactly you want to hide, eg, a password(?)...

us

Subject: How safe are P-code files?

From: dan berkowitz

Date: 17 Jun, 2010 12:20:22

Message: 5 of 16

i'm not trying to hide any passwords. just an entire function M-file.

db

Subject: How safe are P-code files?

From: Jan Simon

Date: 17 Jun, 2010 15:12:04

Message: 6 of 16

Dear Dan!

> i'm not trying to hide any passwords. just an entire function M-file.

As you see in the cited thread, you can hide the function, but you cannot hide the actions which happen during execution. It is always possible to go through your P-coded function line by line and overload all toolbox functions.
In conclusion, it is safe to hide actions inside a single line and using symbols, which cannot be overloaded as TRY, CATCH, END, IF, SWITCH, RETURN, ... (see: ISKEYWORD).
E.g. a password check can be:
  a = input('Password', 's'); switch a, case 'thepassword', otherwise return; end
*in one line*. Nevertheless you can use an external debugger together with setting the memory manager to the debug mode to read string tables of the P-file loaded to the memory. Then you'd probably find 'thepassword' in clear text.
Nevertheless, this level of debugging is not easy anymore and by such tricks even the magic DVD key 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 was revealed although the idustry spend millions to hide it.

Is it really a benefit for you or the users/customers if the code is obfuscated?
If so, are there any problems in p-coding all your functions?

Kind regards, Jan

Subject: How safe are P-code files?

From: dan berkowitz

Date: 17 Jun, 2010 15:53:04

Message: 7 of 16

Thank you for the reply Jan. Yes, it is of tremendous benefit to me if the code is all obfuscated. I am trying to pcode ALL the functions M-files. Perhaps that will help?

db

Subject: How safe are P-code files?

From: Jan Simon

Date: 17 Jun, 2010 19:05:21

Message: 8 of 16

Dear Dan!

> Thank you for the reply Jan. Yes, it is of tremendous benefit to me if the code is all obfuscated. I am trying to pcode ALL the functions M-files. Perhaps that will help?

It is your decision if P-coding is helpful.
The possibilities to find and fix bugs in P-coded files are really limited. Maintaining such code is challenging.
Do you have any problems with P-coding all your files?

Jan

Subject: How safe are P-code files?

From: dan berkowitz

Date: 17 Jun, 2010 22:54:04

Message: 9 of 16

that's the direction i'm considering: p-coding all function M-files and the script invoking all the M-files. think that will do the trick? i'm planning on maintaining the code on one computer, and keeping only the p-coded files on the production computers.

any thoughts would be appreciated.

regards,

db

Subject: How safe are P-code files?

From: Peng Xu

Date: 6 Mar, 2013 23:49:08

Message: 10 of 16

It depends. For end-users, p-code may be pretty safe. For hackers, recover the m file does not even need any effort.

"dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
> Hi,
> I am working on some proprietary algorithms and plan on using P-code to distribute my program.
>
> How safe are p-files? Can they be viewed using the debugger? what tips can you recommend to ensure the securit of p-files.
>
> Any help would be appreciated.
>
> db

Subject: How safe are P-code files?

From: anyone

Date: 7 Mar, 2013 00:53:58

Message: 11 of 16

On Wed, 06 Mar 2013 23:49:08 +0000, Peng Xu wrote:

> It depends. For end-users, p-code may be pretty safe. For hackers,
> recover the m file does not even need any effort.

can you demonstrate that?

>
> "dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
>> Hi,
>> I am working on some proprietary algorithms and plan on using P-code to
>> distribute my program.
>>
>> How safe are p-files? Can they be viewed using the debugger? what tips
>> can you recommend to ensure the securit of p-files.
>>
>> Any help would be appreciated.
>>
>> db

Subject: How safe are P-code files?

From: anyone

Date: 10 Mar, 2013 01:50:03

Message: 12 of 16

On Wed, 06 Mar 2013 23:49:08 +0000, Peng Xu wrote:

> It depends. For end-users, p-code may be pretty safe. For hackers,
> recover the m file does not even need any effort.

And you can demonstrate that, or is your comment just so much empty usenet boasting?

> "dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
>> Hi,
>> I am working on some proprietary algorithms and plan on using P-code to
>> distribute my program.
>>
>> How safe are p-files? Can they be viewed using the debugger? what tips
>> can you recommend to ensure the securit of p-files.
>>
>> Any help would be appreciated.
>>
>> db

Subject: How safe are P-code files?

From: Peng Xu

Date: 17 Apr, 2013 23:10:11

Message: 13 of 16

The program that translate p file to m file do exist. Take care.

Peng


anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <513be6cb$0$64353$c3e8da3$5e5e430d@news.astraweb.com>...
> On Wed, 06 Mar 2013 23:49:08 +0000, Peng Xu wrote:
>
> > It depends. For end-users, p-code may be pretty safe. For hackers,
> > recover the m file does not even need any effort.
>
> And you can demonstrate that, or is your comment just so much empty usenet boasting?
>
> > "dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
> >> Hi,
> >> I am working on some proprietary algorithms and plan on using P-code to
> >> distribute my program.
> >>
> >> How safe are p-files? Can they be viewed using the debugger? what tips
> >> can you recommend to ensure the securit of p-files.
> >>
> >> Any help would be appreciated.
> >>
> >> db

Subject: How safe are P-code files?

From: anyone

Date: 18 Apr, 2013 00:25:52

Message: 14 of 16

On Wed, 17 Apr 2013 23:10:11 +0000, Peng Xu wrote:

> The program that translate p file to m file do exist. Take care.
>
> Peng

...and once again, you post that claim but cannot deliver one demonstration or point to a single reference. More
empty usenet boasting?

> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> <513be6cb$0$64353$c3e8da3$5e5e430d@news.astraweb.com>...
>> On Wed, 06 Mar 2013 23:49:08 +0000, Peng Xu wrote:
>>
>> > It depends. For end-users, p-code may be pretty safe. For hackers,
>> > recover the m file does not even need any effort.
>>
>> And you can demonstrate that, or is your comment just so much empty
>> usenet boasting?
>>
>> > "dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
>> >> Hi,
>> >> I am working on some proprietary algorithms and plan on using P-code
>> >> to distribute my program.
>> >>
>> >> How safe are p-files? Can they be viewed using the debugger? what
>> >> tips can you recommend to ensure the securit of p-files.
>> >>
>> >> Any help would be appreciated.
>> >>
>> >> db

Subject: How safe are P-code files?

From: Bruno Luong

Date: 18 Apr, 2013 06:49:09

Message: 15 of 16

anyone <jaup@h/WSWLG{nR1³qH_e> wrote in message <516f3d8f$0$13516$c3e8da3$dd9697d2@news.astraweb.com>...
> On Wed, 17 Apr 2013 23:10:11 +0000, Peng Xu wrote:
>
> > The program that translate p file to m file do exist. Take care.
> >
> > Peng
>
> ...and once again, you post that claim but cannot deliver one demonstration or point to a single reference. More
> empty usenet boasting?

I believe Peng, TMW has this translation program.

Bruno

Subject: How safe are P-code files?

From: Peng Xu

Date: 24 Apr, 2014 02:28:09

Message: 16 of 16

This is not boasting. Send me a file if you want. Let's bet something ^_^

anyone <jaup@h/WSWLG{nR1³qH_e> wrote in message <516f3d8f$0$13516$c3e8da3$dd9697d2@news.astraweb.com>...
> On Wed, 17 Apr 2013 23:10:11 +0000, Peng Xu wrote:
>
> > The program that translate p file to m file do exist. Take care.
> >
> > Peng
>
> ...and once again, you post that claim but cannot deliver one demonstration or point to a single reference. More
> empty usenet boasting?
>
> > anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> > <513be6cb$0$64353$c3e8da3$5e5e430d@news.astraweb.com>...
> >> On Wed, 06 Mar 2013 23:49:08 +0000, Peng Xu wrote:
> >>
> >> > It depends. For end-users, p-code may be pretty safe. For hackers,
> >> > recover the m file does not even need any effort.
> >>
> >> And you can demonstrate that, or is your comment just so much empty
> >> usenet boasting?
> >>
> >> > "dan berkowitz" wrote in message <hvcgf4$9kj$1@fred.mathworks.com>...
> >> >> Hi,
> >> >> I am working on some proprietary algorithms and plan on using P-code
> >> >> to distribute my program.
> >> >>
> >> >> How safe are p-files? Can they be viewed using the debugger? what
> >> >> tips can you recommend to ensure the securit of p-files.
> >> >>
> >> >> Any help would be appreciated.
> >> >>
> >> >> db

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us