Encrypt the contents using C# or VB.Net

Posted on 2006-06-04
Last Modified: 2008-02-01

Can anyone tell me how to prevent someone looking the contents of the assembly using ILDASM utility or by any other means? This is required for me for the security purpose.

A working code will be definitely of the big help.

Question by:run2004
    LVL 5

    Accepted Solution

    Have you looked into Dotfuscastor?  You can find it under the Tool menu in Visual Studio.  It won't prevent people from looking at it, but it will just make it really really hard to figure out what the code it's doing.  If you are not familiar with Obfuscation here is some info I stole it from

    "Obfuscation is the technology of shrouding the facts. It's not encryption, but in the context of .NET code, it might be better. Although encryption can make your assembly completely unreadable, this methodology suffered from a classic encryption flaw, it needed to keep the decryption-key with the encrypted data. So, an automated utility could be created to decrypt the code and put it out to disk. Once that happens the fully unencrypted, unobfuscated code is in plain view."

    I think obfuscation would be the way to go because encryption will be much harder.  When you encrypt something you need to decrypt it, it can be really a pain since you might have to do it on the fly.  I worked on a project where I have to decrypt stuff on that fly it was a total pain, and a super performance hit too.


    LVL 15

    Assisted Solution

    For your requirement, obfuscation is a better choice, as Aaron also has pointed. For specific encryption techniques, check out

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now