Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to hide mathematica code?

  • To: mathgroup at
  • Subject: [mg64489] Re: How to hide mathematica code?
  • From: albert <awnl at>
  • Date: Sun, 19 Feb 2006 05:35:57 -0500 (EST)
  • References: <> <dt6kn6$nh2$>
  • Sender: owner-wri-mathgroup at

> I think the answer is yes (with one reservation). Here is an example:
> In[1]:=
> f[x_]:=x^2;
> In[2]:=
> SetAttributes[f,{Locked,Protected,ReadProtected}]
> In[3]:=
> DumpSave["",f];
> Now quite the kernel and read in the file "".
> In[1]:=
> << ""
> In[2]:=
> f[2]
> Out[2]=
> 4
> In[3]:=
> ?f
> Global`f
> Attributes[f] = {Locked, Protected, ReadProtected}
> Opening the file also does not reveal any information about f.
> The only problem is that the file is not portable to a different
> platform.
Instead of using a binary dump you could use Encode[] to encode the
package-file. Then you can use the regular Get or Needs-constructs to load
the package. Encode should generate to a portable package which is still
not readable. I am not sure whether that is still true, but I remember that
for at least version 4 encoded packages were portable between Linux and
Windows when encoded in Linux, but not when encoded in Windows. I don't
know about Macs and other Unices for sure, but that's something that the
support at Wolfram's should be able to answer if it is a matter for you. 



  • Prev by Date: Re: Using a text editor like interface for Mathematica?
  • Next by Date: Re: Showing Animation Outputs together
  • Previous by thread: Re: How to hide mathematica code?
  • Next by thread: Re: How to hide mathematica code?