dcsimg
www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 28

Thread: please recommend javascript obfuscator

  1. #1
    Join Date
    Aug 2008
    Posts
    1

    please recommend javascript obfuscator

    Hello,

    I have a need to make my javascript really difficult to study.
    A lot of people think that this is useless waste of resources, but they
    are wrong IMHO.
    I need your recommendation of javascript obfuscator. Googling gives about 5 products. Which of commercial ones do you recommend?
    The javascript obfuscator by stunnix looks most appealing to me, but I didn't check neither it nor others. Any ideas?

  2. #2
    Join Date
    Feb 2008
    Posts
    14
    Try Dean Edward's /packer/ with the Base62 encoding option checked. That will make it almost impossible to decipher:

    http://dean.edwards.name/packer/

  3. #3
    Join Date
    Aug 2007
    Posts
    3,767
    Just a quick note, all someone has to do to view your source with packer is change eval to document.write. Not only that, but Dean himself has provided the same functionality in the packer (the decode button).

    Stunnix is good, but it will make your source code longer and much less efficient. If you are willing to take that over head, I'd go with it.

  4. #4
    Join Date
    Feb 2008
    Posts
    14
    oh, good to know

  5. #5
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    How did "crymari2" manage to make this post, but his/her post count is 0 ?

    P.S.

    I've never understood the use of javascript obfuscator's - but if you like them - more power to you - I'll just never purchase a thing from you or ever hire you to do any work for me. But, that is just in my humble opinion.
    Last edited by slaughters; 08-04-2008 at 04:41 PM.

  6. #6
    Join Date
    Feb 2006
    Posts
    2,930
    usx ufvjapx gwus valjmheuxt hvtx wm wu pvvdm qvfx wruxfxmuwrn user wu fxeppb wm.

  7. #7
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    The issue with any JavaScript obfuscator is that it needs to include the code that will convert it back to plain text in the code itself. That makes it relatively easy to unobfuscate the code.
    Stephen

  8. #8
    Join Date
    Aug 2007
    Posts
    3,767
    Since that one he posted to puts all the numbers into base 8 and things like (10+30-20) instead of 20, puts all characters in strings in hex and changes all variable names to random strings of loads of characters, it's not easy to unobfuscate. It does make the code much less efficient and more verbose though.

  9. #9
    Join Date
    Nov 2002
    Location
    England
    Posts
    693
    The issue with any JavaScript obfuscator is that it needs to include the code that will convert it back to plain text in the code itself. That makes it relatively easy to unobfuscate the code.
    That is not strictly true; consider the following:

    PHP Code:
    <script>

    function 
    Vector(xyz){

    this.x;
    this.y;
    this.z;

    this.add = function(vector){

    return new 
    Vector(this.vector.xthis.vector.ythis.vector.z);

    }

    return 
    this;

    }

    var 
    vec = new Vector(101220);
    var 
    vec2 = new Vector(171670);
    var 
    vec3 vec.add(vec2);

    alert(vec3.y);


    function 
    a(z,t,f){

    this.afg z;
    this.jpk t;
    this.uyt f;

    this.shj = function(atr){

    var 
    ghu = new Object(); 

     for(
    tre in this){

     if(
    typeof this[tre] != "object" && typeof this[tre] != "function"){
        
    ghu[tre] = this[tre] + atr[tre]; 
     }else{

     
    ghu[tre] = this[tre];

     }

     }

    return 
    ghu;

    };

    return 
    this;

    }

    var 
    = new a(101220);
    var 
    rt = new a(171670);
    var 
    so r.shj(rt);

    alert(so.jpk);
    </script> 
    If you have a large object oriented program and you follow the second design pattern above people will give up trying to unobfuscate your code as it will be a nightmare.

    Regards

    Carl
    Last edited by Scriptage; 08-05-2008 at 07:41 AM.

  10. #10
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    Quote Originally Posted by Scriptage
    That is not strictly true; consider the following...l
    Obfuscating makes the assumption that your code is so good that others want it. Most of the time this is not even close to true.

    Non-developers, who would never look at the code any way, can still use it without understanding it.

    Web developers who are interested enough can decode it.

    But in the end, who cares ? Web developers good enough can write the functions themselves, or adapt similar scripts from people who are more interested in helping instead of hiding.

  11. #11
    Join Date
    Nov 2002
    Location
    England
    Posts
    693
    Originally Posted by Scriptage
    That is not strictly true; consider the following...l
    Please do not quote me out of context; that comment was in response to:

    The issue with any JavaScript obfuscator is that it needs to include the code that will convert it back to plain text in the code itself. That makes it relatively easy to unobfuscate the code.
    Obfuscating makes the assumption that your code is so good that others want it. Most of the time this is not even close to true.
    Yet again you are wrong. People make money from selling Javascript, therefore, they want to secure their asset; people deem it good enough to buy so the producer secures it to the best of his / her ability.

    Non-developers, who would never look at the code any way, can still use it without understanding it.
    Not if the Javascript is an API.

    Web developers who are interested enough can decode it.
    How long do you think it would take to decipher 30k of the code in the format above? Have you looked at the source to Google Maps?

    But in the end, who cares ? Web developers good enough can write the functions themselves, or adapt similar scripts from people who are more interested in helping instead of hiding.
    People who make money from doing their job care. It's all well and good expecting people to put hours and hours of work into creating a product and then give it away for free but this is the real world.

    Regards

    Carl

  12. #12
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    ...How long do you think it would take to decipher 30k of the code in the format above? Have you looked at the source to Google Maps?
    I would not decipher it. I would just see what it was doing then create my own.
    ...People who make money from doing their job care. It's all well and good expecting people to put hours and hours of work into creating a product and then give it away for free but this is the real world
    I live in the real world. I just sell the service, not the code.

    Face it. There is no code that you, I, or any other developer can come up with that others can not re-create. So, don't sell the code. Sell your services as a developer who solves unique problems.

    P.S.

    You mixed the first comment, which was from Scriptage, with the rest, which were all of mine.

  13. #13
    Join Date
    Aug 2007
    Posts
    3,767
    Quote Originally Posted by Scriptage
    People who make money from doing their job care. It's all well and good expecting people to put hours and hours of work into creating a product and then give it away for free but this is the real world.
    The only people who steal code are those too ignorant or incapable of writing their own, or using some of the prepackaged code that exists (jQuery, all of it's plugins, sortable etc.). You don't have to worry about those people because since they cannot actually do it themselves, or use the code that does it for them they won't be making money from it for sure. Look at the amount of people who post here with code that is obviously stolen, they are always incapable of fixing the smallest problem in it.

    You are contradicting yourself. If people are making money from their job, they won't be giving away anything for free, even if some ignorant developer - though they'd probably call themselves a javascripter or similar - tries to use it again.

  14. #14
    Join Date
    Nov 2002
    Location
    England
    Posts
    693
    I would not decipher it. I would just see what it was doing then create my own.
    Photoshop is a good program, fancy having a crack at that?

    I live in the real world. I just sell the service, not the code.

    Face it. There is no code that you, I, or any other developer can come up with that others can not re-create. So, don't sell the code. Sell your services as a developer who solves unique problems.
    The following articles may be of great interest to you:

    http://www.sitepoint.com/article/pro...s-web-business

    http://www.sitepoint.com/blogs/2005/...d-of-services/

    The only people who steal code are those too ignorant or incapable of writing their own, or using some of the prepackaged code that exists (jQuery, all of it's plugins, sortable etc.). You don't have to worry about those people because since they cannot actually do it themselves, or use the code that does it for them they won't be making money from it for sure. Look at the amount of people who post here with code that is obviously stolen, they are always incapable of fixing the smallest problem in it.
    That's a bit of a sweeping generalisation and complete conjecture; if a Javascript program is making somebody a lot of money you can bet that some people would steal the code or ideas from the code, repackage and sell it.

    You are contradicting yourself. If people are making money from their job, they won't be giving away anything for free, even if some ignorant developer - though they'd probably call themselves a javascripter or similar - tries to use it again.
    I fail to see how I am contradicting myself here. Read the statement again:

    People who make money from doing their job care. It's all well and good expecting people to put hours and hours of work into creating a product and then give it away for free but this is the real world.
    If you do not try to conceal the source you may as well give the code away. If the source code for Photoshop was readily available how many people would compile the program? How many imitation Photoshops would be around?

    Regards

    Carl

  15. #15
    Join Date
    Aug 2007
    Posts
    3,767
    Quote Originally Posted by Scriptage
    If a Javascript program is making somebody a lot of money you can bet that some people would steal the code or ideas from the code, repackage and sell it.
    No JavaScript program makes someone money. Programs aren't written in JavaScript. If you can point to one example of where someone makes money from a JavaScript "program", please show it to me.
    Quote Originally Posted by Scriptage
    If you do not try to conceal the source you may as well give the code away.
    No, you are writing the code for someone, and being paid by them. They could theoretically feel annoyed in that someone could steal the product they bought, but not the developer who has been paid for it.
    Quote Originally Posted by Scriptage
    If the source code for Photoshop was readily available how many people would compile the program? How many imitation Photoshops would be around?
    There's no comparison between applications and a scripting language used to create interactive web pages. And, into the bargain, there is Gimpshop. I've never used either Gimp or Photoshop so I cannot compare their features, but as far as I know, they are very similar. Source code doesn't have to be copied.

    Even your second example of code can be copied if someone wants to. The question is whether or not they do. And especially with the way JavaScript is being written these days, you don't have to know how a function works to use it.


    And just a personal question, why do you post here if you believe in hiding source code?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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