473,602 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript Obfuscator

Hi,

I am looking for a good javascript obfuscator - I found several on the
web, but I am looking for one that can also handle javascript in jsp,
html and java files - so I need a javascript obfuscator that handles
my entire web project.

Is there anything like that, preferable as a Eclipse plugin?

Thanks,

Martin

Aug 21 '07 #1
11 5159
On Aug 21, 4:11 am, Martin Mücke <Doo...@gmx.dew rote:
Hi,

I am looking for a good javascript obfuscator - I found several on the
web, but I am looking for one that can also handle javascript in jsp,
html and java files - so I need a javascript obfuscator that handles
my entire web project.

Is there anything like that, preferable as a Eclipse plugin?
If you are a Java type then I think the new YUI Compressor is likely
the best option for you as a starting point. I think you'll will have
to write the plugin part that strips and replaces code from the JSP,
HTML and Java files. That or you could just make sure that all your
JavaScript lives in pure JavaScript files that are dynamically added
to other files. I'd vote for the later solution.

Peter

Aug 21 '07 #2
Martin Mücke wrote:

I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
Aug 21 '07 #3
On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
Martin Mücke wrote:
I am looking for a good javascript obfuscator [snip]

In my opinion, there are no "good obfuscators".
And why is that? That is almost like saying there are no "good
compilers." If the obfuscator goes all the way by parsing the code and
building an abstract syntax tree there is certainly a possibility of a
good obfuscator. I believe that the YUI and Dojo tools use the Rhino
engine to parse the JavaScript and then analyze the AST. These strip
IE conditional comments but I don't think that limits them from begin
"good".

Peter

Aug 21 '07 #4
Peter Michaux said the following on 8/21/2007 12:33 PM:
On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
>Martin Mücke wrote:
>>I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".

And why is that?
Ummm, because there aren't any? :) The problem isn't a good/bad
obfuscator, the problem is that even if you have a "good one" it is a
wasted effort.
That is almost like saying there are no "good compilers."
If the obfuscator goes all the way by parsing the code and
building an abstract syntax tree there is certainly a possibility of a
good obfuscator. I believe that the YUI and Dojo tools use the Rhino
engine to parse the JavaScript and then analyze the AST. These strip
IE conditional comments but I don't think that limits them from begin
"good".
So you think a program that breaks otherwise properly working code can
be called "good"?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 21 '07 #5
On Aug 21, 1:51 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Peter Michaux said the following on 8/21/2007 12:33 PM:
On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
Martin Mücke wrote:
>I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
And why is that?

Ummm, because there aren't any? :)
What is your criteria for a good obfuscater? Does it necessarily have
to deal with every possible bit of code that could go in script tags?
Or just deal with the subset of code that you write?

Do you minify your code at all?

The problem isn't a good/bad
obfuscator, the problem is that even if you have a "good one" it is a
wasted effort.
Not a total waste, it makes it harder/slower to understand the code
and so will throw off some wimpy thieves. If the value of smaller
downloads and moderate protection exceeds the cost of development/
maintenance of the obfuscator then on balance an obfuscater is a good
idea.

That is almost like saying there are no "good compilers."
If the obfuscator goes all the way by parsing the code and
building an abstract syntax tree there is certainly a possibility of a
good obfuscator. I believe that the YUI and Dojo tools use the Rhino
engine to parse the JavaScript and then analyze the AST. These strip
IE conditional comments but I don't think that limits them from begin
"good".

So you think a program that breaks otherwise properly working code can
be called "good"?
Sure a minifier/obfuscater can be good but it may not be perfect
because it may have a bug. An obfuscater is a JavaScript-to-JavaScript
compiler. All compilers have bugs but that doesn't mean we write
everything in assembly. When a compiler bug crops up we fix it.

Peter

Aug 21 '07 #6
Peter Michaux said the following on 8/21/2007 5:26 PM:
On Aug 21, 1:51 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
>Peter Michaux said the following on 8/21/2007 12:33 PM:
>>On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
Martin Mücke wrote:
I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
And why is that?
Ummm, because there aren't any? :)

What is your criteria for a good obfuscater?
I hate them so I don't have a criteria for what I would call a "good"
one versus a "bad" one. The biggest problem with them is that people
think that once they obfuscate code that they have "protected" it and
that simply isn't true. It doesn't mean there won't ever be one that
protects client side code, it just doesn't exist yet.

The other problem is that obfuscation and minimization and come to be
synonymous in the web world when they are entirely different animals.
Does it necessarily have to deal with every possible bit of code
that could go in script tags? Or just deal with the subset of code
that you write?
Ideally, it should be able to handle anything I write, or leave it alone
if it can't handle it.
Do you minify your code at all?
Are we talking about minimizing or obfuscating?

Minimizing has some effect, but I am not even sure that minimizing is
worth the effort unless it is done "on the fly" by the server.
>The problem isn't a good/bad
obfuscator, the problem is that even if you have a "good one" it is a
wasted effort.

Not a total waste, it makes it harder/slower to understand the code
and so will throw off some wimpy thieves.
If "wimpy thieves" are all you are trying to protect from, then the code
wasn't worth stealing to start with. If the code is so unique/complex
that it is worth stealing then the person stealing would have to be able
to understand it and if they can understand it then they can write it
and if they can write it they don't need to steal it. It is the
Obfuscation Paradox from hell.
If the value of smaller downloads
Smaller downloads are a result of minimizing, not obfuscating code. When
I talk/write about obfuscation I am referring to code that typically
starts with eval(.....
and moderate protection exceeds the cost of development/
maintenance of the obfuscator then on balance an obfuscater is a good
idea.
That same "moderate protection" can usually be gained by
src="hideMyCode FromWimpyThieve s.js"
>>That is almost like saying there are no "good compilers."
If the obfuscator goes all the way by parsing the code and
building an abstract syntax tree there is certainly a possibility of a
good obfuscator. I believe that the YUI and Dojo tools use the Rhino
engine to parse the JavaScript and then analyze the AST. These strip
IE conditional comments but I don't think that limits them from begin
"good".
So you think a program that breaks otherwise properly working code can
be called "good"?

Sure a minifier/obfuscater can be good but it may not be perfect
because it may have a bug.
You seem to be grouping them together as if they are the same thing when
they aren't. One of the side effects of minimizing can be some simple
obfuscating (renaming of variables, etc).
An obfuscater is a JavaScript-to-JavaScript compiler.
Most of the ones I have looked at don't do that. They simply minimize to
an extent, rename variables, convert it to a text string and then spit
out some eval('someTextH ereInASCII') code.

But, if a minimizer or an obfuscator totally breaks my code because it
removed my IE conditional comments then I would definitely call it
anything but "good".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 21 '07 #7
Peter Michaux wrote:
On Aug 21, 1:51 pm, Randy Webb wrote:
>Peter Michaux said the following on 8/21/2007 12:33 PM:
>>On Aug 21, 8:41 am, The Magpie wrote:
Martin Mücke wrote:
>>>>I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
>>And why is that?

Ummm, because there aren't any? :)
>What is your criteria for a good obfuscater?
In principle an obfuscator is something that renders something else more
obscure (Note that the question asks for an obfuscator and not a
minimiser, so presumably minimisation is not the/a point). The criteria
for what would represent a good would depend on why an increase in
obscurity is desired. There would be some standard of 'sufficiently'
obscure, to satisfy the assumed need, and a good obfuscator would be one
that achieved, or exceeded, that level of obscurity.
Does it necessarily have to deal with every possible bit of
code that could go in script tags?
Or just deal with the subset of code that you write?
That is quite a strange question. The code that any individual may write
may include anything that javascript allows. Anything that works on
javascript source code should be required to handle everything that
javascript can do.
Do you minify your code at all?
It is obfuscation not minimisation that is the subject here.
>The problem isn't a good/bad obfuscator, the problem is
that even if you have a "good one" it is a wasted effort.
Not a total waste, it makes it harder/slower to understand
the code and so will throw off some wimpy thieves.
As has been pointed out before, if that code that is being written uses
any moderately 'advanced' techniques the odds are already good that it
is beyond the comprehension of your "wimpy thieves". I cannot remember
the name that is used, but the HTML groups talk of the principle that
the worth of any web source code is inversely proportional to the effort
made to conceal it.
If the value of smaller downloads
You are back to minimisation again. Because HTTP 1.1 introduced
standards for transition of content zipped/compressed, and user agents
support it, the size reduction effects of minimisation are not nearly as
significant as superficial observations may suggest. It has even been
demonstrated that some source code size reduction strategies have a
negative impact on subsequent zip compression, making the actual
downloads larger (if only fractionally).
and moderate protection
Moderate relative to what exactly?
exceeds the cost of development/maintenance of the
obfuscator then on balance an obfuscater is a good idea.
So you are not including the cost of QA on the post-obfuscated code?
>>That is almost like saying there are no "good compilers."
If the obfuscator goes all the way by parsing the code and
building an abstract syntax tree there is certainly a
possibility of a good obfuscator.
Isn't being able to handle the code as real javascript more of a
criterion for not declaring the obfuscator as unacceptably bad, rather
than a reason for declaring it good?
>>I believe that the YUI and Dojo tools use the Rhino
engine to parse the JavaScript and then analyze the
AST. These strip IE conditional comments but I don't
think that limits them from begin "good".
I have never liked IE conditional comments and I do not use them, but
realistically they are used so any obfuscator offered for general public
use should be designed to cope with them before it can even be
considered suitable for consideration.
So you think a program that breaks otherwise properly
working code can be called "good"?
Sure a minifier/obfuscater can be good but it may not be
perfect because it may have a bug. An obfuscater is a
JavaScript-to-JavaScript compiler.
Some may be, but certainly not all on offer are.
All compilers have bugs
but that doesn't mean we write everything in assembly. When
a compiler bug crops up we fix it.
If you are writing a compiled langue then you have no choice but use a
complier. Obfuscating javascript source code is absolutely optional, and
it has drawbacks including questionable effectiveness at addressing its
objectives, making post-obfuscation maintenance and debugging of the
code harder that it may have been otherwise and requiring that the
post-obfuscated code is fully QAed so that any problems that may have
been introduced by the obfuscation process can be identified.

Richard.

Aug 21 '07 #8
Peter Michaux wrote:
On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
>Martin Mücke wrote:
>>I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
And why is that?
Well, its because obfuscators are supposed to make code "coded" (as in
normally unreadable). And they don't.

If the obfuscator goes all the way by parsing the code and building
an abstract syntax tree there is certainly a possibility of a good
obfuscator.
No... that would be a code compressor.

These strip IE conditional comments but I don't think that limits
them from begin "good".
It also doesn't make them obfuscators. Just compressors.

And as a final blow - why would you even *want* to obfuscate the code
in the first place? I've yet to see any (including my own) that is
remotely worth the effort.
Aug 22 '07 #9
On Aug 21, 11:04 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Peter Michaux said the following on 8/21/2007 10:19 PM:
On Aug 21, 3:22 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Peter Michaux said the following on 8/21/2007 5:26 PM:
>On Aug 21, 1:51 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Peter Michaux said the following on 8/21/2007 12:33 PM:
On Aug 21, 8:41 am, The Magpie <use...@pigsins pace.co.ukwrote :
Martin Mücke wrote:
>I am looking for a good javascript obfuscator [snip]
In my opinion, there are no "good obfuscators".
And why is that?
Ummm, because there aren't any? :)
What is your criteria for a good obfuscater?
I hate them so I don't have a criteria for what I would call a "good"
one versus a "bad" one. The biggest problem with them is that people
think that once they obfuscate code that they have "protected" it and
that simply isn't true. It doesn't mean there won't ever be one that
protects client side code, it just doesn't exist yet.
The other problem is that obfuscation and minimization and come to be
synonymous in the web world when they are entirely different animals.
I see them as inextricable. Given that minification programs remove
whitespace that makes programs easier to read, minification programs
do obfuscate in a trivially reversible way. Obfuscater programs that
work by replacing identifiers choose short identifiers when possible
and so are minification programs.

What you are describing in this thread is more minimization than
obfuscation.
[snip]
This is the same script "obfuscated " (from a web search for obfuscators):
eval(unescape(' %68%35%3D%30%3B %68%30%3D%27%%3 6%44%%36%35%%36 %45%%37%34%%32% 45%%35%35%%35%3 2%%34%43%%33%42 %27%3B%66%75%6E %63%74%69%6F%6E %20%68%31%35%28 %68%31%31%29%7B %68%38%3D%4D%61 %74%68%2E%72%6F %75%6E%64%28%68 %31%31%2F%34%30 %39%36%2D%2E%35 %29%3B%68%31%33 %3D%68%31%31%2D %68%38%2A%34%30 %39%36%3B%68%39 %3D%4D%61%74%68 %2E%72%6F%75%6E %64%28%68%31%33 %2F%32%35%36%2D %2E%35%29%3B%68 %31%34%3D%68%31 %33%2D%68%39%2A %32%35%36%3B%68 %31%30%3D%4D%61 %74%68%2E%72%6F %75%6E%64%28%68 %31%34%2F%31%36 %2D%2E%35%29%3B %68%31%36%3D%68 %31%34%2D%68%31 %30%2A%31%36%3B %72%65%74%75%72 %6E%28%27%27%2B %68%31%39%28%68 %31%30%29%2B%68 %31%39%28%68%31 %36%29%29%3B%7D %68%32%3D%27%%3 4%41%%34%31%%35 %36%%34%31%%35% 33%%34%33%%35%3 2%%34%39%%35%30 %%35%34%%31%41% %30%30%%32%44%% 32%41%%34%31%%3 1%44%%34%43%%34 %46%%34%33%%34% 31%%35%34%%34%3 9%%34%46%%34%45 %%30%45%%34%38% %35%32%%34%35%% 34%36%%31%42%%3 0%30%%32%44%%32 %41%%34%32%%31% 44%%34%34%%34%4 6%%34%33%%35%35 %%34%44%%34%35% %34%45%%35%34%% 30%45%%34%34%%3 4%46%%34%44%%34 %31%%34%39%%34
Ahh ok. Now I know what you mean. That mess of percents is really
crazy and trivially easy to undo. I suppose whitespace removal and
identifier replacement are both minification and obfuscation to some
degree. Actually identifier replacement is a better obfuscation then
those percents because it takes a person's slow analysis to undo what
identifier means what.

Thanks,
Peter

Aug 22 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2882
by: Smugsboy | last post by:
Anyone. Where can I find a free javascript scrambler/obfuscator, that can be ran from command-line. Is there one that can be used as a frontpage plugin ? Thanks,
2
313
by: Luke Matuszewski | last post by:
Hi, Can anyone point me for some JavaScript Obfuscators ? I know one written by Dean Edwards (but it do not substitute variable names, which a would like to do). B.R. Luke Matuszewski
20
2153
by: korund | last post by:
I want encrypt javascript code in web page, however, browser need fully recognize it.. There any many Javascript Obfuscators in the Net. Is there some good and handy utility(or script) among them that can be recommended?(freeware)
30
4636
by: mistral | last post by:
Neeed good javascript unescape encoder, to protect javascript code. Some advices? Online tool, or ready javascript only. Any opinions about the Javascript Obfuscator: http://www.javascript-source.com/
20
3272
by: twigster | last post by:
Hey everyone, I'm looking for a good way to obfuscate some Javascript code. Does anyone have a good experience or bad experience with a particular software? thanks
4
326
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I protect my javascript code? ----------------------------------------------------------------------- In the main, you can't as your code is distributed in source form and is easily readable. With JScript, there is the Script Encoder (see MSDN), but this is nothing more than obfuscation. Disabling the right mouse button also does nothing to protect...
2
3701
by: Laurent Bugnion [MVP] | last post by:
Hi group, A few years ago, I translated Douglas Crockford's JsMin from C to C#, because we wanted to use this functionality in our build process. JsMin is a code minimizer for JavaScript. It will remove all comments, empty lines, turn tabs into single spaces, etc... The goal is to reduce the size of JavaScript files to the minimum necessary, without modifying the functionality. Additionally to reducing the script's size, JsMin also...
4
2539
by: Peter Michaux | last post by:
Hi, I've uploaded a new version of the JavaScript::Minifier module that was on CPAN. It was a translation of JSMin but I rewrote it so it now handles missing semicolons, + ++ code, and leaves those freaky IE conditional comments in the output. The goal was that if working code is input then working code is output where working == working. Breaking code that works is not such a good idea. :) ...
3
1675
by: crymari2 | last post by:
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?
0
8401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6730
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5867
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3900
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2418
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1510
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1254
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.