tags:

views:

227

answers:

6

Well, as we all know, you can decompile C# (dll) assemblies to find what code lays inside of them. What I do not know, is how i can hide that code.

The issue: I'd like to release some dll's that will add extra functionality to applications, but i thats all i want them to be used for. adding functionality to applications. I dont want others knowing the real source code behind it.

Let me know if its possible to do that. Thanks!

A: 

It's software; anything is possible. You can encrypt your binaries, and then decrypt all or part of them into your application at runtime. It's not foolproof, but it's up to you to decide how draconian you want to be.

Carl Norum
+2  A: 

You can use an obfuscator tool, it will help but reverse engineering will still be very possible.

Your users' computer needs to know what it needs to do, so you have to tell it. The owner of the computer has total control over it, and can therefore know himself what you told the computer to do, and he can tell it to do something else.

Andreas Bonini
+12  A: 

It's theoretically impossible to achieve 100% protection unless you control the target hardware. If the CPU is able to execute it, given enough time and knowledge, a human being can read it too. This is not even limited to C# (although it's usually easier to do in managed languages). You can use an obfuscator like Dotfuscator or XenoCode to make it harder to understand the decompiled code. If you're really concerned, you should move to a server-based application.

Mehrdad Afshari
Up to a certain degree a server-based application is reverse engineerable (if that's even a word) as well. Given enough time you can study its behavior and see every possible answer to every possible input, and eventually you'll be able to create another server-side application with the same exact **observable** behavior.
Andreas Bonini
I wouldn't count that as reverse engineering. It's reimplementing using your own code and that's another story. Patents should protect against that kind of stuff.
Mehrdad Afshari
A: 

You can write an app that will host CLR using the CLR COM api, that way you can first load and decode the assembly at the native code level. If you reinforce the native loader using several anti-reverse engeneering techniques, you can achieve good enough security.

arul
A: 

There is a way to hide the data, its called steganography. There's an author of a number of articles covered on CodeProject, who wrote a framework for doing exactly this. The title of the articles were 'Steganography ' in a series from 1 up to 12 I think. This is the website that is affiliated with the author.

There is a also a obfuscator called 'Phoenix Protector', found here, which can obfuscate the .NET code, personally, I have not tried it but it sounds good.

Hope this helps, Best regards, Tom.

tommieb75
A: 

At the very least, you should obfuscate your dlls to prevent hackers & competitors from viewing and making sense of your code. Obfuscation is not 100% foolproof, but it presents a big enough obstacle in their path.

Some obfuscators such as Crypto Obfuscator have a feature of embedding all dlls in the main exe so your dlls are not explicitly visible and available on disk to open in reverse-engineering tools such as Reflector.

logicnp