<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Vroy71&#039;s Weblog</title>
	<atom:link href="http://vroy71.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vroy71.wordpress.com</link>
	<description>My software development endeavours</description>
	<lastBuildDate>Tue, 07 Dec 2010 13:34:09 +0000</lastBuildDate>
	<language>el</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='vroy71.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Vroy71&#039;s Weblog</title>
		<link>http://vroy71.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://vroy71.wordpress.com/osd.xml" title="Vroy71&#039;s Weblog" />
	<atom:link rel='hub' href='http://vroy71.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Authenticode Gotchas</title>
		<link>http://vroy71.wordpress.com/2010/12/07/authenticode-gotcha/</link>
		<comments>http://vroy71.wordpress.com/2010/12/07/authenticode-gotcha/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 06:55:10 +0000</pubDate>
		<dc:creator>vroy71</dc:creator>
				<category><![CDATA[Code Signing (MS)]]></category>
		<category><![CDATA[code signing]]></category>

		<guid isPermaLink="false">http://vroy71.wordpress.com/?p=35</guid>
		<description><![CDATA[Authenticode comes with a few things that one must know before using it. What to sign? According to the MS various logo programs: &#8220;All executable files must be signed with an Authenticode certificate. This includes files with the following extensions: exe, dll, ocx, sys, cpl, drv, scr&#8221;. However, this  puts some penalty on the startup [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=35&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Authenticode comes with a few things that one must know before using it.</p>
<ul>
<li>What to sign? According to the MS various logo programs: <em>&#8220;All executable files must be signed with an Authenticode  certificate. This includes files with the following extensions: exe,  dll, ocx, sys, cpl, drv, scr&#8221;</em>. However, this  puts some penalty on the startup time of applications. This is because the machine needs to check that the certificate is still valid and has not been revoked. This delay maybe significant if the computer cannot access the net to do the validation. Some information on the problem (albeit old) can be found <a href="http://blogs.msdn.com/b/dougste/archive/2008/02/29/should-i-authenticode-sign-my-net-assembly.aspx">here</a>. Nevertheless the problem seems to still hold for pre-NET 2.0 assemblies</li>
</ul>
<ul>
<li>Another thing that one needs to be careful of, is the fact that software may exist forever, whereas certificates don&#8217;t. Generally certificates expire after some time. In order to avoid a situation where perfectly signed software stops working because its certificate expired, it is a good idea to timestamp all signed software. You can do this via the /t parameter. Thus, a command such as the following:</li>
</ul>
<p><em>signtool.exe sign /f BogusSite.pfx /p &lt;bogusSitePassword&gt;/t  “http://timestamp.verisign.com/scripts/timstamp.dll” SigningDemo.exe</em></p>
<p style="padding-left:60px;">will timestamp the signature (this is what the /t parameter does). The <em>“http://timestamp.verisign.com/scripts/timstamp.dll”</em> argument takes the timestamp from a free service provided by Verisign (this way we ensure that the timestamp is valid).</p>
<p style="padding-left:60px;">Putting the timestamp helps, because all it matters now is whether the certificate is valid at the time the file is signed (the time in the timestamp), and not at the time the program executes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vroy71.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vroy71.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vroy71.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=35&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vroy71.wordpress.com/2010/12/07/authenticode-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbd0b6f3666df1f10c0dcfd192e9ee00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vroy71</media:title>
		</media:content>
	</item>
		<item>
		<title>Authenticode</title>
		<link>http://vroy71.wordpress.com/2010/12/06/authenticode/</link>
		<comments>http://vroy71.wordpress.com/2010/12/06/authenticode/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 22:57:30 +0000</pubDate>
		<dc:creator>vroy71</dc:creator>
				<category><![CDATA[Code Signing (MS)]]></category>
		<category><![CDATA[code signing]]></category>

		<guid isPermaLink="false">http://vroy71.wordpress.com/?p=24</guid>
		<description><![CDATA[In order to certify that your company&#8217;s software is made by &#8230;your company and not someone else, you have to go through a process which uses the Microsoft Authenticode technology. The steps to do this are basically two: Get a certificate from a trusted certification authority Sign your .exe files with the digital signatures found [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=24&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In order to certify that your company&#8217;s software is made by &#8230;your company and not someone else, you have to go through a process which uses the Microsoft Authenticode technology.  The steps to do this are basically two:</p>
<ol>
<li>Get a certificate from a trusted certification authority</li>
<li>Sign your .exe files with the digital signatures found in this certificate.</li>
</ol>
<p>However, since most people who want to try out this technology do not actually own a trusted certificate yet, a &#8220;dummy&#8221; certificate first needs to be created. This post will try to explain the whole process.</p>
<h2><span id="more-24"></span>Step 1: Create a &#8220;trusted&#8221; certification authority</h2>
<p>MS Windows ships with a bunch of certificates that are generally considered to be <em>trusted</em>. These are certificates from companies such as Verisign, Thawte etc. These certificates are stored in the certificate store of your machine. You can have a look at it by running the command <em>certmgr.msc</em>. You can see there that there is a <em>Trusted Root Certification Authorities </em>store<em>,</em> where all the certificates of such entities are stored. If you go and buy a certificate you basically get something that says that one of the<em> trusted root certification authorities</em> trust that you are who you say you are and by extension (since Windows trusts these authorities<em>) </em>Windows also trust that you are who you say  you are<em>. </em></p>
<p>So the first step towards the road of creating numerous bogus certificates is to create one bogus certification authority and tell your machine that you trust it to be reliable. To do this we have to use one useful command line tool, namely <em>makecert.</em></p>
<p>So,</p>
<p>you can issue the following line:</p>
<p style="text-align:left;">makecert -r -pe -n &#8220;CN=BogusCert.com&#8221; -cy authority -sv &#8220;BogusCertPrivateKey.pvk&#8221; BogusCert.cer</p>
<p>which basically says:</p>
<p>-r: create a self-signed certificate</p>
<p>-pe: in such a way that its private key is stored together with the certificate (i.e. it is exportable)</p>
<p>-n: for the company with the (canonical name) BogusCert.com</p>
<p>-cy: the certificate represents a (certification) Authority</p>
<p>-sv: create and store the private key into file BogusCertPrivateKey.pvk</p>
<p>BogusCert.cer is the file where the certificate will be stored</p>
<p>After you run this command you will be asked to insert a private key of your choosing with which contents will be signed. You will have to enter the same key three times.</p>
<p>And in the end the certificate will be created and stored in file BogusCert.cer</p>
<p>After that you will have to import this certificate in your certificate store, i.e. you will have to run <em>certmgr.msc</em> go to the <em>Trusted Root Certification Authorities</em>, right-click and select &#8220;<em>All tasks</em>&#8221; and then select &#8220;<em>Import&#8230;</em>&#8221; and import BogusCert.cer as a trusted certificate.</p>
<p>This way you have explicitly told Windows that you trust BogusCert</p>
<h2>Step 2: Create a trusted certificate</h2>
<p>In the next step we can create our own certificate, and use the BogusCert authority to certify that is valid&#8230;</p>
<p style="text-align:center;">makecert -n &#8220;CN=bogusSite.com&#8221; -ic BogusCert.cer -iv BogusCertPrivateKey.pvk -pe -sv bogusSiteKey.pvk bogusSite.cer</p>
<p>This time we say that we need a certificate</p>
<p>-n: for the company with the (canonical name) BogusSite.com</p>
<p>-ic: that is issued by BogusCert (thus, we specify the certificate of BogusCert.cer)</p>
<p>-iv: and is signed with the private key found at BogusCertPrivateKey.pvk</p>
<p>-pe: in such a way that its private key is stored together with the certificate (i.e. it is exportable)</p>
<p>-sv: create and store the private key of our new site into file bogusSiteKey.pvk</p>
<p>and bogusSite.cer is the newly created certificate</p>
<p>You will be asked three times for the private key of the new certificate, and one time for the private key of the certification authority (i.e. BogusCert, the private key you typed in the previous step). Thus we have created a new certificate which is &#8220;issued&#8221; by BogusCert</p>
<h2>Step 3: Transforming certificates into the correct formats</h2>
<p>For some reason that I don&#8217;t know, certificate files, private keys etc come in various different formats. Out of the many formats the ones that interest us are the following</p>
<p>.cer format, which is the Microsoft version of a certificate file. Basically it stores the certificate in the X509 format (but it usually does not store the private key)</p>
<p>.pvk format which is a Microsoft format for storing private keys</p>
<p>.spc format which is the &#8220;Software Publisher Certificate&#8221;, another certificate format which is equibalent to the .cer format</p>
<p>.pfx personal information exchange format. The difference between this and the .cer format is that the pfx format stores the private key together with the certificate.</p>
<p>For more information one can have a look at the PKCS#n suite of standards regarding certificates.</p>
<p>Now in order to sign a file it is useful to have a certificate with the private key into one file, so we need to take the .cer certificate and the .pvk private key file and change the certificate into the .pfx format.</p>
<p>This can easily be done with the following command</p>
<p style="text-align:center;">pvk2pfx -pvk bogusSiteKey.pvk -pi  &lt;privateKeyPass&gt; -spc bogusSite.cer</p>
<p>where &lt;privateKeyPass&gt; is the password you put for the private key of bogusSite</p>
<p>When you run the command you will be asked whether to include the private key in the new certificate. Select <em>Yes</em></p>
<p>Then select the pfx file format and then type in a new private key for the pfx file.</p>
<p>Select where the pfx file (e.g BogusSite.pfx) will be stored and you are done!</p>
<h2>Step 4: Sign the file</h2>
<p>The last step is to run the signtool utility and actually sign the file.</p>
<p>Try:</p>
<p style="text-align:center;">signtool.exe sign /f BogusSite.pfx /p &lt;bogusSitePassword&gt;/t &#8220;http://timestamp.verisign.com/scripts/timstamp.dll&#8221; SigningDemo.exe</p>
<p>in order to sign the executable called SigningDemo.exe (or whatever else executable you want to sign)</p>
<p>Now if you right-click on SigningDemo.exe you will see a tab saying &#8220;Digital Signatures&#8221; and the digital signature of BogusSite!</p>
<p>(For an explanation of the /t parameter see my next post)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vroy71.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vroy71.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vroy71.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=24&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vroy71.wordpress.com/2010/12/06/authenticode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbd0b6f3666df1f10c0dcfd192e9ee00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vroy71</media:title>
		</media:content>
	</item>
		<item>
		<title>Starting my day with code signing</title>
		<link>http://vroy71.wordpress.com/2010/12/04/things-a-software-engineer-must-do/</link>
		<comments>http://vroy71.wordpress.com/2010/12/04/things-a-software-engineer-must-do/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 19:58:28 +0000</pubDate>
		<dc:creator>vroy71</dc:creator>
				<category><![CDATA[Code Signing (MS)]]></category>
		<category><![CDATA[code signing]]></category>

		<guid isPermaLink="false">http://vroy71.wordpress.com/?p=6</guid>
		<description><![CDATA[Code signing in MS world may mean one of two things: Strong singing, i.e. digitally sign a dll to ensure its uniqueness and integrity Autenticode, i.e. signing code to ensure that the code&#8217;s publisher is who he say he is To do the first take a look at: http://msdn.microsoft.com/en-us/library/xc31ft41.aspx http://msdn.microsoft.com/en-us/library/t07a3dye.aspx http://msdn.microsoft.com/en-us/library/6f05ezxy.aspx To do the second take a look [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=6&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Code signing in MS world may mean one of two things:</p>
<ul>
<li>Strong singing, i.e. digitally sign a dll to ensure its uniqueness and integrity</li>
<li>Autenticode, i.e. signing code to ensure that the code&#8217;s publisher is who he say he is</li>
</ul>
<p>To do the first take a look at:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/xc31ft41.aspx">http://msdn.microsoft.com/en-us/library/xc31ft41.aspx</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/t07a3dye.aspx">http://msdn.microsoft.com/en-us/library/t07a3dye.aspx</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/6f05ezxy.aspx">http://msdn.microsoft.com/en-us/library/6f05ezxy.aspx</a></li>
</ul>
<p>To do the second take a look at:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/8s9b9yaz(v=VS.100).aspx">http://msdn.microsoft.com/en-us/library/8s9b9yaz(v=VS.100).aspx</a></li>
<li><a href="http://www.tech-pro.net/code-signing-for-developers.html">http://www.tech-pro.net/code-signing-for-developers.html</a></li>
</ul>
<p>More info tommorow when I will actually follow the steps described above!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vroy71.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vroy71.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vroy71.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vroy71.wordpress.com&amp;blog=2667153&amp;post=6&amp;subd=vroy71&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://vroy71.wordpress.com/2010/12/04/things-a-software-engineer-must-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/cbd0b6f3666df1f10c0dcfd192e9ee00?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">vroy71</media:title>
		</media:content>
	</item>
	</channel>
</rss>
