How to encrypt HTML source code? [duplicate] - javascript

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to encrypt HTML source code output using PHP
I built my static website and I am finished now how to encrypt my source code? Can I hide HTML source code of my page so that nobody can see it?
I have used jquery, iframes, CSS and HTML.
I want protect my website from injection.

This article covers a number of techniques including:
Source Code Padding
No Right Click Scripts
"JavaScript Encryption"
HTML Protection Software
However the article concludes:
Unfortunately, the short answer to this question is, you can't [hide your source code]. There have been various methods put forth, but all of these are easily circumvented. In the end, the only sure fire way to make sure no one can steal your source code is to never put it on the Internet at all.

You can't, unfortunately. HTML is always open so that the browser can render it, so there's no way to encrypt it.

There is a website dedicated to this matter. They offer tools to achieve what you want. But, anyway, just google a little bit more, Hope that helps

Related

how to prevent stealing javascript codes [duplicate]

This question already has answers here:
How can I prevent javascript code theft?
(7 answers)
Closed 6 years ago.
I made many javascripts for my blogger after hard work. So, I don't want anyone steal my codes, can I do that?
I tried obfuscate and encode from many websites, but anyone can easily steal it after that, So it just slow my website.
I need really solution : )
You can't. The only thing you can do is make your code harder to read by minimizing it, and otherwise obfuscating it. The code is sent to the client; you must assume they'll try to read it.
If you visit a website and the page is already "constructed", it means they used a server side language/framework to create the page before it was sent.
Javascript files are shown publicly, and sent directly to the client, so there's no way you can prevent them from being viewed. You had the right idea trying to obfuscate it, as that's the only solution, you just need to find the right obfuscater. In my opinion, you shouldn't even obfuscate them, as most scripts are written in a matter of minutes, it wouldn't make much sense for somebody to steal yours. If you really need to do so, then a quick google search returns this.
No, you can't. At the end of the day, the user can look at any javascript that is being run on the client. If you're doing anything that is business sensitive (such as connecting to databases, etc), that should take place on the server, so that users can't see it. Client-side JavaScript is intended to work with data that the user can see anyway, so it's not important for it to be obfuscated.
If you're just jealous that someone is going to to use your code, well.. Tough luck. Though I should say that in all likelihood nobody is interested in stealing your code. If they're going to reuse code, they'll download a plugin - not go through the source of random websites to see if there's anything they could scavenge.
People have mentioned obfuscation, but if that's your goal, you're doing something wrong. You should certainly minify your code - but that's to make it take less space, and thus load faster. Not to obfuscate it.

How can I hide my javascript source in browser? [duplicate]

This question already has answers here:
How do I hide javascript code in a webpage?
(12 answers)
Closed 9 years ago.
I'm quite new to Angular. I've done a lot of things with it. Built an internal website in my organization.
When I inspect regular web pages with chrome dev tools, I generally can't see any important javascript source files. But when I inspect my own angularjs web site, all of my controllers, directives and factories are there, exposed to everyone.
How can I hide them from users? Do I just have to minify them?
Thanks
There is no way you can hide your script from client.
You could obfuscate it a lot, making each function dependant on another, building a massive "web" of functions that all depend on each other, but that would also make the code really REALLY messy for yourself. The best thing you could do is just put a license in your script, using /* */ and that will atleast prevent most buisnesses from stealing the code.
Javascript files are downloaded to the client so there is not much you can do.
You can try to obfuscate javascript but it's mostly a waste of time IMO
There is no way to do this. At best you can compress your JavaScript to make is less readable but at the end of the day if someone want's access to your code they can get it. That said, this is true for most programming language now a days. It's fairly easy to get the code for apps written in Java, C#, VB, and Managed C++.

Making Javascript Private [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I obfuscate JavaScript?
Is it possible to make some of Javascript private and confidential so that certain things can remain confidential?
If you're asking whether or not you can prevent users from viewing your source, the answer is basically no.
Sometimes you can make it impossible to do right-click / view source, but people could simply use a tool like Firebug.
You can minify your code, but that doesn't hide it. It just makes it harder to comprehend.
I think what you are after is encrypting/obfuscating javascript code; you cant avoid but send your JavaScript code to the client.
The best you can do is obfuscate it, which is essentially making it harder to humanly read it. and here the SO reference if you want to go down that path
How can I obfuscate (protect) JavaScript?
I am not sure why you want to do this, is it to protect some of your own code, if so then its ok, but if you are planning on putting sensitive data such as usernames/passwords embeddeed into your javascript then please don't do so, its ok to go to the server to fetch stuff better being secure :-) happy coding.

Jquery source obfuscator [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Javascript library: to obfuscate or not to obfuscate - that is the question
Hi, I'm creating a very simple footer zone with a jquery animated drawer and a simple carouseel with a modal to show some products of my store.
Any decent jquery programmer will easily top this, i'm a noob, the problem is that I know my competition very well, the moment they lay eyes on this they will implement the same, I just don't want them to outragely rip off my hard earned code.
I found this javascript obfuscator online:http://www.javascriptobfuscator.com/default.aspx
is it any good?
My question is, although it "obfuscates" the code, its still pretty easy to just donwload the .js file with my code and implement it. Is there a way to make the javascript file not load/work if its not in my domain?
This + the code obfuscation would work really well don't you think? Can you point me out something like this or a simple alternative?
Thanks
Best Regards
Joricam
One thing to think about. I can simply take your obfuscated/hard to read code and plop it right on my site and boom, it works. This is not like obfuscating PHP code where it requires a tool to decode it, and run. I can take your code as is, and it works fine.
However, if you insist:
I would just use any decent javascript minimizer to make your code harder to read. Not only will this improve the load time of the script, but also make your code harder to read.
I highly suggest something like YUI compressor or Google Closure
Note that I am stating, make it harder to read. Don't bank on this obfuscation idea, as you will not find any good solutions. It is not worth your time.
My question is, although it "obfuscates" the code, its still pretty easy to just donwload the .js file with my code and implement it. Is there a way to make the javascript file not load/work if its not in my domain?
No. There is no technique that is going to prevent a determined competitor from reverse engineering your JavaScript code.
For what you're describing - a drawer and carousel - they likely wouldn't even bother. Plenty of free, open source jQuery plugins that do that are out there. If anything, you're probably reinventing the wheel anyways.
If you don't want your code to be seen, I suggest placing it all on the server. JavaScript, by design is meant to be client-side, so regardless of what you do, people will still be able to utilize the code one way or another. If you still want to hide the code as best you can, try using Google Closure Compiler.
I'm on board with the sentiment expressed by others on this thread: You're wasting your time; what you're trying to protect has very little value and is hard to protect.
To answer your question, however:
Use flash or silverlight or some other such technology and put all of your code server side.

How to encrypt HTML, CSS and JavaScript to prevent copyright infringement [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
What are some good ways to prevent people from copying my source code?
I am looking into ways to 'encrypt' my HTML and CSS code so that a visitor cannot simply 'View Source' and copy it.
That's not possible; you should copyright your code instead if you are worried.
Or you may want to have a look at:
Obfuscated Code
There aren't any. The best you could do is some tool that will minify or obfuscate your javascript code. However, there's no way to make it truly secure. Encryption implies decryption on the client side, which exposes everything to the user.
So why is this not possible? HTML, CSS, and Javascript are all client-based. Meaning that you have to give the user your code, and it is processed on his machine. You can't simultaneously show someone the code and prevent him from seeing it.
Depending on exactly what it is you want to protect, you may want to look into server-based technologies like PHP or ASP.
You also of course have the option of just doing a really good job to build the reputation of you/your company. After all, imitation is the sincerest form of flattery. Or doing a really crappy job so that nobody wants to copy you.

Categories

Resources