help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: binary versions of functions


From: Paul Kienzle
Subject: Re: binary versions of functions
Date: Sun, 10 Oct 2004 21:38:17 -0400

Brian,

Short answer is no.

Octave does not have a virtual machine but instead interprets code by walking the parse tree, so enterprising students would always be able to create a modified version to decrypt the binary functions. Of course, students who take the initiative to work around whatever code obfuscation you put in place probably don't need to cheat in the first place, so maybe simple solutions aren't so bad. Renaming all variables to A##, where ## is chosen automatically is a good first step, as is stripping all comments and formatting. You could do the same with keywords, and have a function loader that first translated the hashed keywords to the proper words then define the function by passing the resulting string to eval.

Turning your code into a C++ extension doesn't help. Even assuming the m-file to C++ translators were far enough along for your purpose, the GPL requires that you distribute the source for any oct-file that you supply. On the other hand, it is not clear to me whether the code is 'redistributed to the students' if they run the binary stored in your account on a common server from their account, so maybe an m-file to oct-file translation would be sufficient.

You could use the parallel octave code from octave-forge. Put a version of octave on a server which has you private functions available. Students could send octave commands to the server and get back the results. You would have to remove a number of commands from the interpreter for this to be secure, such as type, file_in_loadpath, fopen, system, and maybe some others. Such work is needed to make Octave safe for use on the web, so please contribute anything you do back to the community. Although your use violates the spirit of the GPL, as far as I know is still allowed.

- Paul


On Oct 10, 2004, at 7:49 PM, Brian Blais wrote:
I have only recently been introduced to octave, and really like it so far. Most of my experience comes from Matlab, but I have used Scilab for about a year. I was wondering if the following thing is possible in octave. Sometimes, during my teaching, I like to give students code that works, but is only runnable, not readable. In Matlab you can make p-files, and in scilab you can save functions as .bin files, and load them later. In each of these cases the students can load and run the code, but can't see the source. Is there such a thing in octave? If not, can anyone think of some way I could distribute working code, but not have the source readable?



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]