Visual Studio .NET - protect my source code

Asked By Irfan Shaikh on 22-Aug-08 07:35 AM
I want to protect my source code so clients can't see it. Is it possible ? How ?

Yes , We can protect source code

Deepak Ghule replied to Irfan Shaikh on 22-Aug-08 07:36 AM

Yes , We can protect source code so clients can't see it.

ASP.NET supports a mode of development called "code-behind". This enables you to partition your code into a separate file from an .ASPX page file (which contains your static html and server control declarations).

This provides two benefits:

1) Better code/content separation/organization (enabling more tool support, multi-developer support, localization support, etc).

2) Enabling you to optionally "pre-compile" the code-behind file before deployment on a server. This step provides (among other things) the ability to protect your source code from direct access by your customers.
 

Yes

Web Star replied to Irfan Shaikh on 22-Aug-08 07:42 AM

yes in .net bydefault the structure used as codebehind file which is not showing in client m/c anyway because only dll of that file are deployed.

also

I suggest you to take a look at CliSecure product, an encryption base tool that helps proctet .net apps from being tampered.

also u can use url rewrite for protect yr .aspx page also .

Protect Source Code...

Atul Shinde replied to Irfan Shaikh on 22-Aug-08 07:46 AM

1)   If u want to protect your source code use the publish option present in Visual Studio IDE.

2)   Create Class Library and Use Add Reference (Import that class library) and use it in your application.

3)   Use 3-tier Architecture. User Interface (UI), Business Object Layer (BOL) and Data Access Layer (DAL).


yes .you can do it
pravin kumar S replied to Irfan Shaikh on 22-Aug-08 07:47 AM
Enabling you to optionally "pre-compile" the code-behind file before deployment on a server
`obfuscate code
mv ark replied to Irfan Shaikh on 22-Aug-08 07:50 AM
"Pre-compiling alone offers very little protection because assemblies can be decompiled into source that very closely resembles the original source. Obfuscation offers additional (although not perfect) protection because it mangles symbols and rearranges code blocks." - http://msdn.microsoft.com/en-us/library/ms998367.aspx#paght000028_obfuscation

Use a obfuscation tool like Dotfuscator - http://www.preemptive.com/dotfuscator-product-family.html

Dotfuscator Community Edition is provided as a standard component of Visual Studio 2003, 2005, and 2008.
See this
Sagar P replied to Irfan Shaikh on 22-Aug-08 08:11 AM

Yes we can do it by using code-behind. This enables you to partition your code into a separate file from an .ASPX page file (which contains your static html and server control declarations). Which comes in dll file after deployment

So you have to follow deployment process where all your code comes with  dll. Or you can use Publish tool which convert all code behind code into a DLL

Also try to use seperate javascript files for client side code as client side code can be easily available to client.

Also you can use Encryption and decryption for the data.

Best Luck!!!!!!!!!!!!!!!
Sujit.

Deploy as Assemblies
Arjun Priyananth replied to Irfan Shaikh on 22-Aug-08 08:19 AM
Since u have code behind feature make it build as DLL's and deploy it.
can use msbuild even..

hi
Binny ch replied to Irfan Shaikh on 22-Aug-08 09:17 AM

take a look at this site.

http://www.codeproject.com/KB/security/StrongNameExplained.aspx

Your compiled dlls can be disassembled back into source code
Robbe Morris replied to Irfan Shaikh on 22-Aug-08 07:43 PM

quite easily with tools like Lutz's Reflector.  I was reverse engineered an entire ASP.NET compiled app that was written in VB.NET.  I disassembled the compiled dlls into C# code and made the modifications.

As others have stated, you need to obfuscate and optionally encrypt your dlls before you ship them to the client.  The community edition of Dotfuscator that comes with Visual Studio .NET isn't strong enough.  Their full edition is.  There other companies that offer this but I'd recommend going with Dotfuscator from PreEmpty Solutions.

Use this
Atul Shinde replied to Irfan Shaikh on 25-Aug-08 01:24 AM
"Pre-compiling alone offers very little protection because assemblies can be decompiled into source that very closely resembles the original source. Obfuscation offers additional (although not perfect) protection because it mangles symbols and rearranges code blocks." - http://msdn.microsoft.com/en-us/library/ms998367.aspx#paght000028_obfuscation

Use a obfuscation tool like Dotfuscator - http://www.preemptive.com/dotfuscator-product-family.html

Dotfuscator Community Edition is provided as a standard component of Visual Studio 2003, 2005, and 2008.