Register - Login
Views: 99801331
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 06:50:19 AM
Jul - Computers and Technology - Protecting Java script files New poll - New thread - New reply
Next newer thread | Next older thread
Deleted User
Collection of nobodies
Posted on 10-31-09 11:59:36 AM Link | Quote
I'm making a website, as some of you maybe already know... it's here:

http://www.everest.free-shells.com.ar/~thekinoko/

I'd like to make some news submission system so I can submit news/whatever without having to edit the page.


What I'm looking for is a way to protect Java script files so that the user can't see them, but they must remain accessible to the navigator. Is there a way to do that?

By the way, I can't use PHP


____________________


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 192


Posts: 3624/12211
EXP: 99321042
For next: 552529

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 10-31-09 08:24:42 PM Link | Quote

Time/Date

&date&

Posts

&numposts&

Days Here

&numdays&

Level

&level&
Metal_Man88
Local Moderator
No, as the browser can't see them then.

There's some forms of code obfuscation but I don't know any off the top of my head.

____________________
Original Layout © Tobias Kelmandia
VideoGuy
Member
Level: 22


Posts: 59/84
EXP: 53006
For next: 5344

Since: 05-10-09


Since last post: 12.0 years
Last activity: 9.9 years

Posted on 10-31-09 11:02:14 PM Link | Quote
http://dean.edwards.name/packer/

But that's still not perfect, it just makes the code harder to understand. People can still decipher it.
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 192


Posts: 3674/12211
EXP: 99321042
For next: 552529

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 11-01-09 02:39:07 AM Link | Quote

Time/Date

10-31-09 09:39:07pm

Posts

3674

Days Here

851

Level

88
Metal_Man88
Local Moderator
Since otherwise, there'd be no way for the browser to understand it.

____________________
Original Layout © Tobias Kelmandia
Post 856/1311 (41 days), online 1 day ago
Posted on 11-01-09 08:08:28 PM Link | Quote
Another question would be why you need JavaScript for a news system (updating news without manually editing the HTML can easily be done with serverside scripting like PHP or even includes), and why you need it to be unreadable

Even in JavaScript, all it'd take to include news data in a page is a little bit of Ajax, but that's still not the best way to do it unless you want to load different things on the same page without reloading everything ...


But yep, as said above, the most you can do is to make the code hard to understand (single letter names, no spacing, a bit of string conversion and eval())

____________________



#50 
VideoGuy
Member
Level: 22


Posts: 62/84
EXP: 53006
For next: 5344

Since: 05-10-09


Since last post: 12.0 years
Last activity: 9.9 years

Posted on 11-01-09 08:14:10 PM Link | Quote
He said he couldn't use PHP before.

You could try putting your news in XML files, and then having the web page display the XML. I think that can be done through Javascript, but PHP would be better for that.
Post 858/1311 (41 days), online 1 day ago
Posted on 11-01-09 08:23:47 PM Link | Quote
Or if the server supports it (likely enough as it's a simple builtin Apache module), you can use serverside includes, which go like this and require no other coding:

<!--#include virtual="news.html"-->

That's how I did it on my site before I found out I could use PHP

____________________



#50 
Deleted User
Collection of nobodies
Posted on 11-01-09 09:28:22 PM Link | Quote
Originally posted by Acmlm
Or if the server supports it (likely enough as it's a simple builtin Apache module), you can use serverside includes, which go like this and require no other coding:

<!--#include virtual="news.html"-->

That's how I did it on my site before I found out I could use PHP

I'm going to try that out when I find some free time.

Thank you

____________________


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]
Joe
Common spammer
🍬
Level: 111


Posts: 1118/3392
EXP: 14501148
For next: 367212

Since: 08-02-07

From: Pororoca

Since last post: 12 days
Last activity: 8 hours

Posted on 11-01-09 09:37:21 PM Link | Quote
Why is all of your content stored in the Javascript file? Why not use Javascript to selectively show or hide <div>s instead?

That would also work much better with Acmlm's suggestion.

____________________
Tiden
Disgusting human being, just awful
Level: NaN


Posts: 4982/-6493
EXP: NaN
For next: 0

Since: 07-03-07

Pronouns: they/them

Since last post: 4.1 years
Last activity: 3.6 years

Posted on 11-01-09 09:40:18 PM Link | Quote
Protip: don't use javascript for everything. Not all of us want to have javascript enabled at all times, you know.

____________________
JOIN #PROG YOU JERKS.
Joe
Common spammer
🍬
Level: 111


Posts: 1119/3392
EXP: 14501148
For next: 367212

Since: 08-02-07

From: Pororoca

Since last post: 12 days
Last activity: 8 hours

Posted on 11-01-09 09:46:21 PM Link | Quote
Working off of that, you could invert Acmlm's suggestion. Instead of importing the page content, create a separate page for each and only import the header and footer.

You'll need more files, but you can do it without Javascript.

____________________
Deleted User
Collection of nobodies
Posted on 11-01-09 09:46:56 PM Link | Quote
Originally posted by Joe
Why is all of your content stored in the Javascript file? Why not use Javascript to selectively show or hide <div>s instead?

That would also work much better with Acmlm's suggestion.

It's temporary.
I'm going to put the news/downloads/all in list files.

But I'd like to make some interface so I can submit them easily from the site. As you already know, I don't want all the morons to post stupid stuff, so it would ask for username/password.

Ofcourse I don't want people to be able to figure out how the thing works by looking at the java script...

____________________


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]
Joe
Common spammer
🍬
Level: 111


Posts: 1120/3392
EXP: 14501148
For next: 367212

Since: 08-02-07

From: Pororoca

Since last post: 12 days
Last activity: 8 hours

Posted on 11-01-09 10:31:01 PM Link | Quote
So you're basically saying that you want to code something like a simple messageboard...

...but using only Javascript?

____________________
Darkdata
Ruins!? ♥
Level: 103


Posts: 1217/2892
EXP: 11446044
For next: 25362

Since: 07-04-07


Since last post: 202 days
Last activity: 10 days

Posted on 11-01-09 10:40:11 PM Link | Quote
I am just going to state this now. Using only javascript even encrypted will get your site hacked. If a password is there people will find it.

If you want secure, learn something server-side.

Just my two cents, goodnight.

____________________
Deleted User
Collection of nobodies
Posted on 11-01-09 10:45:16 PM Link | Quote
I knew it. I'm in need of PHP or something.

I'm going to discuss that with the hosting staff...

____________________


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]


===================
[Posted by TheKinoko]
devin

Yoshi
i'm mima irl
Level: 112


Posts: 384/3519
EXP: 14931938
For next: 406267

Since: 04-29-08

Pronouns: any
From: FL

Since last post: 306 days
Last activity: 3 days

Posted on 11-03-09 02:39:19 AM Link | Quote
"You don't have permission to access /~thekinoko/ on this server."

I guess that's one way to protect your site

____________________
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 192


Posts: 3725/12211
EXP: 99321042
For next: 552529

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 11-03-09 03:48:57 AM Link | Quote

Time/Date

11-02-09 09:48:57pm

Posts

3725

Days Here

853

Level

88
Metal_Man88
Local Moderator
He's gotta protect it from traffic entirely, you know.

:p

____________________
Original Layout © Tobias Kelmandia
Next newer thread | Next older thread
Jul - Computers and Technology - Protecting Java script files New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

32 database queries, 4 query cache hits.
Query execution time: 0.103879 seconds
Script execution time: 0.040970 seconds
Total render time: 0.144849 seconds