2

The urge to protect my "craftsmanship" has always been present. Working with C/C++ I came to discover people could reverse compilations. After a lot of mental struggle, I somehow accepted the hard truth: People can always, although by hard work, get back to the source of a application. Having discovered this, I spent lots of time manually obfuscating code. Making it extremely hard for crackers to regain the origin of my precious work.

Recently I got the opportunity to behold the beauty of HTML 5 and JavaScript. I loved it from the beginning; Many people can be reached now the only requirement is a web-browser. I expect much software will be ported to HTML 5. Maybe High-end games, entire CAD programs and immense developing toolkits. It will all be possible with current, and future browsers.

The only problem I encountered is; this portability does not allow concealment of the source. It bothers me very much, knowing the service I offer can be exploited.
Though I found a lot about JavaScript obfuscating, it will always be the same interpreted language. Which means the obfuscation can be reversed very, very easy.

Now my actual question is:
Does anyone know about a way to conceal client-side code that runs in a browser, so it will be very hard to recover the original source?

durron597
  • 31,968
  • 17
  • 99
  • 158
Dennis
  • 323
  • 7
  • 17
  • 4
    Nope, there's nothing you can do beyond obfuscation. – Pointy Apr 03 '13 at 18:44
  • 6
    Hop on the OpenSource train and never look back, that is your best bet. – Chad Apr 03 '13 at 18:44
  • you can minify it, but that's about the best you can do, and it's not very much. – Marc B Apr 03 '13 at 18:45
  • If you your code is good, it will educate and make you popular. – Misha Reyzlin Apr 03 '13 at 18:45
  • most anything related to javascript "code" is out on the web... just a matter of searching. If you want, you can create your architecture complex enough... but that's about it (that I can think of) – Csharp Apr 03 '13 at 18:45
  • 4
    Nope. Javascript exists mostly to make the UI more interactive. Your innovations in that area are not likely to be remarkable, and anything that is really sensitive you can run on the server. However, since you asked: http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript – Robert Harvey Apr 03 '13 at 18:45
  • 1
    I second @RobertHarvey's notion--in 99% of cases there's either a free alternative or it would be faster to roll your own solution instead of trying to figure out how to fit someone else's code into your project. – JJJ Apr 03 '13 at 18:48
  • 3
    @Dennis, stop being so full of yourself to think that your code is special. If someone's so lazy as to copy what you've written and use it elsewhere, let them. When someone's smart enough to figure out how your code works, they're smart enough to write it for themselves. Keep calm and program on. – zzzzBov Apr 03 '13 at 18:49
  • 4
    `I spent lots of time manually obfuscating code` That sounds like a waste of a lot of time. – Chad Apr 03 '13 at 18:52
  • @RobertHarvey: Back in the days internet and browsers were a new technology, JavaScript was created. Now HTML 5 rises, along with new JavaScript implementations, it is a lot more than just making the UI more interactive. – Dennis Apr 03 '13 at 19:35
  • @zzzzBov, It is not really that I'm that full of myself. I added this touch of drama to strengthen the urge for concealing. – Dennis Apr 03 '13 at 19:42
  • @Chad, Yeah, it actually was a waste of time. But covering the source has always been important to me, because I don't want it to be stolen. – Dennis Apr 03 '13 at 19:42
  • It is apparent from your use of this site that you have no qualms with your words being reused, I can copy and paste anything you've written here. Why should writing code be any different from writing English? What makes your code inherently valuable? – zzzzBov Apr 03 '13 at 19:46

2 Answers2

2

JavaScript code can be minified and obfuscated, but that will only deter the casual attempt to reverse-engineer.

ANY code that runs in the client can be reverse engineered with sufficient effort. For JavaScript, the barrier to reverse engineering is not very high.

The reality is that obfuscation only provides a real economic benefit in a small number of use cases. Even Microsoft, well-known for closed source, has started down the open source track with Entity Framework, ASP.Net MVC and other projects. The economic benefits of open source, in those cases, apparently outweigh the economic benefits of closed source.

Eric J.
  • 147,927
  • 63
  • 340
  • 553
0

You can't conceal the javascript/html/css source of a page because the browser has to be able to read it. You can minify/obfuscate it but it's only making it a bit hard to read.

I understand your position - I have spent hundreds of hours on projects and I didn't want people to be able to take my code, etc.

But the power of open source is too great. You can't imagine how many people might actually be able to learn from your work, or use your work in a project they're trying to build themselves. It's incredibly empowering and worth it.

I owe my entire career to being able see the source of web pages and to learn how they were done.

helion3
  • 34,737
  • 15
  • 57
  • 100