Slashdot Mirror


Has Zend Source Encryption Been Rendered Useless?

tinkertim asks: "Recently I happened upon this freelance job posting and was intrigued by the domain name suggesting Zend decoding. After looking around a bit and finding the sandbox testing, I realized this is not a gimmick. Reverse engineering used to be a service one had to look for at length, and now there's companies offering it hoping to get on the Google top 10. Obviously - they aren't afraid of lawsuits or police action. If Zend and Source Guardian are so easily broken, are PHP developers wasting their time? Should companies selling scripts just open source them now so they have some control over what seems to be the inevitable release of their code? And what happens when vulnerabilities in popular PHP based billing applications that rely on security via obscurity are found from released decoded source?"

21 of 60 comments (clear)

  1. Non-Story by Angst+Badger · · Score: 5, Insightful

    The original poster raises two questions: If the source of obfuscated PHP scripts can be recovered, should PHP script vendors just open source their products now so that they have some control over them? And what about products that depend on security through obscurity?

    In the first case, vendors already have control. It's called copyright. If you misappropriate copyrighted code, there are an amazing vast number of avenues for the aggrieved party to take through a very well-developed legal system. Frequent Slashdot readers are painfully well aware of this system, both through its abuses (SCO) and its creative uses (GPL). If you're trying to conceal trade secrets, that's another matter, but then, if you're trying to conceal trade secrets, you probably aren't implementing them in PHP.

    The second question has the same answer it always has: security through obscurity is weak security. Making the source available makes it easier to crack, but that's all. Inherently weak systems that try to avoid attack by concealing their weakness always fail. PHP is neither here nor there as far as that issue is concerned.

    --
    Proud member of the Weirdo-American community.
  2. It was useless from conception by The+Wicked+Priest · · Score: 4, Informative

    Anyone who paid for this was a sucker.

    However, there's no reason that "can't obfuscate" should translate into "must open-source". Yeah, you have to provide source, because it's an interpreted language. But the license is whatever you want it to be. There was a time, you know, when most programs came with source, but were under commercial licenses.

    Even with compiled languages, source hiding is just lame.

    --
    Share and Enjoy: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
  3. Patent side effects are important here. by Anonymous Coward · · Score: 2, Interesting

    Yes, you can copyright php source code and achieve a degree of protection.
    Copyright in fact originally presumed that you gave the copyright office a clear copy of what was copyrighted, so it would become public domain after a few years. The current distortion that effectively makes copyright last VERY long and that does not require deposit of whole works would tend to guarantee they would eventually disappear, rather than contributing to future utility. In computer software, ever stop to think how many clever programs no longer are available and have sources which were copyrighted but probably exist no more in complete form anywhere? How many wheels have been re-invented (and these days possibly even patented) long after the initial invention?
    Technology that makes it impossible to hide sources may not affect the time of copyright, but it would help ensure that such material in some far distant future may become available. Also and more usefully it will provide evidence of inventions which may inhibit slightly the tendency of Johnny come latelies to patent things that have been invented by others long before. Registering something for copyright really ought to do that now but that is another of the areas various governments have conveniently forgotten.

  4. No. by cperciva · · Score: 5, Funny

    Zend Source Encryption has not been rendered useless, because it never existed in the first place.

    Zend Source Obfuscation, on the other hand, has not been rendered useless because it was already useless in the first place.

  5. Lame by nacturation · · Score: 2, Insightful

    This article should be marked troll. Door locks are there to protect you against thieves by offering a pretty good level of protection against the scum of society. Just because a small percentage of people have figured out how to pick locks, should we do as the poster suggests and simply not lock our doors because it's clearly futile? Obviously not. Things like Zend exist to offer a pretty good level of protection against those who would use the results a person or company's hard work without paying for it. Just because some people are dishonest enough to break that protection doesn't mean that the protection doesn't serve a purpose in the first place.

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    1. Re:Lame by Kadin2048 · · Score: 2, Informative

      Except that this isn't much of a door lock.

      This is like somebody going around selling paper-mache deadbolts and telling you about all the horrible things that can happen to your home if you don't buy one. There's an obvious level of dishonesty in selling something and calling it protection (particularly since they go so far as to call it "encryption") when it's fairly trivial to break, and won't protect you against anyone who wants to steal your stuff.

      The only thing worse than the criminals themselves are the charlatans who try to foist snake-oil "protection" schemes on unwitting consumers and companies.

      --
      "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
    2. Re:Lame by senzafine · · Score: 2, Insightful

      I agree completely. For the most part...even if you don't have the source it only takes a decent programmer to "reverse engineer" the application into code. Zend's encoder serves a purpose...but one of them isn't "make your code impossible for anyone to decode".

      --
      Better than Flickr - Manage, Share, Archive
    3. Re:Lame by SanityInAnarchy · · Score: 2, Interesting
      A person who is an accomplished lockpick can pick your average brass deadbolt in a few minutes or less... so to them, every lock is effectively papier mache.

      Except the difference here is, there are theives who would break in and steal your stuff without also knowing how to pick a deadbolt. Most people who want to steal this source code could do it easily.

      What's more, automatic lockpicks don't work yet (as far as I know), nor can you easily build a robot to pick locks, run in, steal stuff, and bring it straight to the pawnshop. This kind of thing is easily possible with this kind of "encryption" (sorry, "protection") -- I can certainly automate the process of Googling for code that looks like it was "protected" this way, "decrypt" it, and email the results to me, figuring that anyone using this probably has something to hide in their PHP -- maybe a vulnerability, even.

      In any case, would you feel as confident about this if someone really was selling paper-mache deadbolts? If it really is just a question of magnitude, remember, someone still might be able to decompile code fairly quickly (and crack it to do things it tries to prevent, like making a game run without the CD). Compiling, even just to bytecode (and you can do that with some variants of PHP), is more like a real deadbolt. "Encrypting" is paper-mache, and I don't see how it's even "good enough for most".

      Ah, well, at least this is better than the HTML "encryption", which seriously damages the usability of your site, without even slowing down a "hacker" wanting to "steal" your code -- not that you should care about this in HTML, anyway.

      --
      Don't thank God, thank a doctor!
  6. Wow... by mysidia · · Score: 3, Insightful

    Front page on slashdot.. it would appear they are getting their money's worth, in that SEO posting, before that little reverse auction even closes...

    I suppose a link to the site appearing on slashdot front page won't hurt the chances appearing on top of google, et al, right?

  7. SEO? by marcsherman · · Score: 4, Interesting

    I can't shake the feeling that this Ask Slashdot article was posted as part of the SEO contract solicited in TFJobPosting.

  8. 100% spam by nacturation · · Score: 5, Interesting

    As someone else pointed out, it's an even bigger non-story. The freelance job posted is asking for someone to promote zendecode.com to the top of Google, MSN, etc. and posting on Slashdot certainly helps. The link to "Zen decoding" just goes to zendecode.com. The "sandbox testing" link goes to the forums on zendecode.com. And finally, the link to "popular PHP-based billing applications" just goes to modernbill.com and doesn't link to any reports of bugs. The whole thing is 100% spam backed by FUD. Whoever submitted this is trying to get the keywords "zen decoding" and "sandbox testing" ranked in search engines as being popular terms for zendecode.com. And they're perhaps trying to promote ModernBill for keywords such as "PHP billing application" as well.

    --
    Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    1. Re:100% spam by rk · · Score: 3, Funny

      And you're helping by mentioning the aforementioned domain name four times in your post... ;-)

  9. Re:DRM by SanityInAnarchy · · Score: 4, Interesting

    I actually got a response from one company, who called themselves "American Computer Systems". I followed a link from a spam, and they were actually relatively advanced -- they use JavaScript to construct your source from a very long string of alphanumeric characters. At the end, they document.write it. They show this effect off on their homepage. So, I made a textarea in the original page, swapped "document.write(foo)" for "document.(the.text.area).value = foo", then sent it all back to them. Here's the first email I sent them:

    Well, that was an interesting little project. Too bad client-side JavaScript will always be vulnerable to a little tweak here and there, and you didn't even bother to crunch the HTML down ahead of time. It is nice, clean, and readable... Why is it you used to play WMA music? Ah, nevermind, wouldn't have worked, I'm on a Mac at the moment.

    Really, why do you bother? All this does is provide a fun exercise for people like me. I actually automated the process, just for fun. All this does is make the page completely unreadable to people who don't have JavaScript enabled, and it makes it impossible to save bandwidth by compressing the page, as it's now encrypted. Oh, it does compress, but the compressed version of your encrypted JavaScript is twice as big as the compressed version of the original source.

    Anyway, I've found the source code to your main frame, and I've attached it to this email. Now, please stop spamming me, and please find something better to do with your life. And while you're at it, you should read a bit about open source philosophy.

    Now that I look at it, I can see why you'd want to keep it a secret. Looks like you're borrowing source code just like everyone else. That's not a bad thing, but everyone else isn't trying to sell a product on the idea of wanting to not share source code. Someone shared their code with you, but you don't want to share back?

    Well, if you're going to be that way, I guess I won't give you the source code to the program I have which now decrypts the results of your software.

    To my astonishment, I actually got a response. A response somehow defending the position of "encrypting" websites.

    Hi David.

    Thanks for your message. Is nice to read your opinion.You know there is always a better or faster or cheaper way.
    With this program it is the same as with a car. There is no 100% protection, but it help's a lot to lock it.
    By the way I dont steal code to produce my websafe. It is 100% maded here. By the way the original code is abt. the same size
    as the scrambled one. We dont write code like the one you send me. He is already stripped.

    I have seen that your hometown isin the east of the USA. My self I was living quit a while im Maryland. Was a good time David.
    Ok I hope I'm not wasting your time.

    Thanks for your message.

    Erwin

    ps. The wma comes back. Just a filesize problem with one of my providers.

    Funny, I could swear I saw the WMA bit commented out? Ah, well, I'll give him that one, but this is too fun to stop now...

    Erwin Jabor wrote:
    > >
    > > Hi David.
    > >
    > > Thanks for your message. Is nice to read your opinion.You know there is
    > > always a better or faster or cheaper way.
    > > With this program it is the same as with a car. There is no 100%
    > > protection, but it help's a lot to lock it.

    Only, in this case, I have the equivalent of a master key. You're
    better off simply not putting so much value on your HTML design.

    > > By the way I dont steal code to produce my websafe. It is 100% maded
    > > here.

    I meant the code for your website, not your software, and no, it's not.
    You actually give credit to the place you got your hit counter and
    other such things. I can point it out for you if you like.

    The difference is, most w

    --
    Don't thank God, thank a doctor!
  10. ModernBill Security by MGB-Ben · · Score: 5, Informative

    I am one of the developers who works on ModernBill. We are very proactive about security.

    We do not rely on security by obscurity on anything but the licensing. There is a difference between _using_ something and _relying upon_ it. We _rely upon_ proven, peer-reviewed, open source libraries to handle credit card encryption. We _use_ obscurity to help protect our "IP" for the same reason people use locks to protect other types of "property". To not make that distinction is polarizing the dichotomy.

    Another important dichotomy is the distinction between what is possible and what is accessible. This same distinction needs to be made when arguing for the usefulness of open source. It is of course easier to have the source when you want to understand a program. What the encoder does is make the code less easy to understand. Even in decoded form, it is less easy than having the documented code. It also makes it easier to prove that we were the original author of the code.

    That is also why we have unencoded source for most of the code, especially all of the business-specific and display logic that people will likely want to change. We rewrote all of ModernBill over the last year and a half for version 5, which has a front-end for the business-specific and display logic, and a back-end for the business-independent logic. The back-end is encoded to protect our copyright. There is no licensing code in the front-end.

    We are active in protecting our clients' and their clients' security. We encourage the gateways we deal with to allow us to use cross-reference IDs to refer to billing account information for recurring charges, so that the billing account information does not need to be retained. We encourage our clients to use all of the security features we make available to them. We have a fraud prevention add-on (that is only an add-on because of the per-lookup charge we incur on our end), and we make it a point to explain why having lower fraud rates is better for everyone because they get better merchant account rates, and avoid chargeback fees. We rewrote the entire application for version 5.0, making many architectural changes to improve security.

    For example, we don't use cookies or PHP sessions, avoiding well-known security issues involving those. We lock sessions to IPs. We use an IP whitelist, secret key, and SSL for API access. At the interface level, every hit requires a session ID to be either posted or in the URL, and an action ID determined by an unencoded file, which allows an admin to do whatever they like with the action ID lookups. I will be adding an option to have that be randomized per-session. That is all to make remote exploits more difficult just in case the worst happens and a vulnerability is found. We are not foolishly optimistic.

    We have privilege separation by making it possible to separate ModernBill into 4 pieces: the back-end, and the 3 interfaces (admin, client, and order). We don't allow anything encrypted to leave the API, only enter it. All processing of encrypted data must be done by the back-end.

    We deal with security issues ethically and promptly. We take security very seriously. We understand that we write billing software in PHP, and that immediately brings concern. ModernBill is not a typical PHP application. It is written in PHP due to its proliferation and portability, not because we are beginnnig programmers who don't know anything else. BTW, you can watch us at http://www.iseedevpeople.com/ when we are at the office.

    1. Re:ModernBill Security by MGB-Ben · · Score: 2, Informative

      Of course you take application security seriously, would you have any customers if you didn't? I think the article submitter was implying that you obfuscated your PHP code, which doesn't enhance security in any way. The only gain for obfuscation in a commercial web app is to make it enough of a pain for average users to install the system on multiple hosts without licensing that they bite the proprietry bullet. You know it, I know it and your customers know it.

      I think you give the submitter too much credit. Why then would they single out billing software, using the word "rely", and not mention licensing at all? To the submitter, it was all about advocating open source by showing the weekness in encoding, appealing to the security sense of the _users_. That implies that their legitimate use of the software is harmed by the decoding, which implies, just as they said, that we "rely" on it for application security. Otherwise, the argument wouldn't make sense.

      The alternative interpretation that you provide is counter to the submitter's argument. If the encoder prevents illegitimate uses, like someone using it to run their multi-million-dollar business for nothing, then it is obviously not useless. We never claim that the encoding is for anything other than preventing illegitimate uses, and is for _our_ benefit. That is the whole point.

      BTW: Software is covered by copyright, the authors or there employers hold the copyright on their work. Anybody who talks about protecting 'IP' is obfuscating the issue as 'Intellectual Property' implies ownership and you don't 'own' a copyright, you 'hold' or are assigned a copyright.

      All forms of property are imaginary, legal constructs, anyway. Informal language is defined by usage. One could argue the same thing about any form of property, saying that ownership is merely holding the object, and many people actually make that argument, which is actually wrong. The use of the word "hold" also has misleading connotations, but just in a different way. It omits the legal assignment aspect, which you mentioned yourself. At any rate, any of those uses are perfectly valid common usages unless you are in a philosophical debate over the semantics, which we are not.

      Anyway, the only clients who say anything about the encoded source issue are the ones who are technically competent enough that they have NDAs with us, and we work with them directly on any issues they have, so they often see the source anyway. We are very open to working with and trusting our legit clients.

      We are not some megacorp looking for any way we can screw over our clients. We are a very ethically-minded small business, and we all work hard for reasonable compensation, even the owners. I am a Green Party member who boycotts Wal-Mart, and I can still say that, so it must be true. ;)

  11. Re:Doesn't Zend filter comments and rename vars? by HappyDrgn · · Score: 5, Informative

    Zend Encoder first obfuscates function and variable names in addition to stripping comments and whitespace as you speculate, but it also "encrypts" the files into a "binary" form. When you open a Zend Encoded file you get a bunch of text that looks like you just opened a PNG in vi. An example of two lines of PHP code encoded with Zend Encoder looks like this:

    Y2\½\7v~sâù=Ãs"...p1ÅZ,á'¼¼--E"lo"ÑÌX;ë÷f(TM)yöz(r ¥Jè'&áÆÔ@`!ÀÛ¥pUÈ9¼--Y--äEdëýÉÃóEòðB>ðéjòz½Y
    o©Z(ê5"*øÏÏÏÎ>:Ï7` ÛÝæt±:&UM"È÷ëåêSW¼nR éf3ýääl±±8&oe7l£0XMwév1;y|...ÊihÉfÑõùj


    A Zend Encoded PHP file will not run with a standard PHP install. It requires Zend Optimizer, a free download which allows these files to run. According to the docs Zend Optimizer also makes your PHP scripts run faster, I've not really seen a difference.

  12. Re:DRM by Mprx · · Score: 2, Informative

    Using Firefox there's a much easier way: select all, view selection source. Decrypted HTML is shown. This works for any HTML "encryption" method.

  13. Fool proof method discovered by SlappyBastard · · Score: 3, Insightful
    Learn C++. Shhh... don't tell anyone. They're still trying to figure out where the compiler is on their Linux server.

    I code the bulk of my stuff in PHP for the same reason I have no problem using HTML, XML or JavaScript: because I really, really don't think what I code is amazing flaming shit that the Russian mafia is trying to steal.

    I'm still baffled by the number of people who completely lack any perspective about their own coding.

    Most of this business is selling the service, not the product. There aren't many webservices that are so unique that the people involved have to specifically make an effort to control the secret sauce for fear that others will enter thir industry. Yahoo does search quite actively without having Google's code.

    Only HTML "programmers" would be dumb enough to think something like PHP obfuscation was big shit.

    That said, PHP obfuscation sounds like a good business. No one ever went broke selling people's asses back to them.

    --
    I scream. You scream. I assume that means we're both acquainted with the problem. We proceed.
  14. Zend Encoder by MarkAtZend · · Score: 3, Informative

    Earlier this year we were made aware of sites such as the ones pointed out here that offered commercial services to decript the intellectual property of others. We must stress the illegality of such services, and we will fight such efforts in all ways available to us. Let's analyze the problem. The vast majority of PHP code is deployed as a web application. In that case, no-one has access to the PHP code - only to the output of the application (the (X)HTML produced to create the dynamic webpages). The vulnerability discussed in this SlashDot thread therefore does not apply to that scenario. But the strength of PHP is driving another use of the language. More and more software vendors are creating applications that will be distributed traditionally - by download or CD, and in such cases there is a clear necessity to hide the intellectual property that went into the creation of their application. That is what our Encoder products were designed to make possible. As pointed out in this debate, any attempt to encode a language is countered by attempts to decode. There is no language that is exempt from this (Google for " decoder" if you are interested). In the case of PHP, encoders may well encrypt the language that makes up the IP in the application, but at runtime it has to be decrypted to the format that the PHP interpreter can process. Those who are smart enough to snoop into the interpreter can see the straight PHP code being executed. This is true for Zend, IonCube and all others who provide encoding solutions. The metaphore of using keys to lock your house is applicable. It will not stop the most determined thief, even if it does keep out most of them. And as thiefs become more sophisticated, we want to make our locks more robust. Zend Technologies has been pursuing an additional strategy of encoding. Today, even if the decoders manage to recreate the code encrypted by our newest product, Zend Guard 4, they will find little if anything that will be meaningful to them. The reason for that is the strong obfuscation that Zend introduced with Zend Guard 4 - it is the first product that obfuscates object oriented programs created with PHP 5.x. The decoders may be at work to figure out how to reconstruct the original code from this obfuscated code, but they should know that we'll deliver even stronger obfuscation in the 4th quarter of this year. They will have to keep investing time and money to keep up with our development cycle, not to mention figuring out how they can make a business out of this illegitimate activity. ==== When the news of the decoders broke earlier this year, we informed all our customers (and former customers) about the situation, what steps to take, and made Guard 4 available to them for free when it shipped in April. Thousands of them have upgraded and are ahead of the decoders today. Through their ongoing relationship with Zend they will stay ahead. ==== So TinkerTim has an option to release his PHP application securely - and if he was a Zend Encoder customer he would have known. If his intent is not that, but instead to promote the decoders, then our message to him is that we will make his life very difficult by continually advancing the encryption technology. Mark de Visser Zend Technologies PS - because of a trademark dispute with a European company we had to change the trademark for our product to "Zend Guard" (we combined the functionality of Zend Encoder and Zend SafeGuard Suite in this new release).

    1. Re:Zend Encoder by MarkAtZend · · Score: 2, Informative

      My apologies, I should have hit preview first. Here is the formatted version:

      Earlier this year we were made aware of sites such as the ones pointed out here that offered commercial services to decript the intellectual property of others. We must stress the illegality of such services, and we will fight such efforts in all ways available to us.

      Let's analyze the problem. The vast majority of PHP code is deployed as a web application. In that case, users of the web application have no access to the PHP code - only to the output of these applications (the (X)HTML produced to create the dynamic webpages). The vulnerability discussed in this SlashDot thread therefore does not apply to that scenario.

      But the strength of PHP is driving another use of the language. More and more software vendors are creating applications that will be distributed traditionally - by download or CD, and in such cases there is a clear necessity to hide the intellectual property that went into the creation of their application. That is what our Encoder products were designed to make possible.

      As pointed out in this debate, any attempt to encode a language is countered by attempts to decode. There is no language that is exempt from this (Google for "[your language] decoder" if you are interested). In the case of PHP, encoders may well encrypt the language that makes up the IP in the application, but at runtime it has to be decrypted to the format that the PHP interpreter can process. Those who are smart enough to snoop into the interpreter can see the straight PHP code being executed. This is true for Zend, IonCube and all others who provide encoding solutions.

      The metaphore of using keys to lock your house is applicable. It will not stop the most determined thief, even if it does keep out most of them. And as thiefs become more sophisticated, we want to make our locks more robust.

      Zend Technologies has been pursuing an additional strategy of encoding. Today, even if the decoders manage to recreate the code encrypted by our newest product, Zend Guard 4, they will find little if anything that will be meaningful to them. The reason for that is the strong obfuscation that Zend introduced with Zend Guard 4 - it is the first product that obfuscates object oriented programs created with PHP 5.x.

      The decoders may be at work to figure out how to reconstruct the original code from this obfuscated code, but they should know that we'll deliver even stronger obfuscation in the 4th quarter of this year. They will have to keep investing time and money to keep up with our development cycle, not to mention figuring out how to make a business out of this illegitimate activity.

      ====

      When the news of the decoders broke earlier this year, we informed all our customers (and former customers) about the situation, what steps to take, and made Guard 4 available to them for free when it shipped in April. Thousands of them have upgraded and are ahead of the decoders today. Through their ongoing relationship with Zend they will stay ahead.

      ====

      So TinkerTim has an option to release his PHP application securely - and if he was a Zend Encoder customer he would have known. If his intent is not that, but instead to promote the decoders, then our message to him is that we will make his life very difficult by continually advancing the encryption technology.

      Mark de Visser
      Zend Technologies

      PS - because of a legal dispute with a European company we had to discontinue the trademark "Zend SafeGuard", and replaced that with "Zend Guard" (we combined the functionality of Zend Encoder and Zend SafeGuard Suite in this new release).

    2. Re:Zend Encoder by Anonymous Coward · · Score: 2, Funny

      So, trying to obfuscate your posts, too, by eliminating whitespace?