By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Javascript Obfuscators

P: n/a
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)

Apr 4 '06 #1
Share this Question
Share on Google+
20 Replies


P: n/a

ko****@hotmail.com wrote:
I want encrypt javascript code in web page, however, browser need fully
recognize it..
AFAIK, encryption (if that is what you mean) is not realistically
possible client side. After all the client needs the key as well to be
able to decrypt and run the code.

Obfuscators are different to encryption. Obfuscators do not encrypt,
they just make it harder to read.
There any many Javascript Obfuscators in the Net. Is
there some good and handy utility(or script) among them that can be
recommended?(freeware)


If you just search this newsgroup on the word "obfuscator", you will
find that plenty of people have asked this, and received plenty of
answers.

Also search under terms relating to compression or minimising the size
of JavaScript files.

You will find that obfuscators tend to be frowned upon, although
opinion does vary (as is the way with opinion). One common reason is
that if the script is that valuable, it is better to keep it on the
server.

If optimisation of file size is your aim, then you could look at
<URL:http://dean.edwards.name/packer/>

Regards

Julian Turner

Apr 4 '06 #2

P: n/a

Julian Turner писал(а):
ko****@hotmail.com wrote:
I want encrypt javascript code in web page, however, browser need fully
recognize it..
AFAIK, encryption (if that is what you mean) is not realistically
possible client side. After all the client needs the key as well to be
able to decrypt and run the code.

Obfuscators are different to encryption. Obfuscators do not encrypt,
they just make it harder to read.
There any many Javascript Obfuscators in the Net. Is
there some good and handy utility(or script) among them that can be
recommended?(freeware)


If you just search this newsgroup on the word "obfuscator", you will
find that plenty of people have asked this, and received plenty of
answers.

Also search under terms relating to compression or minimising the size
of JavaScript files.

You will find that obfuscators tend to be frowned upon, although
opinion does vary (as is the way with opinion). One common reason is
that if the script is that valuable, it is better to keep it on the
server.

If optimisation of file size is your aim, then you could look at
<URL:http://dean.edwards.name/packer/>

Regards

Julian Turner


----------
No, the purpose if obfuscate code(just make it harder to read), not
size optimisation.
AFAIK, encryption (if that is what you mean) is not realistically
possible client side. After all the client needs the key as well to be
able to decrypt and run the code.


There is a obfuscator that can encrypt and decrypt:
http://javascript.about.com/library/blenc.htm

Thanks.

Apr 4 '06 #3

P: n/a

ko****@hotmail.com wrote:

[snip]
There is a obfuscator that can encrypt and decrypt:
http://javascript.about.com/library/blenc.htm

Thanks.


[/snip]

Hmm, but I would think twice before using is. The following are quotes
from that page:-

<quote>Actually, the encryption of a page makes no difference at all to
how easily it can be stolen by knowledgeable thieves who can easily
bypass the encryption in seconds using nothing more than a web
browser</quote>

<quote>Please note that any web pages encrypted using this script (or
any encryption program that you purchase) can be easily decrypted in
under 30 seconds by anyone who knows how so don't blame us if
encrypting your page encourages its theft rather than stopping
it.</quote>

Regards

Julian Turner

Apr 4 '06 #4

P: n/a
"Julian Turner" <ju****@baconbutty.com> writes:
Hmm, but I would think twice before using is. The following are quotes
from that page:-

[protection can be broken]

That's actually refreshing honesty from someone making an obfuscator.
If I needed on (and I can't imagine for what), it would be one that
I would consider.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Apr 4 '06 #5

P: n/a
I purchased Jasob 1.8 from http://www.jasob.com and it works
excellently. It removes the comments and spaces and substitutes
letters for variables and function names. Since I write engineering
programs that have many long winded variable and function names to make
it easier to program, the obfuscation does an excellent job in reducing
size and making the program virtually unreadable. While many may be
able to extract the code, few will be able to determine what the heck
is going on with all the variable substitutions and no comments. It is
hard enough for me to write the code with the comments and long
variable names.

Apr 4 '06 #6

P: n/a

Lasse Reichstein Nielsen wrote:
That's actually refreshing honesty from someone making an obfuscator.
If I needed on (and I can't imagine for what), it would be one that
I would consider.


Thats true enough. Didn't mean to criticise the author as such. I
have come accross the author - Felgall, I think - in the
Webdeveloper.com forums, and (not that I have any right to judge) he
seemed very geniune.

Regards

Julian Turner

Apr 4 '06 #7

P: n/a
> Lasse Reichstein Nielsen wrote:
That's actually refreshing honesty from someone making an obfuscator.
If I needed on (and I can't imagine for what), it would be one that
I would consider.


Thats true enough. Didn't mean to criticise the author as such. I
have come accross the author - Felgall, I think - in the
Webdeveloper.com forums, and (not that I have any right to judge) he
seemed very geniune.

Regards

Julian Turner

-------
I tried few online javascript obfuscators, all of them generate fully
'garbage' obfuscated code, but no any javascripts work anymore..
Browser not recognize it..

Apr 4 '06 #8

P: n/a
el*********@electrician.com said the following on 4/4/2006 12:56 PM:
I purchased Jasob 1.8 from http://www.jasob.com and it works
excellently.
Then you really are as stupid as you seem.
It removes the comments and spaces and substitutes letters for variables
and function names.
JSMin is free.....

Since I write engineering programs that have many long winded variable and
function names to make it easier to program, the obfuscation does an excellent
job in reducing size and making the program virtually unreadable.
And you paid for a program to make what you write unreadable? It was
wasted money as 99.99999999999999999999% of what you write is unreadable
anyway.
While many may be able to extract the code, few will be able to determine
what the heck is going on with all the variable substitutions and no
comments.
You don't need the comments and lack of white space to make your code
worthless - it is already worthless.
It is hard enough for me to write the code with the comments and long
variable names.


Then learn to program and it becomes easy.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 4 '06 #9

P: n/a
<You don't need the comments and lack of white space to make your code
worthless - it is already worthless.>

Ahh chucks, Randy, we can't all be as smart as you. I think Jason
needed and deserved the $99 and I enjovyed paying him. He did a hell
of a job, in my opinion. Besides it is a tax write off, and do I ever
need tax write offs. Too many people give away programs on the
Internet, when people like myself are perfectly willing to pay for
them. It is all about marketing and making money. Do you have
anything for sale, or are you just another Net Whore that gives it all
away?

Apr 4 '06 #10

P: n/a
el*********@electrician.com said the following on 4/4/2006 3:33 PM:
<You don't need the comments and lack of white space to make your code
worthless - it is already worthless.>

Ahh chucks, Randy, we can't all be as smart as you.
Can't all be dumb either.
I think Jason needed and deserved the $99 and I enjovyed paying him.
Then you are both happy. Ira Baxter peddles the same crap though.
He did a hell of a job, in my opinion.
And that is your opinion and nothing more.
Besides it is a tax write off, and do I ever need tax write offs.
Then buy a boat for business. Its more pleasurable and a bigger write off.
Too many people give away programs on the Internet, when people like
myself are perfectly willing to pay for them. It is all about marketing
and making money.
If it were all about marketing and making money then why are so many
people giving it away? Think about that.

I wrote one myself (an obfuscator) that was totally, 100%, JS driven.
Why did I ditch it? It was useless and why waste my time on a useless
project?
Do you have anything for sale,
Yeah, a boat. You need another write off?
or are you just another Net Whore that gives it all away?


Being a whore gets you laid more often.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 4 '06 #11

P: n/a
el*********@electrician.com wrote:
or are you just another Net Whore that gives it all
away?


Umm - don't whores usually charge?
Apr 4 '06 #12

P: n/a
Randy,
There is fortune to be made on the Internet and I don't think you are
there yet. Furthermore, you are entirely too anal about programming.
Loosen up, kid and start getting in on the action. Use your time to
produce marketable products and quit playing around. People like me
are just waiting to buy! I spent 4 months last Fall hacking out a form
that emails itself and files itself using Perl and a Perl program that
searches 39 files including the filed form. I could not find a
reliable, cost effective and trustworthy Perl programmer within 350
mile of where I live and I live within 17 miles of a Cray super
computer center. I would have gladly paid $5k to have it done. The
only Perl programmer was the Cray guy and he wasn't interested.
Sometimes the same applies to JavaScript.

Apr 4 '06 #13

P: n/a
el*********@electrician.com wrote:
Randy,
There is fortune to be made on the Internet and I don't think you are
there yet. Furthermore, you are entirely too anal about programming.
Loosen up, kid and start getting in on the action. Use your time to
produce marketable products and quit playing around. People like me
are just waiting to buy! I spent 4 months last Fall hacking out a form
that emails itself and files itself using Perl and a Perl program that
searches 39 files including the filed form. I could not find a
reliable, cost effective and trustworthy Perl programmer within 350
mile of where I live and I live within 17 miles of a Cray super
computer center. I would have gladly paid $5k to have it done. The
only Perl programmer was the Cray guy and he wasn't interested.
Sometimes the same applies to JavaScript.

Are you replying to something, or just trolling again?

--
Ian Collins.
Apr 4 '06 #14

P: n/a
<Are you replying to something, or just trolling again?>
The heading was to Randy not you, so butt out!

Apr 4 '06 #15

P: n/a
el*********@electrician.com wrote:
I could not find a
reliable, cost effective and trustworthy Perl programmer within 350
mile of where I live and I live within 17 miles of a Cray super
computer center.


I can't find any reliable, cost effective, and trustworthy electricians
within 350 miles of where I live, and I live near Los Angeles. They all
want like $20/hour or more...
Apr 5 '06 #16

P: n/a

ko****@hotmail.com wrote:
I tried few online javascript obfuscators, all of them generate fully
'garbage' obfuscated code, but no any javascripts work anymore..
Browser not recognize it.


It is impossible for me to guess why any given obfuscator has failed
for any given script you are running or any given browser you are
using.

Debugging the reasons why you are getting an error from an obfuscator
can be very difficult, as there may be many different and subtle
reasons for the error, including problems with your original code.

For instance, if you do not terminate statements correctly, with
semi-colons where required, then the subsequent removal of line breaks
can cause statements to run into each other.

Ironically the more complex your code, the more difficult it can to use
an obfuscator.

Regards

Julian Turner

Apr 5 '06 #17

P: n/a
Julian Turner писал(а):
ko****@hotmail.com wrote:
I tried few online javascript obfuscators, all of them generate fully
'garbage' obfuscated code, but no any javascripts work anymore..
Browser not recognize it.
It is impossible for me to guess why any given obfuscator has failed
for any given script you are running or any given browser you are
using.

Debugging the reasons why you are getting an error from an obfuscator
can be very difficult, as there may be many different and subtle
reasons for the error, including problems with your original code.

For instance, if you do not terminate statements correctly, with
semi-colons where required, then the subsequent removal of line breaks
can cause statements to run into each other.

Ironically the more complex your code, the more difficult it can to use
an obfuscator.

Regards

Julian Turner


---------
I want to find an obfuscator, which works gently, for example, replaces
spaces some characters, etc, without a damaging a code itself. The
purpose is just make a code difficultly read, that a curious user which
will want to see a source get a problems, and did not spend its time
for further code research.. Script property does not matter for me.

Apr 5 '06 #18

P: n/a

ko****@hotmail.com wrote:

[snip]
I want to find an obfuscator, which works gently, for example, replaces
spaces some characters, etc, without a damaging a code itself. The
purpose is just make a code difficultly read, that a curious user which
will want to see a source get a problems, and did not spend its time
for further code research.. Script property does not matter for me.


There was something I wrote (about 5 years ago now), when I was lured
to the dark side for a while, before this group thankfully pointed out
the error of my ways.

I now hold to the view that obfuscation is often more trouble than it
is worth, unless perhaps file size optimisation is your geniune and
justified aim, and if I think I have written anything valuable, a quick
search of Google soon disabuses me of that delusion.

You can still find it however at
<URL:http://www.baconbutty.com/ObscuraButty(v2).htm>

It is pretty rough, and the variable replacement names are a bit long,
but feel free to try it.

Regards

Julian Turner

Apr 5 '06 #19

P: n/a
Julian Turner писал(а):
ko****@hotmail.com wrote: [snip]
I want to find an obfuscator, which works gently, for example, replaces
spaces some characters, etc, without a damaging a code itself. The
purpose is just make a code difficultly read, that a curious user which
will want to see a source get a problems, and did not spend its time
for further code research.. Script property does not matter for me.
There was something I wrote (about 5 years ago now), when I was lured
to the dark side for a while, before this group thankfully pointed out
the error of my ways. I now hold to the view that obfuscation is often more trouble than it
is worth, unless perhaps file size optimisation is your geniune and
justified aim, and if I think I have written anything valuable, a quick
search of Google soon disabuses me of that delusion. You can still find it however at
<URL:http://www.baconbutty.com/ObscuraButty(v2).htm> It is pretty rough, and the variable replacement names are a bit long,
but feel free to try it. Regards Julian Turner

--------------------------
Well, a full html page source can be used as input for text area there,
not javascript only?

Regards,
korund

Apr 5 '06 #20

P: n/a

ko****@hotmail.com wrote:

[snip]
Well, a full html page source can be used as input for text area there,
not javascript only?


If you read the instructions on the first page, you will see that it
should accept JavaScript only.

Its old stuff, so I am not going to defend it.

Regards

Julian Turner

Apr 5 '06 #21

This discussion thread is closed

Replies have been disabled for this discussion.