Click here to Skip to main content
15,937,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I need to encrypt or "obfuscate" the source code in a dll file to prevent reverse engeneering to find the code. Now how can I do this and wicth one is better, encryption or obfuscate ?


Encryption refers to some method of modifying data so that it is meaningless and unreadable in it’s encrypted form. It also must be reasonably secure, that is it must not be easily decrypted without the proper key.

Anything less than that will be referred to as obfuscation. This is data that is rendered unusable by some means, but is not considered as a serious form of encryption.

Link for it:
MSDN:How to encrypt and decrypt a file by using Visual C#[^]
Share this answer
Encryption is not sufficient, since the key needed to decrypt the encrypted dll/code needs to be part of the dll, otherwise how will the .Net runtime understand it.

The better way is to obfuscate which mangles the intent or meaning of the code via various strategies like symbol renaming, flow obfuscation, call hiding, etc. So even if the code can be viewed, it cannot be understood. Some obfuscators for .Net like Removed Commercial Link also support encryption (as an added security measure) in addition to obfuscation.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900