SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to remove spaces and line breaks to "protect" php script?

    I have a script that I wrote, which I'm a bit worried people will steal.

    I understand there is no way to really "protect" a script, since it's server side interpreted. However, I was wondering if there is a utility or way to remove all the extraneous spaces and line-breaks from the file.

    So it would be one giant line of text.. much harder to read or modify.

    Anybody know how to do this?

    Thanks!
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try obfuscator:
    http://pobs.mywalhalla.net/

  3. #3
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by hstraf
    I understand there is no way to really "protect" a script, since it's server side interpreted. However, I was wondering if there is a utility or way to remove all the extraneous spaces and line-breaks from the file.
    wouldn't your PHP script (the actual script itself) not be accessible to the "world" since it's server-side interpreted and not the other way round??

  4. #4
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Smarty, eh?

    I'm talking about protecting it from the people who are installing and using it. I don't want them to copy it or modify it and then re-distribute it, etc..

    Thanks!
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  5. #5
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey at least give me the benefit of the doubt... if you go read your post again you were really quite ambiguous (i even thought you're confused about how PHP works )...

  6. #6
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry about that.. I didn't mean to jump on you like that!

    Been a long day, and I should have posted better.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  7. #7
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    unless you can write some sort of install script that will do everything needed to install the script, you shouldn't do it, or just don't distribute your script.

    Distributing a script means someone, somewhere will copy/cut/edit/whatever your code.

    Unless of course you can afford the Zend encoder, in which case you can just encrypt the whole thing.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  8. #8
    SitePoint Guru
    Join Date
    Mar 2002
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm confused, if it's php nobody can have access to it
    unless you mean people you share ftp info with.

    The web site visitor couldn't possibly get your php script.

    Are you talking about a php script or client side script like javascript? I am confused

    Thanks.

  9. #9
    And your point is.... redgoals's Avatar
    Join Date
    Feb 2002
    Location
    Birmingham, UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think the guy means making the script freely available so people can use it, he wants to mumbo-jumbo up the code so no-one can hack it and it make appear as theirs.
    http://redgoals.com ... my site ... nuff said

  10. #10
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why even bother? If someone wants to steal your script, they will be able to. They can go to every ; and hit enter after it, and it'll be readable.

    If you're *that* worried about people plagiarising your script, then don't release it. But it's not that big of a problem. Remember, you've got the law on your side.

  11. #11
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by qslack
    Why even bother? If someone wants to steal your script, they will be able to. They can go to every ; and hit enter after it, and it'll be readable.
    I guess they could, but what I'm after is a simple method of just "discouraging" people from copying. Making it just a tad harder.

    Remember, you've got the law on your side.
    Ya.. but I don't have the cash on my side.. so the law doesn't really matter.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!

  12. #12
    SitePoint Member burchyk's Avatar
    Join Date
    Mar 2002
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what I think:

    If your script is so much complicated or very creative so you want others not to be able to understand, they won't even when it looks like readable script, unless someone reading is a fine php-programmer. Then he will understand it for sure, even if you make such a trick with line breaks or anthng.

    Anyway, if the script is such a Great Thing, just rewrite it with other compiled language, such as C or something (it won't be a hard task for Such A Cool Programmer Who Wrote Such A Cool Script )

  13. #13
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will definitely discourage casual users from changing "Script made by hstraf" on the bottom of the page to include their name instead of yours. But for anyone who wants to copy, it's a lot more work creating their own script than de-obfuscating yours. I think it's a lost cause.

    Do I get any lobbying power over you since I gave you a buck?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •