I am developing a software in C#. On user dashboard there will be some icons of our applications when a user clicks a icon the application ( exe file ) will be downloaded from our server and will be stored in user's computer somewhere. I want to make this applications ( exe files ) only be executed from this software and not by directly accessing by file system. Is their any solution for it so that the user can only execute application through the software and not by directly accessing it?
-
2I am totally confused by your question.Can you be more clear or elaborate it. – coder Apr 08 '12 at 16:12
2 Answers
No, that is completely impossible*. No matter how good your encryption is, no matter how obfuscated your program is, people will recover the keys and break it. Not to mention the fact that to execute code, the computer has to have a copy of the unencrypted code; and when there's a copy, another copy can easily be made. Don't bother.
* The closest thing you can get to it is probably implement an entire new language and run it in your VM, which is heavily obfuscated. However, as it is well-known, there is no such thing as irreversible obfuscation. Also, this would be really slow, as you could never compile it for fear of recovery of the contents from memory, and you'd have to create a new compiler, since any resemblance to native code would make it trivial to decipher.

- 218,210
- 55
- 464
- 476
-
What I have thought yet is to directly run EXE from bytes, is that possible? if yes then how? – Ayush Pateria Apr 08 '12 at 16:21
-
@AyushPateria: Yes, it's possible, and no, it won't offer your program any security. – Ry- Apr 08 '12 at 16:21
-
-
@AyushPateria: See [this Stack Overflow question](http://stackoverflow.com/questions/1224149/how-to-run-unmanaged-executable-from-memory-rather-than-disc). – Ry- Apr 08 '12 at 16:27
Great question. You can decrypt assembly to memory by wrapper, which gets key from server after veryfing the license, and then wrapper will create domain and execute this assembly in it. To avoid debugging software you can use Confuser from codeplex/com

- 5,296
- 1
- 28
- 31