Results 1 to 9 of 9

Thread: how to obfuscate php code

  1. #1
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default how to obfuscate php code

    Does anyone know if there is any way to obfuscate php code without using the tool below:
    http://www.codelock.co.nz/howitworks.htm

    Many thanks in advance.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Short answer... not really... no. It's possible, sure. But I can't tell you how to do it.

    PHP is totally secure on the web except if someone gains access to your server. So that's not a problem.

    The only time this would be an issue is if you were planning to sell or give your code to people and hope they don't reverse engineer it. In that case, 1. You can probably afford the cost, if you're making money, and 2. it IS possible to decrypt, but just hard. So.... not totally secure.

    Sorry if this isn't too much help.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If you're looking for an obfuscator, the only one to use would have to be the the official Zend Guard. However, the necessity and morality behind this are both questionable.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Jul 2006
    Posts
    95
    Thanks
    21
    Thanked 0 Times in 0 Posts

    Default

    Thanks to both for your iputs.
    I encrpted the source code but because the page have both html code and php code, it did not work alright.
    Is there a way to just encrpt the html code and leave the php code alone?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's not a good idea. For one thing, "encrypting" one's source code means that the page becomes dependant on client-side scripting; for another, it's necessary to provide the key to "decrypt" the source so that the browser can read it, meaning that it's never secure. The costs far outweigh the benefits.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    The browser MUST be able to know what the code is. If you are just trying to hide your source, don't bother. You must output the source to the browser.
    Even if obfuscated, if someone who would steal it really wants to do so, then there's not much you'll be able to do to stop them. The only other thing it'll do is cause problems, like Twey said.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default another obfuscator

    Try http://www.obfusc.com
    It works fine!

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Obfuscation offers better protection then any form of encoding/encryption because can't be reversed!
    What a lot of pants. If it can't be reversed, then it's not encryption or obfuscation: it's destruction. If the server can't read your code, you've just wasted one heck of a lot of your time.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Haha. The 'lot of pants' description does, oddly, fit quite well.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •