Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a package I want to distribute. I wrote the package in Version 9 under a Mac OS X operating system. I want to Encode[] the package.

The end user will run the package on a full Mathematica Version 9 license running on a Windows OS.

As I don't have access to a Windows machine to test this I wondered if anyone knew whether Encode[] is operating system specific?

Will a package encoded on OS X run on Windows?

share|improve this question
up vote 6 down vote accepted

Encode is not system dependent, but files written by DumpSave[] can only be read on the same type of computer system on which they were written.

share|improve this answer
Two comments: a) Files written by DumpSave can only be read on the same type of computer system, bitness, and version number of M on which they were written. b) Encode is not system-dependent UNLESS it's written with a specific key (then it may be). – Andreas Lauschke Jan 25 '13 at 9:38
@AndreasLauschke -- I had hoped to do this using the target machine ID, Encode["source","dest",MachineID->"ID"]. Thoughts? Do you (or anyone here) think it fair if I add to my question at this point? – Jagra Jan 25 '13 at 13:03
@Jagra: Difficult to discuss those things in comments, as they are very limited here at m.SE. I'll try to be brief, but that usually doesn't work. First, what you're asking here, limiting the use to a given MachineID, is not what you mentioned in your original post. This may become a branch discussion. Next, if we take the text "... to generate an encoded file that can be read only on a computer with a particular $MachineID" from the documentation literally, it would mean it's actually an encryption, not just an encoding. But then you should ask tech support what crypto strength – Andreas Lauschke Jan 26 '13 at 4:52
@Jagra: this feature provides, if it's on par with the provably unhackable systems like AES128, 192, 256, or RSA2048, 4096, or elliptic curve cryptography, etc. I'm pretty sure it's not. Tech support will probably not answer that question, because if it's poor, they don't want to disclose that, and if it were strong, WRI would advertise high crypto strength, which they don't do. So, you can assume this feature is skimpy to begin with. Next, note that the documentation says "On certain computer systems ...", which means it works on some and it doesn't work on others. So they keep you guessing. – Andreas Lauschke Jan 26 '13 at 4:55
@Jagra: But you can solve this system-dependence item yourself: Don't use this option of Encode, use Encode normally, and at the beginning of your encoded file, bail out if it's the wrong MachineID, with something like If[$MachineID=!=...,Print["You are not permitted to use this package. Please purchase a license."];Exit[]]; That way it's guaranteed to work on all systems and you get the same "protection" that this option in Encode is supposed to give you. – Andreas Lauschke Jan 26 '13 at 5:01

I think "by design" Encode is/was not system dependet (neither OS nor architecture), as M.R. has stated. But I remember there were some problems with earlier versions (the following is just from memory and probably not entirely correct, so if it matters and you are in doubt better make some checks):

Before version 8 there were some combinations of OS which would not work, like Encode on Windows and Get on e.g. OSX or Linux. I think that these problems were (silently) fixed in version 8. So if you and your end user will use version 8 or something newer he should be able to Get your Encoded code on any of the supported platforms.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.