http://qs321.pair.com?node_id=558838


in reply to scramble ad link

This is more an obfuscation problem than anything else. Sure, there are millions of ways to encrypt the link, but anyone with half a brain will still be able to figure out where it is in the code, even with little or no programming experience. What you need to do is add a verification routine entirely separate from the link print (and preferably hidden somewhere they aren't likely to look) that loads the script, computes a hash of its size and/or contents, and checks it against an internal hash to make sure the script hasn't been modified. Then if they remove your link, the script errors out, and most people won't be smart enough to figure out why.

Replies are listed 'Best First'.
Re^2: scramble ad link
by GrandFather (Saint) on Jul 02, 2006 at 09:43 UTC

    Note Re: $. - smarter than you might think which describes using <DATA> to access the source of the script. That's a neat way to get the source actually being executed and if there is any excuse (like configuration parameters for example) to have a __DATA__ section then much of the code pertaining to the tests can vanish from sight as being relevant to checking configuration.

    The code protection could be made rather strong by requiring a key (some of the source) to decode important parts of the code that then get executed using eval.


    DWIM is Perl's answer to Gödel