Feature Request (?): Encrypted (or obfuscated) Cells

General discussion about Mathematica features and functionality...
Forum Rules
By using the Wolfram Faculty Program Forum, you agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, or sexually oriented material. Wolfram Faculty Program Forum administrators have the right to remove, edit, move or close any topic at any time should we see fit.

Personal Information: Posts in this forum may be viewed by non-members; however, the forum prohibits non-members from viewing your profile. Although your email address is hidden from both non-members and members, your account is initially configured to allow members to contact you via email through the forum. If you wish to hide your profile, or prohibit others from contacting you directly, you may change these settings by updating your profile through the User Control Panel.

Attachments: Attachments are not currently enabled on this forum. To share a file with others on this site, simply upload your file to the online storage service of your choice and include a link to the file within your post. If your school does not offer an online file storage and sharing service, the following sites provide free basic online file storage and sharing: Mozy, FilesAnywhere, Adrive, and KeepandShare.

Feature Request (?): Encrypted (or obfuscated) Cells

Postby Jason_Cantarella » Mon May 16, 2011 6:54 pm

Dear Fellow Mathematica Faculty,

I'm interested in developing various demonstrations for my students where there are some cells in the notebook that run, but that the students can't see. The idea would be to define some Mathematica functions which the students could run, but not examine the source code for. For example,

1) a function for which they can get values, but can't see the formula (they have to use Taylor series to predict values)
2) code from a past student which accomplishes the goal of the project that they can run, but not inspect (to compare their results)
3) code that gives them the average density of material in a disk along a slice at any angle, but doesn't let them see the density function itself (a tomography problem)

In all of these cases, the idea would be to make the students work with a function using the power of Mathematica but with access only to the limited data they'd actually have available in a real-world application. A clunky way to do this would be to write the hidden stuff in C or something, compile it, distribute the executable, and call it with MathLink. But that runs into a bunch of the kind of irritating cross-platform issues that Mathematica is usually so good at avoiding. (Do I distribute windows and mac binaries? How do I test them without both platforms available to me? etc)

So another version of this would be something like "Password-protected cells". They would be encrypted somehow in the .nb file and forced to be not "visible" in the notebook display unless you typed in a password. After entering the password, they would revert to being standard input cells that you could edit at will. But when you saved the worksheet and reopened it, you'd have to enter the password to view/edit again. Then you could distribute worksheets with some protected content and some open content.

Does anybody know if there's an existing feature similar to this (or another clever idea for doing this) in Mathematica 8? If not, how about considering it as a feature request for a future version? ;)

All the best,

Jason.
User avatar
Jason_Cantarella
 
Posts: 2
Joined: Mon Sep 13, 2010 1:03 pm
Organization: University of Georgia
Department: Mathematics

Re: Feature Request (?): Encrypted (or obfuscated) Cells

Postby Kelvin_Mischo » Tue May 17, 2011 9:17 pm

Hi Jason,

I'm sure there are many approaches, but use of a function like Hash[ ] or Encode[ ] would probably be the best fit. I think the best approach is to take the functions you want to hide, save them as packages (.m files) and encode them, post them in a place that your students have access to, and then each students can use the package(s) without seeing the contents. There's a simple example in the documentation:
http://reference.wolfram.com/mathematic ... ncode.html

There isn't a way to password protect cells right now. There are ways to hide them and turn the editable option to false. But in your case, since you are talking about function definitions, I think the above seems like a better approach.

thanks,
Kelvin
User avatar
Kelvin_Mischo
 
Posts: 12
Joined: Fri Sep 11, 2009 9:54 pm
Organization: Wolfram Research, Inc.
Department: Sales

Re: Feature Request (?): Encrypted (or obfuscated) Cells

Postby Jason_Cantarella » Thu May 19, 2011 2:43 pm

Smart! Thank you! I will try that approach. :D

Jason.
User avatar
Jason_Cantarella
 
Posts: 2
Joined: Mon Sep 13, 2010 1:03 pm
Organization: University of Georgia
Department: Mathematics


Return to General Mathematica Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron