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

Obscuring/hiding Javascript / pagecontents

P: n/a
I am new to J(ava)Script, use PHP a lot and consider moving some stuff for a
project over to the client side. Problem is part of the PHP code is
copyrighted and the author would not be happy to see his work made available
to the world. Guess he is entitled to that opinion.

Is it possible to hide javascript and/or html data from the user or is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from snooping
eyes ?)

Any pointers and tips are very welcome.

TIA
Pjotr

--
The day Microsoft starts making stuff that does not suck will undoubtedly be
the day they start producing vacuum cleaners

Jul 23 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On Sat, 6 Nov 2004 17:54:25 +0100, Pjotr Wedersteers wrote:
Is it possible to hide javascript ..
No.
..and/or html data ..
No.
..from the user or is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such?
Obfuscation, yes. But that only works if the code is not
a) worth stealing or b) easier to rewrite.
..Or is the alternative pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from snooping
eyes ?)
No and no. (Though Java can also be obfuscated,
not sure about Flash)
Any pointers and tips are very welcome.


If it is really so valuable, keep it on the server.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #2

P: n/a
"Pjotr Wedersteers" <pj***@wedersteers.com> wrote in message
news:41***********************@news.xs4all.nl...
I am new to J(ava)Script, use PHP a lot and consider moving some stuff for a project over to the client side. Problem is part of the PHP code is
copyrighted and the author would not be happy to see his work made available to the world. Guess he is entitled to that opinion.

Is it possible to hide javascript and/or html data from the user or is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from snooping
eyes ?)

Any pointers and tips are very welcome.

TIA
Pjotr


Can you use ASP?

You can name JavaScript "include" files with an ".asp" extension to hide
them from view.

For example, <script type="text/javascript" src="yourcode.asp"></script>
Jul 23 '05 #3

P: n/a
McKirahan wrote:
"Pjotr Wedersteers" <pj***@wedersteers.com> wrote in message
news:41***********************@news.xs4all.nl...
I am new to J(ava)Script, use PHP a lot and consider moving some stuff for


a
project over to the client side. Problem is part of the PHP code is
copyrighted and the author would not be happy to see his work made


available
to the world. Guess he is entitled to that opinion.

Is it possible to hide javascript and/or html data from the user or is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from snooping
eyes ?)

Any pointers and tips are very welcome.

TIA
Pjotr

Can you use ASP?

You can name JavaScript "include" files with an ".asp" extension to hide
them from view.

For example, <script type="text/javascript" src="yourcode.asp"></script>


That does absolutely *nothing* for hiding script contents. Its as simple as:

view-source:AbsoluteURLToTheASPFile.asp
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4

P: n/a
"Randy Webb" <Hi************@aol.com> wrote in message
news:5p********************@comcast.com...
You can name JavaScript "include" files with an ".asp" extension to hide
them from view.

For example, <script type="text/javascript" src="yourcode.asp"></script>
That does absolutely *nothing* for hiding script contents. Its as simple as:
view-source:AbsoluteURLToTheASPFile.asp

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq


Thanks for the info -- there's a lot to learn in!
Jul 23 '05 #5

P: n/a

Pjotr Wedersteers wrote:
Is it possible to hide javascript and/or html data from the user or is the only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative pouring the code in Flash or Java ? (is a Flash movie or JAR file safe from snooping eyes ?)


http://www.encrypt-html.com/encrypt_javascript.htm
You can encrypt Javascript using that above link. I have not actually
used it, but I have seen it reccomended a few times in the newsgroups.

Jul 23 '05 #6

P: n/a
"John Postlethwait" <jo***************@gmail.com> wrote in message
news:10*********************@f14g2000cwb.googlegro ups.com...

Pjotr Wedersteers wrote:
Is it possible to hide javascript and/or html data from the user or

is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative

pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from

snooping
eyes ?)


http://www.encrypt-html.com/encrypt_javascript.htm
You can encrypt Javascript using that above link. I have not actually
used it, but I have seen it reccomended a few times in the newsgroups.


Won't it require installation on the Web server (who most hosts won't do!)?
Jul 23 '05 #7

P: n/a
"Pjotr Wedersteers" <pj***@wedersteers.com> wrote in message
news:41***********************@news.xs4all.nl...
I am new to J(ava)Script, use PHP a lot and consider moving some stuff for a project over to the client side. Problem is part of the PHP code is
copyrighted and the author would not be happy to see his work made available to the world. Guess he is entitled to that opinion.

Is it possible to hide javascript and/or html data from the user or is the
only way to make it hard to get by obscuring it through removing
indentation, variable renaming and such? Or is the alternative pouring the
code in Flash or Java ? (is a Flash movie or JAR file safe from snooping
eyes ?)

Any pointers and tips are very welcome.


For JavaScript, since the client side code must be delivered to the client,
in essence you are delivering source code to him.
"Encoding" this source won't help much, because
you'll also have to send the encoder to the client.

Obfuscation is the only practical technical defense;
at least you are delivering source code which is difficult
to reverse engineer. As others have said, if you
are sending a trivial amount of code, even this won't
help. If you send a large amount of code, this
can be pretty good. YMMV.

See
http://www.semanticdesigns.com/Produ...bfuscator.html.

If this isn't strong enough, you'll have to convert your code
to some kind of real object code (JAR/SWF files can be reverse
engineered too, consequently you see obfuscators being
offered for them, too)., and then convince your client to run
it. Viruses being such things, he may be hard to convince.

--
Ira D. Baxter, Ph.D., CTO 512-250-1018
Semantic Designs, Inc. www.semdesigns.com
Jul 23 '05 #8

P: n/a
On Mon, 8 Nov 2004 18:18:25 -0600, Ira Baxter wrote:
If this isn't strong enough, you'll have to convert your code
to some kind of real object code (JAR
Nit-pick. A Jar file is really a Zip file (try renaming
one - a double click will open it in WinZip or similar).

It is the Java .class files inside the jar file that might be obfuscated.
.../SWF files can be reverse
engineered too, consequently you see obfuscators being
offered for them, too)


--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.