1

I had in mind, if it´s possible to encrypt all the source code from web applications (.dll) and keep the app working with this approach?.

Recently our company has been suffering many attacks to the server, and they can be able to steal some source code and read it with reverse engineer.

So my question here is this possible?

deduardolv
  • 23
  • 4
  • It used to be possible to publish the entire website as a DLL, but I don't remember how it was done. – theGleep Sep 28 '17 at 16:16
  • Well it most certainly should not be possible for an attacker to access source/assemblies or anything else you don't want them to - **that is the problem you need to fix** - not looking at encryption or obfuscation workarounds. – Alex K. Sep 28 '17 at 16:18
  • That´s right Alex K, but as you can see, even with protection you can suffer an attack. In some cases obfuscation can be another level of protection. – deduardolv Sep 28 '17 at 16:22
  • Are you willing to consider a third party solution? – Neil Weicher Apr 28 '19 at 19:15

1 Answers1

1

I think you are just trying to protect your code from being visible on the Web Server Or probably from accessing/making modifications after deploying? You probably need to look at Publish options for .NET Web application.

When you publish a web application, there is an option related to pre-compiling of your app. In my attached screenshot, the picture in left highlights the option on Publish setting window - "Precompile during publishing". Now, what it does - The precompiler produces assemblies from the pages. i.e. it generates the assembly (DLL) from your code-behind. At this point, your code is already converted into an assembly. You can ensure the authenticity of your assembly by signing it with a strong name.

Advancing further, you can check the advanced properties and configure your pre-compilation. You can uncheck the checkbox "Allow pre-compiled site to be updatable"(check my attached screenshot). What it does? -

"Compiles the .Aspx Pages, not just the code files (.VB/.CS). Leaving it checked allows you to make certain changes to the .Aspx files after it has been deployed without recompiling (ex = move the position of a control or add some additional HTML markup)."enter image description here

Hope this helps in case if you didn't know already.

Piyush Khanna
  • 296
  • 2
  • 13