<p>I was thinking about obfuscating a commercial .Net application. But is it really worth the effort to select, buy and use such a tool? Are the obfuscated binaries really safe from reverse engineering?</p>

[{'answer_id': 71209, 'author': 'kemiller2002', 'author_id': 1942, 'author_profile': 'https://Stackoverflow.com/users/1942', 'pm_score': 2, 'selected': False, 'text': '<p>No, obfuscation has been proven that it does not prevent someone from being able to decipher the compiled code.  It makes it more difficult to do so but not impossible. </p>\n'}, {'answer_id': 71232, 'author': 'Blair Conrad', 'author_id': 1199, 'author_profile': 'https://Stackoverflow.com/users/1199', 'pm_score': 6, 'selected': True, 'text': '<p>You may not have to buy a tool - Visual Studio.NET comes with a community version of Dotfuscator. Other free obfuscation tools <a href="http://twit88.com/blog/2007/09/15/free-net-obfuscation-tools/" rel="noreferrer">are listed here</a>, and they may meet your needs.</p>\n\n<p>It\'s possible that the obfuscated binaries aren\'t safe from reverse engineering, just like it\'s possible that your bike lock might be breakable/pickable. However, it\'s often the case that a small inconvenience is enough to deter would be code/bicycle thieves.</p>\n\n<p>Also, if ever it comes time to assert your rights to a piece of code in court, having been seen to make an effort to protect it (by obfuscating it) may give you extra points. :-)</p>\n\n<p>You do have to consider the downsides, though - it can be more difficult to use reflection with obfuscated code, and if you\'re using something like log4net to generate parts of log lines based on the name of the class involved, these messages can become much more difficult to interpret.</p>\n'}, {'answer_id': 71247, 'author': 'Martin', 'author_id': 11481, 'author_profile': 'https://Stackoverflow.com/users/11481', 'pm_score': 1, 'selected': False, 'text': '<p>It\'s quite simple to reverse engineer a .net app using <a href="http://www.red-gate.com/products/reflector/" rel="nofollow noreferrer">.net reflector</a> - since the app will generate VB, VC and C# code straight from the MSIL, and it\'s possible to pull out all kinds of useful gems.</p>\n\n<p>Code obfuscators hide code quite well from most reverse engineering hacks, and would be a good idea to use on proprietary and competitive code that adds value to your app.</p>\n\n<p><a href="https://web.archive.org/web/20210802164229/https://aspnet.4guysfromrolla.com/demos/printPage.aspx?path=/articles/080404-1.aspx" rel="nofollow noreferrer">There\'s a pretty good article on obfuscation and it\'s workings here</a></p>\n'}, {'answer_id': 71274, 'author': 'Magnus Johansson', 'author_id': 3584, 'author_profile': 'https://Stackoverflow.com/users/3584', 'pm_score': 2, 'selected': False, 'text': '<blockquote>\n  <p>...snip... \n  these messages can become much more\n  difficult to interpret</p>\n</blockquote>\n\n<p>Yes, but the free community edition that comes with Visual Studio has a map functionality.\nWith that you can back track the obfuscated method names to the original names.</p>\n'}, {'answer_id': 71276, 'author': 'harriyott', 'author_id': 5744, 'author_profile': 'https://Stackoverflow.com/users/5744', 'pm_score': 2, 'selected': False, 'text': '<p>I\'ve had success putting the output from one free obfuscator <a href="http://harriyott.com/2008/09/obfuscations-what-you-need-if-you-want.aspx" rel="nofollow noreferrer">into a different obfuscator</a>. In Dotfuscator CE, only some of the obfuscation tricks are included, so using a second obfuscator that has different tricks makes it more obfuscated.</p>\n'}, {'answer_id': 71280, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 3, 'selected': False, 'text': '<p>The fact that you actually can reverse engineer it does not make obfuscation useless. It does raise the bar significantly. </p>\n\n<p>An unobfuscated .NET assembly will show you all the source, highlighted and all just by downloading the <a href="http://en.wikipedia.org/wiki/.NET_Reflector" rel="noreferrer">.NET Reflector</a>. Add obfuscation to that and you\'ll reduce very significatively the amount of people who\'ll be able to modify the code.</p>\n\n<p>It depends on you are you protecting yourself from. If you\'ll ship it unobfuscated, you might as well open source the application and benefit from marketing. Shipping it obfuscated will only allow people to relatively easily generate modified binaries through patches instead of being able to steal your code and create a direct competitor. Getting the actual source from obfuscated code is very hard, depending on the obfuscator, of course.</p>\n'}, {'answer_id': 71317, 'author': 'RickL', 'author_id': 7261, 'author_profile': 'https://Stackoverflow.com/users/7261', 'pm_score': 4, 'selected': False, 'text': '<p>At our company we evaluated several different obfuscation technologies, but they all had problems.  The biggest problem was that we rely a lot on reflection, e.g. to dynamically create grids based upon property names.</p>\n\n<p>So all of the obfuscators rename things, you can disable it of course, but then you lose a lot of the benefit of obfuscation.</p>\n\n<p>Also, in our code we have a lot of NUnit tests which rely on a lot more of the methods and properties being public, this prevented some of the obfuscators from being able to obfuscate those classes.</p>\n\n<p>In the end we settled on a product called <a href="http://www.eziriz.com/" rel="noreferrer">.NET Reactor</a></p>\n\n<p>It works very well, and we don\'t have any of the problems associated with the other products.</p>\n\n<p>"In contrast to obfuscators .NET Reactor completely stops any decompiling by mixing any pure .NET assembly (written in C#, VB.NET, Delphi.NET, J#, MSIL...) with native machine code. In detail, .NET Reactor builds a native wall between potential hackers and your .NET code. The result is a standard Windows based, not MSIL compatible, file. The original .NET code remains intact, well protected by native code and invisible for prying eyes. The original .NET code is not copied on harddisk at any time. There is no tool which is able to decompile .NET Reactor protected assemblies."</p>\n'}, {'answer_id': 72102, 'author': 'Doron Yaacoby', 'author_id': 3389, 'author_profile': 'https://Stackoverflow.com/users/3389', 'pm_score': 2, 'selected': False, 'text': "<p>I think that it depends on the type of your product. If it is directed to be used by developers - obfuscation will hurt your customers. We've been using the ArcGIS products at work, and all the DLLs are obfuscated. It's making our job a lot harder, since we can't use Reflector to decipher weird behaviors. And we're buying customers who paid thousands of dollars for the product.</p>\n\n<p>So please, don't obfuscate unless you really have to.</p>\n"}, {'answer_id': 72135, 'author': 'Leigh Caldwell', 'author_id': 3267, 'author_profile': 'https://Stackoverflow.com/users/3267', 'pm_score': 1, 'selected': False, 'text': '<p><a href="https://stackoverflow.com/questions/31882/why-should-i-use-obfuscation#31902">This post</a> and the surrounding question have some discussion which might be of value. It isn\'t a yes-or-no issue.</p>\n'}, {'answer_id': 72177, 'author': 'Jay Bazuzi', 'author_id': 5314, 'author_profile': 'https://Stackoverflow.com/users/5314', 'pm_score': 5, 'selected': False, 'text': "<p>Remember that obfuscation is only a barrier to the casual examiner of your code.  If someone is serious about figuring out what you wrote, you will have a very hard time stopping them.</p>\n\n<p>If you have secrets in your code (like passwords), you're doing it wrong.</p>\n\n<p>If you worried someone might produce your own software with your ideas, you'll have more luck in the marketplace by providing new versions that your customers want, with technical support, and by being a partner to them.  Good business wins.</p>\n"}, {'answer_id': 1600687, 'author': 'Mandrake', 'author_id': 192561, 'author_profile': 'https://Stackoverflow.com/users/192561', 'pm_score': 2, 'selected': False, 'text': '<p>I am very confortable reading x86 assembly code, what about people that is working with assembly for more than 20 years ?</p>\n\n<p>You will always find someone that only need a minute to see what your c# or c code is doing...</p>\n'}, {'answer_id': 2138406, 'author': 'Nick M', 'author_id': 259097, 'author_profile': 'https://Stackoverflow.com/users/259097', 'pm_score': 2, 'selected': False, 'text': "<p>Just a note to anyone else reading this years later - I just skimmed through the Dotfuscator Community Edition (that comes with VS2008) license a few hours ago, and I believe that you cannot use this version to distribute a commercial product, or to obfuscate code from a project that involves any developers other than yourself. So for commercial app developers, it's really just a trial version.</p>\n"}, {'answer_id': 2585240, 'author': 'Daniel Dolz', 'author_id': 307280, 'author_profile': 'https://Stackoverflow.com/users/307280', 'pm_score': 0, 'selected': False, 'text': "<p>Yes, we do. We use BitHelmet obfuscator. It's new, but it works really well.</p>\n"}, {'answer_id': 2706291, 'author': 'ileon', 'author_id': 269595, 'author_profile': 'https://Stackoverflow.com/users/269595', 'pm_score': 1, 'selected': False, 'text': '<p>Yes you definitely should. Not to protect it from a determined person, but to get some profit and have customers. By the way, if you reach a point here someone tries to crack your software, that means you sell a popular software.</p>\n\n<p>The problem is what tool to choose for the job. Check out my experience with commercial obfuscators: <a href="https://stackoverflow.com/questions/337134/what-is-the-best-net-obfuscator-on-the-market/2356575#2356575">https://stackoverflow.com/questions/337134/what-is-the-best-net-obfuscator-on-the-market/2356575#2356575</a></p>\n'}, {'answer_id': 2706329, 'author': 'ChrisW', 'author_id': 49942, 'author_profile': 'https://Stackoverflow.com/users/49942', 'pm_score': 0, 'selected': False, 'text': '<blockquote>\n  <p>But is it really worth the effort to select, buy and use such a tool?</p>\n</blockquote>\n\n<p>I found Eazfuscator cheap (free), and easy to use: took about a day.\nI already had extensive automated tests (good coverage), so I reckon I could find any bugs that are/were introduced by obfuscation.</p>\n'}, {'answer_id': 23164511, 'author': 'Axel', 'author_id': 3550434, 'author_profile': 'https://Stackoverflow.com/users/3550434', 'pm_score': 2, 'selected': False, 'text': '<p>Things you should take into account:</p>\n\n<ul>\n<li><strong>Obfuscation does not protect your code or logic.</strong> It just makes it harder to read and understand. </li>\n<li><strong>Obfuscation does no one stop from reverse engineering.</strong> It just slows the process down.</li>\n<li><strong>Your intellectual property is protected by law in most countries.</strong> So if an competitor uses your code or specific implementation, you can sue him.</li>\n</ul>\n\n<p><strong>The one and only problem obfuscation can solve is that someone creates a 1:1 (or close to 1:1) copy of your specific implementation.</strong></p>\n\n<p>Also in an ideal world reverse engineering of an obfuscated application is economical unattractive.</p>\n\n<p>But back to reality:</p>\n\n<ul>\n<li><strong>There exists no tool on this planet that stops someone from copying user interfaces, behaviors or results any application provide or produce.</strong> Obfuscation is in this situations 100% useless</li>\n<li><strong>The best obfuscator on the market cannot stop one from using some kind of disassembler or hex editor</strong> and for some geeks this is pretty good to look into the heart of an application. It\'s just harder than on an unobfuscated code.</li>\n</ul>\n\n<p>So the reality is that you can make it harder and more time consuming to look into your application but you won\'t really get any reliable protection. Regardless if you use a free or an commercial product.</p>\n\n<p>Advanced technologies like control flow obfuscation or code virtualization may help to make understanding of logic sometimes really hard but they can also cause a lot of funny and hard to debug or solve problems. So they are sometimes more like an additional problem than a solution.</p>\n\n<p><strong>From my point of view obfuscation is not worth the money some companies charge for their products.</strong> If you want to nag casual developers, open source obfuscators are good enough. If you want to make it as hard as possible to look into the heart of your applications, you need to use cryptographic containers with virtual execution environments and virtual filesystems but they also provide attack vectors and may also be a source for a bag full of problems.</p>\n\n<p><strong>Your intellectual property and your products are in most countries protected by law.</strong> So if there\'s one competitor analyzing and copying your code, you can sue him. If a bad guy or and hacker or cracker takes your application you are pranked - but an obfuscator does not make a difference.</p>\n\n<p>So you should first think about your targets, your market and what you want to achieve with an obfuscator. <strong>As you can read here (and at other places) obfuscation does not really solve the problem of reverse engineering. It only makes it harder and more time consuming.</strong> But if this is what you want, you may have a look to open source obfuscators like e.g. sharpObfuscator or obfuscar which may be good enough to nag casual coders (a List can be found here: <a href="http://en.wikipedia.org/wiki/List_of_obfuscators_for_.NET" rel="nofollow noreferrer">List of .NET Obfuscators on Wikipedia</a>).</p>\n\n<p><strong>If it is possible in your scenario you might also be interested in SaaS-Concepts.</strong> This means that you provide access to your software but not the software itself. So the customer normally has no access to your assemblies. <strong>But depending on service level, security and user base it can be expensive, complex and difficult to realize a reliable, confident and performant SaaS-Service.</strong></p>\n'}]
['https://Stackoverflow.com/questions/71195', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9602/']