http://www.perlmonks.org?node_id=988611


in reply to How to ensure that a supported version of my script is being executed?

I have a Perl script ("use"-ing a number of packages written by me) which is supposed to be run from a particular directory (this is the "supported" version of the script). Some smart users are making a local copy of this script and using that after making whatever modifications they want. How to prevent this?

Make your users sign a contract not to change the code, and only to run the script in the supported way.

Or only provide the software "as a service", i.e. have it run on machines that you control.

I'm serious. There's no reliable way to ensure the integrity of a program (be it Perl, C or anything else) on a machine that somebody else has administrative access to.

Update: as davido++ pointed out, there's a third option: you can make your code flexible enough and provide an API for extensions. Then others don't feel a need to change your code.

  • Comment on Re: How to ensure that a supported version of my script is being executed?

Replies are listed 'Best First'.
Re^2: How to ensure that a supported version of my script is being executed?
by sanbiswa (Initiate) on Aug 21, 2012 at 08:41 UTC
    Thanks for your reply. So you're saying it's not doable, right?

    Not sure why you think the same even for C where all the user gets is the binary and there's no chance of him changing the code!

      So you're saying it's not doable, right?

      Not doable on a technical level, no. Unless you're willing to go the software-as-a-service route.

      Not sure why you think the same even for C where all the user gets is the binary and there's no chance of him changing the code!

      What makes you think that it's impossible to change binaries? Disassemblers, debuggers and other tools exist.

      There's a whole industry around DRM, digital rights/restriction management, and basically all the protections against copying have been cracked. And they all come in binary files, one way or another.

        You're right. I was just thinking in terms of simple readability of the source code.

        Thanks.