Click here to Skip to main content
14,268,184 members

Building Security Awareness in .NET Assemblies : Part 3 - Learn to break Strong Name .NET Assemblies

Rate this:
4.72 (94 votes)
Please Sign up or sign in to vote.
4.72 (94 votes)
31 Oct 2004
Building Security Awareness in .NET Assemblies : Part 3 of 3


NeCoders shall not be held responsible for any cases of software/files being hacked due to the information provided in this article.

General Overview

Welcome back to part 3 of the Building Security Awareness in .Net Assemblies series. In this article, I will share with you the possibility of breaking Strong Named .Net Assemblies. Make sure you have already read through part 1 and 2 before continuing on.

Questions pertaining to Strong Name

I do believe many others have the same doubts as I do on whether Strong Name keys could really protect the assembly from being tampered. I would like to share my doubts with you in this article.


  1. Question : Is Strong Name key secure?
    • Answer : Yes, Strong Name key uses RSA 1024 bit encryption.
  2. Question : Is Strong Name key breakable?
    • Answer : If you have enough computing power, time and knowledge on how to break RSA, the answer is yes.
  3. Question : Can Strong Name key be removed from .NET assemblies?
    • Answer : Yes, it can be removed very easily if you know how.

The Demonstration Test machine specifications :

  • Windows XP Professional Edition SP 1 1

  • Intel Pentium 4 2.6GHz

  • 256MB DDR-RAM

  • Visual Studio .Net 2003 Professional Edition

  • Microsoft .Net Framework 1.1
  1. Download the executable files that come with this article.
  2. Open your Visual Studio .Net 2003 command prompt.
  3. Make sure you are inside the CrackingIL/bin/debug directory.
  4. Type “ildasm CrackingIL.exe /”.

  1. You must be wondering, why we are repeating what we had done in part 1 and part 2 of the series. If you notice, the way to break Strong Name keys is by manipulating the Intermediate Language. But the problem is in part 2, we did modify the Intermediate Language and at the end when we tried to convert it back to an assembly, we will receive an error. I will explain in detail on which part of the Intermediate Language that you should modified to remove the Strong Name key.
  2. Open up the with a text editor. I use notepad.

  1. Take a look at the red boxes. From what I understand, each assemblies like System.Windows.Forms, System and mscorlib contains their own public key token and version number.
  2. Now, does our assembly contain a public key? The answer is yes. Before showing it to you, I will first show you 2 screenshots; one without Strong Name key and one with Strong Name key attached.

Without Strong Name :

With Strong Name :

  1. You will notice that the difference on both sides is that the Strong Name key assembly contains a public key. In order to tamper a Strong Named .Net Assembly, just remove that highlighted section. It will look like this.

  1. Now do some modifications to the existing Intermediate Language. You have to remove the registry checking so it will not prompt you for serial number or license. Look for this code.

  1. Then remove the lines of code from IL_0000 to IL_0075. You should have an output like this.

  1. Now just edit some text to prove that you have hijacked that Strong Named key .Net Assembly. Find the code with the phrase “Welcome to NeCoders” and replace it to “You are being hijacked, Strong Names are useless here”.

Change above to:

  1. Open your Visual Studio .Net 2003 command prompt, and type “ilasm”.

  1. Try to run CrackingIL.exe. You will see this.

  1. Congratulations! You had managed to manipulate .Net assemblies with Strong Name key attached to it.


Again, I hope you find this series of the article to be interesting. There will be more articles under this series, in terms of breaking and securing the .Net assemblies. Do check out article 4 when it is available as it will explaining the many theories in .NET security. This in return should provide you with a better understanding in this topic.




This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Chua Wen Ching
Software Developer
Malaysia Malaysia
I am Chua Wen Ching and it is great to be part of CodeProject network Smile | :)

Comments and Discussions

GeneralRe: Nice one Pin
Chua Wen Ching9-Nov-04 12:18
memberChua Wen Ching9-Nov-04 12:18 
GeneralRe: Nice one Pin
rawwool (Rahul Kumar)10-Nov-04 5:58
memberrawwool (Rahul Kumar)10-Nov-04 5:58 
GeneralDisclaimer Pin
Horia Tudosie4-Nov-04 3:29
memberHoria Tudosie4-Nov-04 3:29 
GeneralRe: Disclaimer Pin
Misty_Blue11-Nov-04 11:00
memberMisty_Blue11-Nov-04 11:00 
GeneralGreat Job Pin
sandurea3-Nov-04 23:51
membersandurea3-Nov-04 23:51 
GeneralGood article Pin
Rakker713-Nov-04 7:34
memberRakker713-Nov-04 7:34 
GeneralDisturbing Pin
kaschimer2-Nov-04 9:53
memberkaschimer2-Nov-04 9:53 
GeneralRe: Disturbing Pin
Daniel Turini6-Nov-04 22:09
memberDaniel Turini6-Nov-04 22:09 
Sorry, but the author is right. Security through obscurity does not work, and that's why even MS publishes deatiled information about vulnerabilities - knowing about a vulnerability in detail is the only true way of knowing if you're in danger and how you can protect yourself.

RabidKangaroo wrote:
That's like me writing an article "50 Ways To Infiltrate Buildings and Plant Explosives" and including a disclaimer: "RabidKangaroo shall not be held responsible for any buildings that are destroyed due to the information provided in this article."
RabidKangaroo never entered a building, right? A world where only hackers know how to break code is a world where no one is safe. Good programmers need to know how to break code. Trying hard to break your own code is the first line of defense against hackers.

Yes, even I am blogging now!
GeneralRe: Disturbing Pin
Palladino9-Nov-04 22:40
memberPalladino9-Nov-04 22:40 
GeneralSuggestion Pin
afinnell1-Nov-04 7:23
memberafinnell1-Nov-04 7:23 
GeneralRe: Suggestion Pin
Chua Wen Ching1-Nov-04 13:54
memberChua Wen Ching1-Nov-04 13:54 
GeneralIncredible Pin
Mark Focas1-Nov-04 5:42
memberMark Focas1-Nov-04 5:42 
GeneralRe: Incredible Pin
Chua Wen Ching1-Nov-04 13:49
memberChua Wen Ching1-Nov-04 13:49 
GeneralRe: Incredible Pin
J.B3-Nov-04 11:27
memberJ.B3-Nov-04 11:27 
GeneralRe: Incredible Pin
Chua Wen Ching3-Nov-04 13:39
memberChua Wen Ching3-Nov-04 13:39 
QuestionIncorrect understanding of strong names? Pin
S. Senthil Kumar1-Nov-04 4:23
memberS. Senthil Kumar1-Nov-04 4:23 
AnswerRe: Incorrect understanding of strong names? Pin
Anonymous1-Nov-04 4:30
memberAnonymous1-Nov-04 4:30 
GeneralEven easier: Pin
Victor Vogelpoel1-Nov-04 2:18
memberVictor Vogelpoel1-Nov-04 2:18 
GeneralRe: Even easier: Pin
Chua Wen Ching1-Nov-04 4:18
memberChua Wen Ching1-Nov-04 4:18 
GeneralRe: Even easier: Pin
Victor Vogelpoel1-Nov-04 9:13
memberVictor Vogelpoel1-Nov-04 9:13 
GeneralRe: Even easier: Pin
Frans Bouma2-Nov-04 1:01
memberFrans Bouma2-Nov-04 1:01 
GeneralRe: Even easier: Pin
Victor Vogelpoel2-Nov-04 2:45
memberVictor Vogelpoel2-Nov-04 2:45 
GeneralRe: Even easier: Pin
Frans Bouma2-Nov-04 2:56
memberFrans Bouma2-Nov-04 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 31 Oct 2004


95 bookmarked