Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Hiding your Script

by perlhaq (Scribe)
on May 30, 2005 at 22:39 UTC ( [id://461875]=note: print w/replies, xml ) Need Help??


in reply to Hiding your Script

It depends greatly on where the code is being executed.

If it's on a server that you control, and nobody else has root access, then you can do things to make it virtually impossible for any regular user on that machine to view your code. Some OS's have better facilities for doing this than others. For instance, on OpenBSD you can set very restrictive file permissions:

chown root.wheel script.pl
chmod 111 script.pl
And then regular users can still execute that script, but they can't read it with 'cat' or any system call that does open() on that file (in fact you can't even run it as "perl script.pl", it can only be run when invoked directly like "./script.pl"). However, an advanced user would still be able to retrieve your code from the memory, using ktrace & kdump. But this opportunity can be closed with OpenBSD's systrace utility. Then the only way the user can view your code is if he manages to obtain root access, a very unlikely scenario on an OpenBSD machine...

But if the code is being executed on the user's machine, where he has root or admin privs, then there's very little you can do to protect it. It then basically comes down to how technically savy the user is, and how badly he wants your code. If you set the bar high enough (with source filters, encryption, and general obfuscation techniques), then it's quite possible the "technical illeterates" (ie, most people) won't be able to access it, and most true hackers won't care to invest their time to do so. But it still only takes one guy to crack it and distribute the code...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://461875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found