Question Obfuscation and Script Protection

Discussion in 'Questions & Requests' started by tcamps, Feb 6, 2018.

Share This Page

  1. tcamps

    tcamps Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    54
    Likes Received:
    25
    What are the rules on obfuscation and script protection?

    I'd like to use [this obfuscator] and apply the "Self-Defending" option, making the script completely unreadable and very difficult to reverse-engineer. Of course, this would also hide the behavior of the script, so it would be hard for Tribal Wars to verify that the obfuscated version submitted is really the original script. I think this might be illegal.

    One way to make sure the script is the original is to provide Tribal Wars Support with the original script, the obfuscated script, and a hash of the obfuscated script. They'd be provided the obfuscator and hash generator websites so that they could recreate the hash and confirm that the obfuscated script matches the submitted script. A disclaimer comment would then be added to the top of the obfuscated script with the hash that has been approved by Tribal Wars, and instructions to verify the hash.

    Of course, then I'd have to submit a new support ticket for every bug fix, new feature, etc...

    What are some other legal methods for protecting scripts?
     
    Last edited: Feb 6, 2018
  2. Ibra Gonza II

    Ibra Gonza II Non-stop Poster

    Joined:
    Dec 12, 2015
    Messages:
    240
    Likes Received:
    112
    Obfuscation is not illegal.

    I always obfuscate my own scripts, for the same reason you would do it. Note that I do send in both versions for approval in a ticket, so in the end they can easily verify the obfuscated version is still the same afterwards :)
     
  3. tcamps

    tcamps Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    54
    Likes Received:
    25
    Minification is legal for sure, what about dead code injection or running the whole script though eval with string encryption? That seems a lot harder to verify
     
  4. Ibra Gonza II

    Ibra Gonza II Non-stop Poster

    Joined:
    Dec 12, 2015
    Messages:
    240
    Likes Received:
    112
    Obfuscation Is legal.
    I'm literally talking about obfuscation, not minification. ;)

    As long as the script doesn't do illegal actions / interactions ingame it's fine.
    If you, as you say, want to put illegal stuff in there with obfuscation, the script is illegal anyway so there's no real sense in the question.

    Scripts are approved based on their functionality and interactions. Not on how the code is written (and whether or not it is obfuscated)
     
  5. LilGhost

    LilGhost Well-Known Member

    Joined:
    Jan 2, 2016
    Messages:
    88
    Likes Received:
    8
    Pretty sure there has never been a rule against obfuscation of scripts, but if you go all-out trying to hide what your script is doing, then of course it becomes harder for a user/player to trust and run your script. Given that my Tribal Wars script hosting website gets hit for about 550,000 script loads each month, I am all for minification of scripts to reduce bandwidth, increase load speeds, etc.; however, if your intent is to obscure your actions within your script, then why are you making public scripts?

    Those of us who write scripts are doing it for the same reasons. We enjoy the game, but we want to take advantage of the game's accepting stance on scripting so that we can improve our own experiences and the experiences of other players. To that end, I see no reason why your scripts should not be clear opensource, unless you are attempting to obfuscate either nefarious or malicious activity. If nothing else, making your scripts understandable allows other members to carry on your legacy, when you eventually stop writing scripts, by continuing development on your most popular scripts. That is obviously much harder to do and in most cases not worth the headache if you decided to obfuscate them.
     
    Ibra Gonza II likes this.
  6. Ibra Gonza II

    Ibra Gonza II Non-stop Poster

    Joined:
    Dec 12, 2015
    Messages:
    240
    Likes Received:
    112
    You know I usually agree with you, Spencer, but I don't on this one :D

    I simply obfuscate my code so that people do not go blindly copy stuff without any kind of credit. I will always give code away / explain how to do something when asked. But I won't allow people to merely copy something they do not understand or show appreciation for. :)

    (and if I grab something from another script that is not mine, at least I'll give the original author credit, but that doesn't happen for some other 'scripters')
    I think it's just a show of some respect for the effort to not blindly copy, even though it concerns public scripts.

    This is btw the same reason why I barely publicize my own scripts and usually keep them private / let them be used by very specific people.
     
  7. tcamps

    tcamps Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    54
    Likes Received:
    25
    I have whitelist/blacklist access protection on some scripts that I don't want people to tamper with, simple as that
     
  8. tcamps

    tcamps Well-Known Member

    Joined:
    Jan 20, 2018
    Messages:
    54
    Likes Received:
    25
    Thank you everyone, this answers my question.

    A separate/related question - is such a whitelist/blacklist legal? Is there any precedent on this? I sent a ticket to TW and 2 weeks have passed without an answer.
     
  9. Ibra Gonza II

    Ibra Gonza II Non-stop Poster

    Joined:
    Dec 12, 2015
    Messages:
    240
    Likes Received:
    112
    Yes. I limit some of my scripts to the specific tribe I am in. It always got approved.
     
    tcamps likes this.