<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx</link><description>Most people know about the delay signing feature of the CLR. (For those who don't check out MSDN's Delay Signing an Assembly for more details). Basically, delay signing allows a developer to add the public key token to an assembly, without having access</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#91718</link><pubDate>Thu, 18 Mar 2004 05:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:91718</guid><dc:creator>Meno</dc:creator><description>brilliant article it hits the point. I hope that Microsoft will fix this in the future.&lt;br&gt;</description></item><item><title>.NET delay signing in details</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#91765</link><pubDate>Thu, 18 Mar 2004 10:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:91765</guid><dc:creator>SiM Weblog</dc:creator><description /></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#92411</link><pubDate>Fri, 19 Mar 2004 01:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:92411</guid><dc:creator>Shawn</dc:creator><description>Hi Meno -- glad you liked the post.  However, I'm not pointing out a shortcoming with delay signing.  I'd like to clarify that there's really not anything to fix.  Developers just need to be aware of what they're allowing when they register delay signed assemblies for skip verification.</description></item><item><title>Take Outs for 18 March 2004</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#92438</link><pubDate>Fri, 19 Mar 2004 06:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:92438</guid><dc:creator>Enjoy Every Sandwich</dc:creator><description>You have been Taken Out! Comments about your posting in this link. Thanks!</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#113748</link><pubDate>Thu, 15 Apr 2004 10:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:113748</guid><dc:creator>Meno</dc:creator><description>Hi Shawn, sorry for the long delay. Ok but the important is not to fix this problem. I think you(MS) had to write it in the documentation. And in my point of view this feature is a good idea as it is, but it make no sense if you are care about security that are a little bit based on where  the code that is executed is coming from. If you have an application which should only run your signed code you can`t use delayed signing. So your development process need a other technology to handle this. So there is the still question why is there this feature.</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#113975</link><pubDate>Thu, 15 Apr 2004 17:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:113975</guid><dc:creator>Shawn</dc:creator><description>There actually is some documentation on MSDN about this.  In the page titled &amp;quot;Delay Signing an Assembly&amp;quot; (&lt;a target="_new" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondelayedsigningassembly.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcondelayedsigningassembly.asp&lt;/a&gt;), step 4 says:&lt;br&gt;&lt;br&gt;&amp;quot;4. Because the assembly does not have a valid strong name signature, the verification of that signature must be turned off. You can do this by using the –Vr option with the Strong Name tool. &lt;br&gt;The following example turns off verification for an assembly called myAssembly.dll. &lt;br&gt;&lt;br&gt;sn –Vr myAssembly.dll&lt;br&gt;CAUTION   Use the -Vr option only during development. Adding an assembly to the skip verification list creates a security vulnerability. A malicious assembly could use the fully specified assembly name (assembly name, version, culture, and public key token) of the assembly added to the skip verification list to fake its identity. This would allow the malicious assembly to also skip verification.&amp;quot;&lt;br&gt;&lt;br&gt;If you want an example of how this feature can be used, check back up in my post.  I gave an example of how delay signing is used internally on the CLR team.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>Checking For A Valid Strong Name Signature</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#150379</link><pubDate>Tue, 08 Jun 2004 00:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:150379</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>Checking For A Valid Strong Name Signature</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#150382</link><pubDate>Tue, 08 Jun 2004 00:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:150382</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#199626</link><pubDate>Wed, 28 Jul 2004 14:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:199626</guid><dc:creator>Stefan</dc:creator><description>What if the software I write contains code for checking a license. &lt;br&gt;If the customer succesfully reverse engineers my assembly and he can rebuild it with the license checking code always returning true and with delayed key signing. Because the customer owns his own machine he/she can easily sn –Vr myAssembly.dll to replace my assembly with his cracked one and continue working without needing a license. Can this be prevented, isn't this a problem??&lt;br&gt;&lt;br&gt;Stef</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#205926</link><pubDate>Mon, 02 Aug 2004 16:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:205926</guid><dc:creator>Shawn</dc:creator><description>Hi Stef,&lt;br&gt;&lt;br&gt;Yes if your customer has a physical copy of your code then he could reverse engineer it, delay sign it, then register it for skip verification.  Any code that your customer has a physical copy of will be impossible to fully protect.  You could raise the bar some by obfuscating your assembly, but if the customer is determined to bypass your license check, they will.  Even in unmanaged code, people who want to bypass license checks generally can.  Usually its just a matter of finding the magic &amp;quot;compare and branch&amp;quot; instructions that branch to the license check failed portion of your code, and switching the condition on the compare.&lt;br&gt;&lt;br&gt;The best thing you can do if you want complete security is to not allow the customer to host the licensing code.  Instead provide it via a web service, and you hold onto the licensing code.  Again, this won't prevent really determined customers from bypassing your system, but it will continue to raise the bar.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>Post Build Assembly Modification Or: Why Won't SN -Vr Work on Tampered Assemblies</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#218050</link><pubDate>Sat, 21 Aug 2004 03:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:218050</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>Booknotes</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#236899</link><pubDate>Sat, 02 Oct 2004 05:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:236899</guid><dc:creator>What Is The Sound Of One Hand Blogging?</dc:creator><description /></item><item><title>A Few Observations about Raw Signatures</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#362909</link><pubDate>Sat, 29 Jan 2005 05:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:362909</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>re: A Few Observations about Raw Signatures</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#368564</link><pubDate>Mon, 07 Feb 2005 21:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:368564</guid><dc:creator>.Net Security Blog</dc:creator><description /></item><item><title>Guiness and Beef stew</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#376491</link><pubDate>Sat, 19 Feb 2005 09:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:376491</guid><dc:creator>Rhonabwy</dc:creator><description>It's surprisingly easier and lower stress for me working late at night when I can take a route 4 bus...</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#607050</link><pubDate>Thu, 25 May 2006 16:08:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:607050</guid><dc:creator>ds</dc:creator><description>what is private key in delay siging</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#613431</link><pubDate>Fri, 02 Jun 2006 01:10:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:613431</guid><dc:creator>shawnfa</dc:creator><description>There is no private key in delay signing -- generally it is used on developer desktops where they don't have access to the company private key.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#643188</link><pubDate>Thu, 22 Jun 2006 22:39:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:643188</guid><dc:creator>Matthew Copeland</dc:creator><description>Hi Shawn,&lt;br&gt;&lt;br&gt;Love that you are making the under the hood more accessible. I am a little confused though. You say &amp;quot;Yes if your customer has a physical copy of your code then he could reverse engineer it, delay sign it, then register it for skip verification.&amp;quot;&lt;br&gt;&lt;br&gt;Why would they even need to delay sign it? Couldn't they just SN -Vr *? &lt;br&gt;&lt;br&gt;Which leads me to my main question.&lt;br&gt;&lt;br&gt;Lets take a hypothetical application which contains 10 strongly named assemblies, all signed with the same key, with no obfuscation.&lt;br&gt;&lt;br&gt;Is the following possible?&lt;br&gt;&lt;br&gt;Disassemble all 10 assemblies. &lt;br&gt;&lt;br&gt;Manually edit the IL of each assembly to remove the public key, and remove any reference public key tokens for the 10 assemblies.&lt;br&gt;&lt;br&gt;Create a new Public/Private key pair, and sign the 10 assemblies.&lt;br&gt;-----------------------------------------------&lt;br&gt;&lt;br&gt;I understand that it is impossible to fully protect code on a customers computer. If the above scenario is possible, protection becomes much more problematic.&lt;br&gt;&lt;br&gt;As I see it now.&lt;br&gt;&lt;br&gt;I can defend against the user manually removing all SN data from my assemblies by programmatically checking an executing assembly's PublicKeyToken value for null. If it is null (as it would be after removing the SN data from IL) I can have the application exit. Obviously, this code needs to be in as many places as possible to make it as difficult as possible for someone to change the IL to skip these checks (Obfuscation is a big help here).&lt;br&gt;&lt;br&gt;I can defend against the user turning off SN verification with SN -Vr *. Using StrongNameSignatureVerificationEx it is possible to programmatically check if the file's signature is valid. As above, this code needs to be in as many places possible and obfuscated.&lt;br&gt;&lt;br&gt;These two techniques would seem to be useless if the user can change the bits, AND then give the assembly a valid signature using a different key pair.&lt;br&gt;&lt;br&gt;I would appreciate any thoughts you may have.&lt;br&gt;&lt;br&gt;Matthew&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#643227</link><pubDate>Thu, 22 Jun 2006 23:14:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:643227</guid><dc:creator>Matthew Copeland</dc:creator><description>After rereading my post... would it be possible to securely store the public key token of the key i used to sign my assemblies with, and double check against that even if the signature is valid?</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#644589</link><pubDate>Fri, 23 Jun 2006 21:15:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:644589</guid><dc:creator>shawnfa</dc:creator><description>First the easy question -- SN -Vr is not a general purpose mechanism to allow tampering with assemblies. It only works if the assembly is not fully signed, so yes they would have to delay sign the assembly.&lt;br&gt;&lt;br&gt;As I mention, if the attacker has physical acceess to the assembly, there's nothing you can do but raise the bar. &amp;nbsp;Replacing the public key is certainly possible (although it will also change the identity of the assembly, so the -Vr route may be more desirable). &amp;nbsp;The attacker can also disassemble your code and remove all checks for the public key (or cause StrongNameSignatureVerification to ignore the skip verification entry, or replace the public key you're checking for with their own, or replace the CLR with a hacked up version of a different CLI implementaiton which lies to your API call).&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#647436</link><pubDate>Mon, 26 Jun 2006 17:56:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:647436</guid><dc:creator>Matthew Copeland</dc:creator><description>Hi Shawn,&lt;br&gt;&lt;br&gt;Thanks for the response. I &amp;quot;get it&amp;quot; as far as raising the bar, and understand the fact that every bar can be overcome by someone who has the skills and is determined.&lt;br&gt;&lt;br&gt;I would like to clarify something about your first statement. I can take a strongly named assembly, disassemble change the IL and reassemble without making any changes to the signature data. I will get an invlaid signature exception when the CLR attempts to load this assembly.&lt;br&gt;&lt;br&gt;The command line, SN -Vr *, instructs the CLR to skip SN verification for all assemblies. It is not necessary to have a public key token. I can load the above assembly with no exception, and I have not delay signed it.&lt;br&gt;&lt;br&gt;I understand you to be saying that I must delay sign the modified assembly. Am I missing something?&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#648090</link><pubDate>Tue, 27 Jun 2006 06:45:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648090</guid><dc:creator>shawnfa</dc:creator><description>I don't think I follow your example. &amp;nbsp;If you do:&lt;br&gt;&lt;br&gt;ildasm stronglynamed.exe /out=stronglynamed.il&lt;br&gt;ilasm stronglynamed.il&lt;br&gt;&lt;br&gt;Without specifying a key file, the resulting stronglynamed.exe will not have a strong name.&lt;br&gt;&lt;br&gt;The skip verification list only works for assemblies which are delay or test signed. If they are fully signed and tampered with, being on the list does not stop the runtime from throwing an exception when the assembly is loaded.&lt;br&gt;&lt;br&gt;-Shawn</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#681200</link><pubDate>Fri, 28 Jul 2006 09:39:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:681200</guid><dc:creator>aditya </dc:creator><description>Great article cleared my doubts&lt;br&gt;</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#2314877</link><pubDate>Sat, 28 Apr 2007 22:42:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2314877</guid><dc:creator>Nitin Arora</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;
&lt;p&gt;Yesterday night when I delay signed one of my assemblies. I noticed this abnormal behavior. Here is the scenario:&lt;/p&gt;
&lt;p&gt;I have an asp.net application where in Page_Load event of private pages, i am doing comparison of values stored in session. Session values are added when user successfully logs In.&lt;/p&gt;
&lt;p&gt;Session.Add(&amp;quot;key1&amp;quot;, &amp;quot;value1&amp;quot;);&lt;/p&gt;
&lt;p&gt;Session.Add(&amp;quot;key2&amp;quot;, &amp;quot;value1&amp;quot;);&lt;/p&gt;
&lt;p&gt;if(Session[&amp;quot;key1&amp;quot;] != Session[&amp;quot;key2&amp;quot;])&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Response.Write(&amp;quot;Keys not equal);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Response.Write(&amp;quot;Keys are equal&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;When my asp.net assembly was not delay signed it was showing &amp;quot;Keys are equal&amp;quot;. But when i delay signed my app's assembly, it started showing &amp;quot;Keys not equal&amp;quot;. I dont know what went wrong when i delay signed my assembly.&lt;/p&gt;
&lt;p&gt;After a lot of brainstorming and debugging i changed to code to &lt;/p&gt;
&lt;p&gt;if(Session[&amp;quot;key1&amp;quot;].ToString() != Session[&amp;quot;key2&amp;quot;].ToString())&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Response.Write(&amp;quot;Keys not equal);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;else&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Response.Write(&amp;quot;Keys are equal&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Then everytime it showed Keys are equal. &lt;/p&gt;
&lt;p&gt;Can you throw some light on this as what went wrong with the intial code when i delay signed it?&lt;/p&gt;
&lt;p&gt;Many Thanks&lt;/p&gt;
&lt;p&gt;Nitin Arora&lt;/p&gt;</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#2466747</link><pubDate>Mon, 07 May 2007 21:57:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2466747</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;Hi Nitin,&lt;/p&gt;
&lt;p&gt;Unfortunately I'm not going to be much help to you. &amp;nbsp;From a CLR perspective a delay signed assembly vs a fully signed assembly (with the same public key) are the same assembly. &amp;nbsp;That would indicate that something else is going on here.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item><item><title>David DeWinter &amp;raquo; The AllowPartiallyTrustedCallersAttribute (APTCA) &amp;ndash; #6</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#9634579</link><pubDate>Fri, 22 May 2009 04:14:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9634579</guid><dc:creator>David DeWinter &amp;raquo; The AllowPartiallyTrustedCallersAttribute (APTCA) &amp;ndash; #6</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.rev-net.com/ddewinter/2009/05/21/the-allowpartiallytrustedcallersattribute-aptca-6/"&gt;http://blogs.rev-net.com/ddewinter/2009/05/21/the-allowpartiallytrustedcallersattribute-aptca-6/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#9808389</link><pubDate>Mon, 29 Jun 2009 12:31:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808389</guid><dc:creator>Ritesh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My assemblies run perfectly if I run with sn -Vr commands but if I give sn -Vu command for my assembly, it gives exception as {&amp;quot;Could not load file or assembly 'ShaderEffectLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c199d42a01e99449' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)&amp;quot;:&amp;quot;ShaderEffectLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c199d42a01e99449&amp;quot;}&amp;quot;&lt;/p&gt;
&lt;p&gt;Kindly suggest.&lt;/p&gt;</description></item><item><title>re: Delay Signing</title><link>http://blogs.msdn.com/shawnfa/archive/2004/03/17/91575.aspx#9918175</link><pubDate>Thu, 05 Nov 2009 19:20:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918175</guid><dc:creator>shawnfa</dc:creator><description>&lt;p&gt;That indicates that you have a delay signed assembly which requires a skip verification entry to be used. &amp;nbsp;When you do -Vu, you remove the entry, and the assembly will no longer load.&lt;/p&gt;
&lt;p&gt;-Shawn&lt;/p&gt;
</description></item></channel></rss>