Stats: 3,186,783 members, 7,930,670 topics. Date: Sunday, 25 August 2024 at 03:09 AM |
Nairaland Forum / Science/Technology / Programming / Need Step On How To Hide Javascript Source Code. (3004 Views)
Free PHP, Node js ,Mongo db, Angular And C# Proje Source Code With Documentation / Step By Step On How To Write A Good Blog Post / Javascript Source Code For GPA Calculator (2) (3) (4)
Need Step On How To Hide Javascript Source Code. by Oladg2: 7:52pm On Nov 24, 2016 |
Need step on how to hide javascript source code . |
Re: Need Step On How To Hide Javascript Source Code. by kudaisi(m): 9:18pm On Nov 24, 2016 |
Oladg2: There's really no perfect way to absolutely protect you JavaScript source from a user that is determined to see it and experienced enough to know how to go about it. However, I know that you can make it harder for user to view your javascript source (hopefully hard enough to discourage the viewer) . Some methods include referencing the scripts from external files...i.e breaking the code into bits and pieces within separate files which are equally referencing other files, you can also retrieve some of the scripts via Ajax calls. Additionally, you can obfuscate you code to make it unreadable without hassle. It's important to note however that I rarely find it necessary to make my javascript secret (its not like I have my database password hardcoded somewhere within the script). Its mostly about getting the script to work at optimum performance. 1 Like 1 Share |
Re: Need Step On How To Hide Javascript Source Code. by SeunLanLege(m): 9:55pm On Nov 24, 2016 |
kudaisi: I load my js asynchronously. So ctrl+u won't show you my code,except you check your network requests in your console. That's the best way I know to hide your js code. It also optimizes page loads. |
Re: Need Step On How To Hide Javascript Source Code. by kudaisi(m): 11:32am On Nov 25, 2016 |
SeunLanLege: Like I said, AJAX is an option. |
Re: Need Step On How To Hide Javascript Source Code. by chido4real(m): 2:24pm On Nov 28, 2016 |
Oladg2: You can use one of the javascript obfuscation tools like using uglifyJS with the --mc flag. |
Re: Need Step On How To Hide Javascript Source Code. by orimion(m): 8:25pm On Nov 28, 2016 |
why would you need to hide it? I don't think there is any viable reason |
Re: Need Step On How To Hide Javascript Source Code. by Oladg2: 12:32am On Nov 30, 2016 |
chido4real: Please how do i go about this ? |
Re: Need Step On How To Hide Javascript Source Code. by kudaisi(m): 10:29am On Nov 30, 2016 |
Oladg2: You need to install Node.js, Then install UglifyJS with NodeJS package manager npm install uglify-js -gTo obfuscate a file say scripts.js for example run the command uglifyjs --compress --mangle scripts.jsor simply uglifyjs --mc scripts.jsas earlier mentioned by @chido4real What you need mostly is the --mangle (--m) option, according to the documentation it Mangle names/pass mangler options. The --compress option also makes it hard to read, but the effect can easily be reversed with a beautifier. |
Re: Need Step On How To Hide Javascript Source Code. by kudaisi(m): 10:30am On Nov 30, 2016 |
Alternatively, you can download http://javascriptobfuscator.com/ GUI and install. If you don't already have Node.js. FYI: There are some beautifiers out there that can reverse obfuscation.. Maybe not to it's original state, but to a state that is more readable. |
Re: Need Step On How To Hide Javascript Source Code. by Oladg2: 2:33pm On Nov 30, 2016 |
kudaisi: Thanks very much , I all try it out. |
Re: Need Step On How To Hide Javascript Source Code. by micodon(m): 7:56am On Dec 01, 2016 |
You cant hide your client - side js code from anyone who knows what he's doing. The code would eventually get loaded by the user 's browser before it's interpreted and executed. Its a matter of using the network tab in the browser developer tools, getting the script(s) and beautifying if it has been uglified. Your efforts can only work on kids |
Re: Need Step On How To Hide Javascript Source Code. by ernieboy(m): 8:36am On Dec 01, 2016 |
if u need to hide something it should not be on a client side script |
Re: Need Step On How To Hide Javascript Source Code. by chido4real(m): 7:26pm On Dec 02, 2016 |
micodon: Actually, if you use the --mangle option with uglify, the code won't be exactly the same way it was even after beautification. Only hardcore pros would still be able to understand the code at that point. |
Re: Need Step On How To Hide Javascript Source Code. by micodon(m): 8:57pm On Dec 02, 2016 |
chido4real: Like I said, "those who know what theyre doing" Wil know |
Re: Need Step On How To Hide Javascript Source Code. by orimion(m): 10:41pm On Dec 02, 2016 |
chido4real:The thought of going through all these to hide JS client side means something is wrong. Like someone said, what ever needs to be hidden has to be done server side. People are making open source projects, someone wants to hide client side JavaScript ![]() 1 Like |
Re: Need Step On How To Hide Javascript Source Code. by romme2u: 12:18am On Dec 03, 2016 |
orimion: what shalln't i see ![]() 1 Like |
Re: Need Step On How To Hide Javascript Source Code. by chido4real(m): 9:05am On Dec 03, 2016 |
Lol. For the record, I'm not in support of hiding JavaScript source code... |
Re: Need Step On How To Hide Javascript Source Code. by GoodMuyis(m): 2:36pm On Dec 05, 2016 |
chido4real: am ready to do it, because of Intellectual theft, Someone can steal your work and make money from it while you are yet to settle down |
Re: Need Step On How To Hide Javascript Source Code. by Nobody: 1:31am On Dec 06, 2016 |
Oladg2: You 've been watching too much Hollywood films about hackers bro. Lol And I think you are afraid and trying to implement as much security as you can. ![]() ![]() ![]() ![]() ![]() Relax Bro. Lol There is nothing to hide in your javascript source. It's not necessary. I think you should be more concerned with correct configuration for your server side environment. Ok. That's a where a nice and terrible attack will target. |
Re: Need Step On How To Hide Javascript Source Code. by haleighaugustu: 9:59am On Jun 09, 2022 |
It also introduced four new biomes, as well as various structures. As time progressed, the game's boundary became more unstable. Eventually, chunks beyond 30 million blocks could not be rendered, and the game crashed in an illegal position. You are curious to know more about minecraft survival servers, go here. |
Re: Need Step On How To Hide Javascript Source Code. by Nobody: 12:26pm On Jun 09, 2022 |
Oladg2:Ask GREATIGBOMAN he should know since he knows everything |
(1) (Reply)
How Much Do Web Developer Jobs Pay Per Month? / My Very Short Startup Journey And How It Ended / Structured Programming As A Panacea For Software Crisis. Discuss
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 42 |