Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm learning Silverlight, and I know that if I master it, I can apply the same concepts to WPF, which means I can do either web or desktop development pretty easily. But I've read articles and followed the discussion online, and I understand HTML5 is gaining traction for being cross-platform, and a lot of people seem to be moving to HTML5.

From my understanding, any HTML5 application would be built with HTML and JavaScript (or Flash). But is it secure? It seems like anyone can easily use their browser's "view source" option and grab your code. Is this something I should be worried about, or is there a way to protect against it?

share|improve this question

closed as off-topic by gnat, MichaelT, GlenH7, Kilian Foth, MainMa Sep 25 at 12:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – gnat, MichaelT, Kilian Foth, MainMa
If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Hi King Chan, "What language should I learn?" and "Which technology is better?" are off-topic here: asking for people's opinions on what you should learn or which one is better to develop for isn't something that fits the Stack Exchange format well. I've revised your question to focus on the security aspect, as that's something that should be definitively answerable. –  user8 Feb 23 '12 at 16:45
    
Oh I see, thanks for telling me that. But yes, that's one concern I have on HTML5. –  King Chan Feb 23 '12 at 17:00

3 Answers 3

up vote 11 down vote accepted

Silverlight will be slightly more "secure" as you are serving compiled code to the client rather than source to be interpreted on the client, but the code is still executed on the client.

Someone determined enough will be able to use reflection etc. to see inside your Silverlight XAP file if they so wish.

However, you will tie yourself up in knots worrying about this. Choose the best technology for your application and provide real value for people not to grab the code. This will depend on your application, but could include regular updates, on-line support, etc. Most people won't want to steal your code and those that are determined will do so anyway.

share|improve this answer

Anything you want to protect needs to be kept on the server, end of story.

This goes for any of the web technologies - HTML, Flash, Silverlight, etc. Anything downloaded to the client can be stolen easily.

share|improve this answer
    
Just wondering, if you have any reference on detail on securing Silverlight applications from being stolen on the client-Thx. –  Emmad Kareem Feb 23 '12 at 20:31
    
@17of26 But case like a HTML5 game, how can they keep it on server side? –  King Chan Feb 23 '12 at 20:37
1  
@KingChan by implementing the game logic on the server. Yes HTML5 can easily be stolen, but silverlight and flash applications can also easily be stolen. You don't need to worry about theft. There's nothing you can do but taken the proper legal action –  Raynos Feb 23 '12 at 20:56

From my understanding, any HTML5 application would be built with HTML and JavaScript (or Flash). But is it secure? It seems like anyone can easily use their browser's "view source" option and grab your code. Is this something I should be worried about, or is there a way to protect against it?

If you are learning SL, then go ahead. But remember, even Silverlight and Flash code can be decoded and the cracker can read your code.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.